|
From: Earnie D. <ed...@vr...> - 2003-09-26 13:59:13
|
You should be able to start your application when the user logs on by adding it to the users startup folder in windows. You should be able to identify the user via the system properties. Should work the way you want it to. Earnie! -----Original Message----- From: ender wiggin [mailto:end...@ya...] Sent: Friday, September 26, 2003 9:51 AM To: wra...@li... Subject: Re: [Wrapper-user] Sockets and desktop Hi. Thanks for the replay.I wonder if you could point me in the right direction.Quoting: "You are going to need to have an > application running in the User space > which is launched when the user logs in. This > component could then communicate to > the service using any of a number of methods" It would be very nice to write an small program that gets launched AUTOMATICALLY at user logon.(then this application will communicate with the service that collects messages and tell it to print the messages to screen to screen)Is there a way(In Java)? Alex --- Leif Mortenson <le...@ta...> wrote: > Alex, > I am not sure that your assumption about not > being able to use Sockets > and a GUI in the same service is correct. The > TestWrapper example > that is shipped with version 3.0.5 of the Wrapper > does both and works > just fine. > > Edit wrapper.conf and set the following > wrapper.ntservice.interactive=true > at the bottom of the file. Then install the > TestWrapper as a service > and start > it. > InstallTestWrapper-NT.bat > net start testwrapper > > Now telnet to the machine on port 9999. When it > connects, type 'R' > Must > be upper case. The Wrapper will promptly restart > the JVM.. All works fine > both using localhost and from a remote machine. > > The problems you are having with your users is a > little more > difficult. Unless you > specify an account in the wrapper.conf file, NT > services will by default > always run > as the SYSTEM user. This is also true for their > child processes (Java > in this case) > So no matter how many times you check, your user is > always going to be > SYSTEM. You are going to need to have an > application running in the > User space > which is launched when the user logs in. This > component could then > communicate to > the service using any of a number of methods. > > There is not any way that I am aware of for an > NT service to tell > when a user logs > in to the system. It sounds like it should be > possible, but not with > the current Wrapper. > > Telling when the user logs out is easy. Windows > sends a logout > signal to all processes > when any user logs out. The Wrapper intercepts this > and prevents the > Wrapper and its > JVM from exiting. The WrapperSimpleApp and > WrapperStartStopApp classes > do not > provide a way for your java app to see this signal, > but you can see it > if you use method > 3, by implementing the WrapperListener interface > directly. The > listener's controlEvent > method is called whenever any system signals are > received. This gives > the app the > opportunity to respond. > > I posted a couple of feature requests around > this so I remember to > look into ways > of making it possible to tell when and who logs in. > http://sourceforge.net/tracker/index.php?func=detail&aid=812174&group_id=394 28&atid=425190 > http://sourceforge.net/tracker/index.php?func=detail&aid=812175&group_id=394 28&atid=425190 > > Cheers, > Leif > > > > ender wiggin wrote: > > >Hello. > > > >First some details: > >I am working on a project involving an instant one > way > >messaging on windows. Basically I am writing a > >service(SocketService) that connects with a server > >through a socket and writes to file/(some > repository) > >the messages it receives. Another service( > >DesktopMessageService) reads from the files the > >messages and if it finds a new message for the > CURRENT > >user it will open a frame and show it on the > screen. > >The reason I use two services instead of one is > >because I read that a service either does neworking > or > >it accesses the desktop or console. > > The SocketService performs well, it does indeed > read > >from a socket(ServerSocket) and when contacted > there > >are messages it does store them on file. > > > >The problems arise with the DesktopMessageService.I > >have yet to find a way to detect the current > >user.Basically when the pc is booted the > >DesktopMesssage starts ,tries to detect the current > >user and print to screen a message.The problem is > that > > > >I cannot decect when a user loggs on to the > machine. > >The current user for the DesktopService is still > >System.So if I want to print a message Hi + > >System.getProperty("user.name") , even if there is > a > >user logged on it still prints Hi System , not Hi > >"Current User Name".Im also tried to restart the > JVm > >periodically but the curent user is still System. > >By the way the service works fine when tested in a > >console . > > > >So my questions are, Is there a way to detect when > a > >user loggs on and get his name? > >Also, is there a way to detect when a users logs > off? > > > >Thanks, Alex > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user ===== __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Wrapper-user mailing list Wra...@li... https://lists.sourceforge.net/lists/listinfo/wrapper-user **************************************************************************** NOTICE: This email (including any attachments) may include confidential information. It is intended solely for the individuals or entities to which it is addressed. If you have received this email in error, distribution or use of it is prohibited. Please notify the sender and permanently delete it from your email system. Also, given the nature of electronic mail and its potential to carry computer viruses, the Virginia Retirement System and the sender in no way warrant a virus free transmission. You and your organization should use appropriate means to check this email and any attachments for potential viruses and to prevent their execution. |