• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet/java method for triggering event when system is locked

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am looking for example code in java/Servlet to trigger an Event when the System-Monitor is Locked, and should Trigger Event when its unlocked.

Regards,

Sanuji Pillai.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlets execute on the server in response to a request from the browser. There is no way for them to be triggered in some client system event that has nothing to do with an HTTP request.

What are you actually trying to accomplish?
 
sanuji pillai
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thank You for your Valuable Response.


Actually i want to create Daemon Process in java. It will push data to the Data-Base when just before our System is Locked/unlocked/logged out ..etc.

So anyway we need to capture those events right?. Is it possible in Java.

Thank You,

Sanuji Pillai.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sanuji pillai wrote:Hi,

I am looking for example code in java/Servlet to trigger an Event when the System-Monitor is Locked, and should Trigger Event when its unlocked.

Regards,

Sanuji Pillai.



You can do that using SessionListener in Servlets. The listener will be notified when the session has been inactivated and activated.
 
Narayana Padmanabhuni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even you can trace if an attribute has been placed or removed from the session using SessionAttributeListener.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
He is not asking about session timeouts.

Servlets is not the answer to responding to client system events that do not involve a page loaded by a web application.
 
sanuji pillai
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not talking about session, i am talking about capturing OS related events like Logout/Login/Shutdown/Restart/Monitor-Lock ..etc.

Our Daemon Java program should capture these EVENTS.

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, servlets is not the technology you are looking for.
 
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic