Detect user login

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Detect user login

Catalin Kormos
Hi there,

I have no ideea if this is possible, but maybe you gusy have, if it would be possible to detect the user login the same as logout is detected? i need this the same way as others need it, because i show an icon on the system's tray bar that is hidden after a logout/login action. Is there any other workarround for this except implementing a thread that checks the current user regulary?

Thanks,
Catalin


Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
Reply | Threaded
Open this post in threaded view
|

Re: Detect user login

Leif Mortenson-2
Catalin,
    The problem is that Windows does not provide an easy way to do
this.  When a user
logs out, the OS will send a "user logged out" signal to all running
processes.  The
Wrapper traps that and reports it.   This is done because most
applications want to shut
down when the user logs out.   There is no such signal when a user logs in.

    Starting with version 3.1.1, you can call WrapperManager.getUser or
WrapperManager.getInteractiveUser to find out who is logged in at any given
time.  This is operation does require a bit of processing as it is done
by scanning
the registry.  You would have a daemon process that would call it ever
10 seconds
or so, then stop once a logged in user was found.  The loop could then
be restarted
if the logged out signal is detected.
    The feature was actually added in version 3.1.0, but there was a
memory leak in
the call.
    Due to a couple other bugs however, I would suggest using 3.1.2.  
That version
is very stable.

Cheers,
Leif

Catalin Kormos wrote:

> Hi there,
>
> I have no ideea if this is possible, but maybe you gusy have, if it
> would be possible to detect the user login the same as logout is
> detected? i need this the same way as others need it, because i show
> an icon on the system's tray bar that is hidden after a logout/login
> action. Is there any other workarround for this except implementing a
> thread that checks the current user regulary?
>
> Thanks,
> Catalin



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: Detect user login

Catalin Kormos
Thanks for your comments Leif, i'll use a thread then :), no problem.

Regarding this, it's clear that i need to use integration method 3, and i have to override start/stop and controlEvent methods of the WrapperSimpleApp class, and reuse as much other code as possible, because i need to run JBoss as service and show an icon on the tray bar when is running.

The problem is that there is now way to extend, for ex, the WrapperSimpleApp class and reuse code as much as possible, i need to copy the source as it is in my custom WrapperSimpleApp that will also contain code to manage the tray icon. Is this right? it looks like i would realy use another  listener interface that is notified for the main usable events without beeing involved in running the wrapped app....is it possible to consider providing such an interface and events?

Regards,
Catalin

Leif Mortenson <[hidden email]> wrote:
Catalin,
The problem is that Windows does not provide an easy way to do
this. When a user
logs out, the OS will send a "user logged out" signal to all running
processes. The
Wrapper traps that and reports it. This is done because most
applications want to shut
down when the user logs out. There is no such signal when a user logs in.

Starting with version 3.1.1, you can call WrapperManager.getUser or
WrapperManager.getInteractiveUser to find out who is logged in at any given
time. This is operation does require a bit of processing as it is done
by scanning
the registry. You would have a daemon process that would call it ever
10 seconds
or so, then stop once a logged in user was found. The loop could then
be restarted
if the logged out signal is detected.
The feature was actually added in version 3.1.0, but there was a
memory leak in
the call.
Due to a couple other bugs however, I would suggest using 3.1.2.
That version
is very stable.

Cheers,
Leif

Catalin Kormos wrote:

> Hi there,
>
> I have no ideea if this is possible, but maybe you gusy have, if it
> would be possible to detect the user login the same as logout is
> detected? i need this the same way as others need it, because i show
> an icon on the system's tray bar that is hidden after a logout/login
> action. Is there any other workarround for this except implementing a
> thread that checks the current user regulary?
>
> Thanks,
> Catalin



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user


Yahoo! DSL Something to write home about. Just $16.99/mo. or less
Reply | Threaded
Open this post in threaded view
|

Re: Detect user login

Leif Mortenson-2
Catalin,
Exactly.  I have already added new event listener methods in 3.2.0 which
can be used
without having to implement the WrapperListener interface yourself.  
Working on trying
to get that out the door.

Cheers,
Leif


Catalin Kormos wrote:

> Thanks for your comments Leif, i'll use a thread then :), no problem.
>
> Regarding this, it's clear that i need to use integration method 3,
> and i have to override start/stop and controlEvent methods of the
> WrapperSimpleApp class, and reuse as much other code as possible,
> because i need to run JBoss as service and show an icon on the tray
> bar when is running.
>
> The problem is that there is now way to extend, for ex, the
> WrapperSimpleApp class and reuse code as much as possible, i need to
> copy the source as it is in my custom WrapperSimpleApp that will also
> contain code to manage the tray icon. Is this right? it looks like i
> would realy use another  listener interface that is notified for the
> main usable events without beeing involved in running the wrapped
> app....is it possible to consider providing such an interface and events?
>
> Regards,
> Catalin
>
> */Leif Mortenson <[hidden email]>/* / wrote:/
>
>     / Catalin,
>     The problem is that Windows does not provide an easy way to do
>     this. When a user
>     logs out, the OS will send a "user logged out" signal to all running
>     processes. The
>     Wrapper traps that and reports it. This is done because most
>     applications want to shut
>     down when the user logs out. There is no such signal when a user
>     logs in.
>
>     Starting with version 3.1.1, you can call WrapperManager.getUser or
>     WrapperManager.getInteractiveUser to find out who is logged in at
>     any given
>     time. This is operation does require a bit of processing as it is
>     done
>     by scanning
>     the registry. You would have a daemon process that would call it ever
>     10 seconds
>     or so, then stop once a logged in user was found. The loop could then
>     be restarted
>     if the logged out signal is detected.
>     The feature was actual ly added in version 3.1.0, but there was a
>     memory leak in
>     the call.
>     Due to a couple other bugs however, I would suggest using 3.1.2.
>     That version
>     is very stable.
>
>     Cheers,
>     Leif
>
>     Catalin Kormos wrote:
>     > Hi there,
>     >
>     > I have no ideea if this is possible, but maybe you gusy have, if it
>     > would be possible to detect the user login the same as logout is
>     > detected? i need this the same way as others need it, because i
>     show
>     > an icon on the system's tray bar that is hidden after a
>     logout/login
>     > action. Is there any other workarround for this except
>     implementing a
>     > thread that checks the current user regulary?
>     >
>     > Thanks,
>     > Catalin
>
>
>
>     -------------------------------------------------------
>     This SF.net email is sponsored by: Splunk Inc. Do you grep through
>     log files
>     for problems? Stop! Download the new AJAX search engine that makes
>     searching your log files as ea sy as surfing the web. DOWNLOAD SPLUNK!
>     http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>     _______________________________________________
>     Wrapper-user mailing list
>     [hidden email]
>     https://lists.sourceforge.net/lists/listinfo/wrapper-user
>     /
>
> /
> /
>
> / /
>
> ------------------------------------------------------------------------
> / Yahoo! DSL
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=37474/*http://promo.yahoo.com/broadband/%20>
> Something to write home about. Just $16.99/mo. or less /



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Reply | Threaded
Open this post in threaded view
|

Re: Detect user login

Catalin Kormos
Thanks again Leif for the info, i'm looking forward to such listener methods.

Regards,
Catalin

Leif Mortenson <[hidden email]> wrote:
Catalin,
Exactly. I have already added new event listener methods in 3.2.0 which
can be used
without having to implement the WrapperListener interface yourself.
Working on trying
to get that out the door.

Cheers,
Leif


Catalin Kormos wrote:

> Thanks for your comments Leif, i'll use a thread then :), no problem.
>
> Regarding this, it's clear that i need to use integration method 3,
> and i have to override start/stop and controlEvent methods of the
> WrapperSimpleApp class, and reuse as much other code as possible,
> because i need to run JBoss as service and show an icon on the tray
> bar when is running.
>
> The problem is that there is now way to extend, for ex, the
> WrapperSimpleApp class and reuse code as much as possible, i need to
> copy the source as it is in my custom WrapperSimpleApp that will also
> contain code to manage the tray icon. Is this right? it looks like i
> would realy use another listener interface that is notified for the
> main usable events without beeing involved in running the wrapped
> app....is it possible to consider providing such an interface and events?
>
> Regards,
> Catalin
>
> */Leif Mortenson /* / wrote:/
>
> / Catalin,
> The problem is that Windows does not provide an easy way to do
> this. When a user
> logs out, the OS will send a "user logged out" signal to all running
> processes. The
> Wrapper traps that and reports it. This is done because most
> applications want to shut
> down when the user logs out. There is no such signal when a user
> logs in.
>
> Starting with version 3.1.1, you can call WrapperManager.getUser or
> WrapperManager.getInteractiveUser to find out who is logged in at
> any given
> time. This is operation does require a bit of processing as it is
> done
> by scanning
> the registry. You would have a daemon process that would call it ever
> 10 seconds
> or so, then stop once a logged in user was found. The loop could then
> be restarted
> if the logged out signal is detected.
> The feature was actual ly added in version 3.1.0, but there was a
> memory leak in
> the call.
> Due to a couple other bugs however, I would suggest using 3.1.2.
> That version
> is very stable.
>
> Cheers,
> Leif
>
> Catalin Kormos wrote:
> > Hi there,
> >
> > I have no ideea if this is possible, but maybe you gusy have, if it
> > would be possible to detect the user login the same as logout is
> > detected? i need this the same way as others need it, because i
> show
> > an icon on the system's tray bar that is hidden after a
> logout/login
> > action. Is there any other workarround for this except
> implementing a
> > thread that checks the current user regulary?
> >
> > Thanks,
> > Catalin
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as ea sy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wrapper-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
> /
>
> /
> /
>
> / /
>
> ------------------------------------------------------------------------
> / Yahoo! DSL
>
> Something to write home about. Just $16.99/mo. or less /



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Wrapper-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wrapper-user


Yahoo! DSL Something to write home about. Just $16.99/mo. or less