tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Restart of embedded OpenEJB
Date Wed, 14 Sep 2011 13:04:33 GMT
i think you should be able to do it using the ServiceManager.

- Romain

2011/9/14 szikke <mkokoszka82@gmail.com>

> Hello,
>
> I created a simply GUI manager to start/stop/restart the embedded OpenEJB
> server.
> The GUI allows me to change the interface (ejbd.bind) and port number
> (ejbd.port) for ejbd service.
> The problem is that I can not perform a full restart of the embedded
> OpenEJB
> (bind to another interface or port number) without closing my application
> completely. After restarting the OpenjEJB, it still uses the same port
> number.
>
> During the first start I can see the following console output:
>
> INFO - Deployed Application(path=classpath.ear)
> INFO - Initializing network services
> INFO - Creating ServerService(id=cxf)
> INFO - Creating ServerService(id=ejbd)
> INFO - Initializing network services
>  ** Starting Services **
>  NAME                 IP              PORT
>  ejbd                 10.100.90.9     4000
>
> During the restart, the network and server services are stopped:
>
> INFO - Stopping network services
> INFO - Stopping server services
> INFO - Destroying container system
> INFO - Undeploying app: classpath.ear
>
> but there is no info about initializing network services. Is there any way
> to perform a full restart of the ejbd service without a complete
> application
> restart?
>
> Code to start Ejb server:
>
> public boolean startEjbServer()
> {
>        try
>        {
>                Properties properties = new Properties();
>
>  properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.openejb.client.LocalInitialContextFactory");
>                properties.setProperty("openejb.embedded.remotable",
> "true");
>
>  properties.setProperty("openejb.embedded.initialcontext.close",
> "destroy");
>
>                    properties.setProperty("ejbd.threads", "200");
>                    properties.setProperty("ejbd.port", ""+port);
>                    properties.setProperty("ejbd.bind",
> ""+interfaceAddress);
>                    properties.setProperty("ejbd.disabled", "false");
>                    //properties.setProperty("ejbd.only_from",
> "127.0.0.1,192.168.1.1");
>
>                    properties.setProperty("ejbds.disabled", "true");
>                    properties.setProperty("httpejbd.disabled", "true");
>                    properties.setProperty("telnet.disabled", "true");
>                    properties.setProperty("hsql.disabled", "true");
>                    properties.setProperty("admin.disabled", "true");
>
>                    System.setProperty("Default Stateless
> Container.PoolSize", "200");
>                    System.setProperty("Default Stateless
> Container.StrictPooling",
> "true");
>                    System.setProperty("Default Stateless
> Container.TimeOut", "10");
>
>                    context = new InitialContext(properties);
>
>            return true;
>        }
>        catch (Exception e)
>        {
>                e.printStackTrace();
>                return false;
>        }
> }
>
> Code to stop EJB:
>
> public void stopEjbServer()
> {
>        try
>        {
>                context.close();
>                context = null;
>        }
>        catch (Exception e)
>        {
>                e.printStackTrace();
>        }
> }
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Restart-of-embedded-OpenEJB-tp3812630p3812630.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message