@Override public void close() { instance.container.destroy(); instance.container = null; }
@Override public void cleanup() throws IOException { System.out.println("Cleanup called"); server.destroy(); } }
@Override public void cleanup() throws IOException { System.out.println("Cleanup called"); server.destroy(); } }
@Override public void close() { final ReentrantLock lock = LOCK; lock.lock(); try { instance.container.destroy(); instance.container = null; } finally { lock.unlock(); } }
@Override public void undeploy(final String name) throws IOException { if (null != server) { server.destroy(); } final File folder = new File(currentFile.getParentFile(), currentFile.getName().substring(0, currentFile.getName().length() - 4)); if (folder.exists()) { delete(folder); } delete(currentFile); }
@Override public void undeploy(final String name) throws IOException { if (null != server) { server.destroy(); } final File folder = new File(currentFile.getParentFile(), currentFile.getName().substring(0, currentFile.getName().length() - 4)); if (folder.exists()) { delete(folder); } delete(currentFile); }
public static void main(final String[] args) { assert args.length > 0 : "no arguments supplied: valid arguments are 'start' or 'stop'"; if (args[0].equalsIgnoreCase(START)) { final RemoteServer remoteServer = new RemoteServer(); try { remoteServer.start(); } catch (final Exception e) { remoteServer.destroy(); e.printStackTrace(System.err); } } else if (args[0].equalsIgnoreCase(STOP)) { final RemoteServer remoteServer = new RemoteServer(); remoteServer.serverHasAlreadyBeenStarted = false; try { remoteServer.forceStop(); } catch (final Exception e) { e.printStackTrace(System.err); } } else { throw new OpenEJBRuntimeException("valid arguments are 'start' or 'stop'"); } }
public static void main(final String[] args) { assert args.length > 0 : "no arguments supplied: valid arguments are 'start' or 'stop'"; if (args[0].equalsIgnoreCase(START)) { final RemoteServer remoteServer = new RemoteServer(); try { remoteServer.start(); } catch (final Exception e) { remoteServer.destroy(); throw e; } } else if (args[0].equalsIgnoreCase(STOP)) { final RemoteServer remoteServer = new RemoteServer(); remoteServer.serverHasAlreadyBeenStarted = false; try { remoteServer.forceStop(); } catch (final Exception e) { e.printStackTrace(System.err); } } else { throw new OpenEJBRuntimeException("valid arguments are 'start' or 'stop'"); } }
@Override public boolean deploy(final InputStream archive, final String name) throws IOException { if (name.endsWith("war")) { currentFile = new File(WEBAPP_DIR, name); } else { currentFile = new File(APPS_DIR, name); } System.out.println(currentFile); writeToFile(currentFile, archive); final int port = ServerLocal.getPort(-1); if (port > 0) { server = new RemoteServer(100, true); server.setPortStartup(port); } else { throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'"); } try { server.start(); } catch (final Exception e) { server.destroy(); e.printStackTrace(); throw new RuntimeException(e); } return (exception = lookup().exception()) == null; }
"start", true); } catch (final Exception e) { instance.container.destroy(); throw e;
@Override public boolean deploy(final InputStream archive, final String name) throws IOException { if (name.endsWith("war")) { currentFile = new File(WEBAPP_DIR, name); } else { currentFile = new File(APPS_DIR, name); } System.out.println(currentFile); writeToFile(currentFile, archive); final int port = ServerLocal.getPort(-1); if (port > 0) { server = new RemoteServer(100, true); server.setPortStartup(port); } else { throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'"); } try { server.start(); } catch (final Exception e) { server.destroy(); e.printStackTrace(); throw e; } return (exception = lookup().exception()) == null; }
"start", true); } catch (final Exception e) { instance.container.destroy(); throw e;