@Override protected MavenRemoteServer create() throws RemoteException { MavenRemoteServer server; try { server = client.acquire(this, ""); } catch (Exception e) { throw new RemoteException("Can't start maven server", e); } if (!loggerExported) { Remote loggerRemote = UnicastRemoteObject.exportObject(rmiLogger, 0); if (!(loggerExported = loggerRemote != null)) { throw new RemoteException("Can't export logger"); } } if (!listenerExported) { Remote listenerRemote = UnicastRemoteObject.exportObject(rmiDownloadListener, 0); if (!(listenerExported = listenerRemote != null)) { throw new RemoteException("Can't export download listener"); } } server.configure(rmiLogger, rmiDownloadListener); return server; }
@PreDestroy public void shutdown() { client.stopAll(false); cleanUp(); }