Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Java to capture OS related events Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Java to capture OS related events" Watch "Java to capture OS related events" New topic
Author

Java to capture OS related events

sanuji pillai
Greenhorn

Joined: Jul 05, 2010
Posts: 22
Hi,

I am looking for example code in java to capture OS related events like Logout/Login/Shutdown/Restart/Monitor-Lock ..etc.


Regards,

Sanuji Pillai.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3056
    
    1

Yeah... you need native code for that. Google for a JNI or preferably a JNA solution to this problem.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4761
    
    7

sanuji pillai wrote:I am looking for example code in java to capture OS related events like Logout/Login/Shutdown/Restart/Monitor-Lock ..etc.

May I ask why? It goes against the entire ethos of Java, which is to be platform-independent.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
sanuji pillai
Greenhorn

Joined: Jul 05, 2010
Posts: 22
Thank You "Stephan van Hulst" & "Winston Gutkowski"
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Java to capture OS related events
 
Similar Threads
Servlet/java method for triggering event when system is locked
Tabs within one browser share Session, but I want to capture close and time out event for each tab
bring front of other application when key pressed
EOF
capture events outside of JFrame