public ServiceManagerProxy() throws AlreadyStartedException { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { serviceManagerClass = classLoader.loadClass("org.apache.openejb.server.ServiceManager"); } catch (ClassNotFoundException e) { String msg = "Enabling option '" + LocalInitialContext.OPENEJB_EMBEDDED_REMOTABLE + "' requires class 'org.apache.openejb.server.ServiceManager' to be available. Make sure you have the openejb-server-*.jar in your classpath and at least one protocol implementation such as openejb-ejbd-*.jar."; throw new IllegalStateException(msg, e); } Method get = getMethod("get"); Method getManager = getMethod("getManager"); if (invoke(get, null) != null) throw new AlreadyStartedException("Server services already started"); serviceManager = invoke(getManager, null); logger.info("Initializing network services"); Method init = getMethod("init"); invoke(init, serviceManager); }
public void stop() { logger.info("Stopping network services"); Method stop = getMethod("stop"); invoke(stop, serviceManager); try { Thread.sleep(3000); } catch (InterruptedException e) { Thread.interrupted(); } } }
public ServiceManagerProxy(final boolean checkAlreadyStarted) throws AlreadyStartedException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { serviceManagerClass = classLoader.loadClass("org.apache.openejb.server.ServiceManager"); } catch (final ClassNotFoundException e) { final String msg = "Enabling option '" + LocalInitialContext.OPENEJB_EMBEDDED_REMOTABLE + "' requires class 'org.apache.openejb.server.ServiceManager' to be available. Make sure you have the openejb-server-*.jar in your classpath and at least one protocol implementation such as openejb-ejbd-*.jar."; throw new IllegalStateException(msg, e); } final Method get = getMethod("get"); final Method getManager = getMethod("getManager"); if (checkAlreadyStarted && invoke(get, null) != null) { throw new AlreadyStartedException("Server services already started"); } serviceManager = invoke(getManager, null); logger.info("Initializing network services"); final Method init = getMethod("init"); invoke(init, serviceManager); }
public void start() { logger.info("Initializing network services"); final Method start = getMethod("start", boolean.class); invoke(start, serviceManager, false); }
public void stop() { logger.info("Stopping network services"); final Method stop = getMethod("stop"); invoke(stop, serviceManager); } }
public ServiceManagerProxy(final boolean checkAlreadyStarted) throws AlreadyStartedException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); try { serviceManagerClass = classLoader.loadClass("org.apache.openejb.server.ServiceManager"); } catch (final ClassNotFoundException e) { final String msg = "Enabling option '" + LocalInitialContext.OPENEJB_EMBEDDED_REMOTABLE + "' requires class 'org.apache.openejb.server.ServiceManager' to be available. Make sure you have the openejb-server-*.jar in your classpath and at least one protocol implementation such as openejb-ejbd-*.jar."; throw new IllegalStateException(msg, e); } final Method get = getMethod("get"); final Method getManager = getMethod("getManager"); if (checkAlreadyStarted && invoke(get, null) != null) { throw new AlreadyStartedException("Server services already started"); } serviceManager = invoke(getManager, null); logger.info("Initializing network services"); final Method init = getMethod("init"); invoke(init, serviceManager); }
public void start() { logger.info("Initializing network services"); Method start = getMethod("start", boolean.class); invoke(start, serviceManager, false); }
public void start() { logger.info("Initializing network services"); final Method start = getMethod("start", boolean.class); invoke(start, serviceManager, false); }
public void stop() { logger.info("Stopping network services"); final Method stop = getMethod("stop"); invoke(stop, serviceManager); } }