Philippe,

The problem Murad is working on is that we take Jonas, we embed it with
Jetty and several other processes which runs in separate threads inside of
the same JVM as a part of our very lightweight J2EE like server
When we want to stop this server we want to stop all these processes so they
can clean up and end gracefully and then when everything is done, shutdown
the JVM so in this case we are responsible for System.exit(0) and not Jonas.


Do you think the best solution for this would be to change stopServer() to
do not call System.exit(0) and add new method

public void killServer() throws RemoteException {
        stopServer()
        System.exit(0);
}

Thanks,

Miro Halas

-----Original Message-----
From: Philippe Coq [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 09, 2001 1:45 AM
To: Meghani, Murad
Cc: '[EMAIL PROTECTED]'
Subject: Re: How to stop Jonas cleanly?

"Meghani, Murad" wrote:
> 
> In order to stop the Jonas server a call is made to the stopServer method
of
> the Adm class.  A copy of it follows:
> 
>     public void stopServer() throws RemoteException {
> 
>         Trace.outln(trace, "Adm.stopServer() ");
> 
>         if (isTM == false) {
>             try {
>                 ejbserv.stop();
>             } catch (Exception e) {
>                 Trace.errln("Cannot remove containers" + e);
>                 throw new RemoteException("Cannot remove containers", e);
>             }
>             try {
>                 dbm.unbindDataSources();
>             } catch (Exception e) {
>                 Trace.errln("Cannot unbind datasources" + e);
>                 throw new RemoteException("Cannot unbind datasources ",
e);
>             }
>             try {
>                 jms.stop();
>             } catch (Exception e) {
>             }
> 
>         }
>                  <<<------------------------
>     }
> 
> The last statement is System.exit(0) which is killing the JVM.
> My Questions are:
>         1. Is there a way to stop the server without killing the JVM?
>         2. I want to be able to perform the System.exit(0) from my code
> rather than letting the stopServer method do it?
>         3. What are my options to cleanly shut down Jonas?
> 
> Any help in this matter would be highly appreciated.
> 
> Thanks in advance for all the help.
> > Murad Meghani
> Consultant
> Compuware Corporation
> 15305 Dallas Parkway, Suite 900
> Addison, Texas, 75001
> 972-960-0960 x1379
> www.compuware.com
> 

Hi,
the semantic of JonasAdmin -s is
stops all the JOnAS services running and
kill the server.
I am not sure to understand when it is interesting to stops
all services without killing server, and it your case who will
be take the decision to do the System.exit(0); 
By the way, may be we can provide a new command in JOnASAdmin
JonasAdmin -k = stops services+kill server
JonasAdmin -s = stops services without killing server
I wonder to know what the jonas users think of this.

For the moment a solution for you, may be to modify your version
of JOnASAdmin by removing System.exit(0) in 
objectweb/jonas/src/org/objectweb/jonas/adm/adm.java and rebuilt it
by making make in this directory.
regards,
-- 
        Philippe

Philippe Coq  Evidian   Phone: (33) 04 76 29 78 49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to