|
From: Rob M. <rob...@ya...> - 2004-02-16 06:51:28
|
Thanks, Leif. Very cool. That information would be a nice addition to the site. I think it would help explain when you'd want to use one kind of wrapper class vs. another. Gracias! Rob Leif Mortenson wrote: > Rob, > > Starting with Java 1.3, a feature called shutdown hooks were added > to Java. A > > method was added to the java.lang.Runtime class which allows you to > register a > > Thread which will be started when the JVM starts to shutdown. This > can be > > triggered by either hitting CTRL-C or by calling System.exit someplace > in the > > code. > > In the case of the Wrapper, a request by the Wrapper to shutdown the > > JVM results in System.exit being called from within the JVM. This > results in all > > registered shutdown hooks being executed before the JVM actually shuts > down. > > JBoss registers such a shutdown hook to handle the case where the user > presses > > CTRL-C. This makes it very easy to integrate with the Wrapper. > > Tomcat on the other hand does not register any shutdown hooks and > will this > > shutdown hard if you hit CTRL-C in the console. In order to shut it > down cleanly > > another class must be executed. That is why its integration makes use > of the > > WrapperStartStopApp helper class. > > > > As a note, if you want your application to exit the JVM without > executing any > > shutdown hooks you can do so by calling Runtime.getRuntime.halt() > > > > Cheers, > > Leif > > > > Rob Moore wrote: > > > >> Hi, Leif, > > >> > >> Thanks for your response. The WrapperSimpleApp is working fine, but I > > >> just had the understanding that I needed to notify JBoss to shut > > >> itself down properly. From what you are saying, this is the case by > > >> default. I'm just curious how this is communicated to JBoss -- is it > > >> equivalent to hitting control-c in the console window? > > >> > >> Rob > > >> > >> Leif Mortenson wrote: > > >> > >>> Rob, >> > >>> > >>> I have never tried that integration method with JBoss. Is there a >> > >>> reason why the >> > >>> > >>> WrapperSimpleApp method is not working for you? JBoss shuts down >> > >>> normally >> > >>> > >>> using its own shutdown hook so you shouldn't have to be calling a stop >> > >>> method. >> > >>> > >>> > >>> > >>> When using the WrapperStartStopApp, both the start and stop classes >> > >>> are loaded >> > >>> > >>> using the same class path. This will only work for applications which >> > >>> allow that. >> > >>> > >>> > >>> > >>> Also what are the errors you are seeing so I can help you without >> > >>> trying to >> > >>> > >>> reproduce your configuration in the dark. >> > >>> > >>> > >>> > >>> Cheers, >> > >>> > >>> Leif >> > >>> > >>> > >>> > >>> Rob Moore wrote: >> > >>> > >>> > >>> > >>>> Has anybody been able to get WrapperStartStopApp to work successfully >>> > >>> > >>> > >>> > >>>> with JBoss? >>> > >>> > >>> > >>> > >>>> > >>> > >>>> I would like to use the WrapperStartStopApp with JBoss, but I get >>> > >>> > >>> > >>> > >>>> errors when I attempt to do so (I don't see the errors using >>> > >>> > >>> > >>> > >>>> WrapperSimpleApp) that appear to be related to the classpath. It looks >>> > >>> > >>> > >>> > >>>> like the problem results from the fact that I have to include all of >>> > >>> > >>> > >>> > >>>> the jars needed for startup and shutdown. So I was curious if there is >>> > >>> > >>> > >>> > >>>> a way to specify some jars in the classpath to be used for start and >>> > >>> > >>> > >>> > >>>> others to be used for stop. >>> > >>> > > > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > Build and deploy apps & Web services for Linux with > > a free DVD software kit from IBM. Click Now! > > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > > _______________________________________________ > > Wrapper-user mailing list > > Wra...@li... > > https://lists.sourceforge.net/lists/listinfo/wrapper-user > |