Ejemplo n.º 1
0
  @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;
  }
Ejemplo n.º 2
0
 @PreDestroy
 public void shutdown() {
   client.stopAll(false);
   cleanUp();
 }