Example usage for java.rmi.server UnicastRemoteObject unexportObject

List of usage examples for java.rmi.server UnicastRemoteObject unexportObject

Introduction

In this page you can find the example usage for java.rmi.server UnicastRemoteObject unexportObject.

Prototype

public static boolean unexportObject(Remote obj, boolean force) throws java.rmi.NoSuchObjectException 

Source Link

Document

Removes the remote object, obj, from the RMI runtime.

Usage

From source file:org.brixcms.rmiserver.AbstractRmiExporterBean.java

public void destroy() throws Exception {
    logger.info("Unregistering " + server.getClass().getName() + " remote repository with name: {}",
            serviceName);// ww  w . j ava2 s .  co m
    registry.unbind(serviceName);
    UnicastRemoteObject.unexportObject(server, true);
}

From source file:org.brixcms.rmiserver.workspacemanager.WorkspaceManagerExporterBean.java

public void destroy() throws Exception {
    logger.info("Unregistring Workspace Manager remote repository with name: {}", serviceName);
    registry.unbind(serviceName);/*from  w  w w .  j  a  v a  2  s .c om*/
    UnicastRemoteObject.unexportObject(server, true);
}

From source file:org.brixcms.rmiserver.jackrabbit.RemoteRepositoryExporterBean.java

public void destroy() throws Exception {
    logger.info("Unregistering JackRabbit remote repository with name: {}", serviceName);
    registry.unbind(serviceName);//w  w w. jav a 2 s  .c o  m
    UnicastRemoteObject.unexportObject(remote, false);
}

From source file:com.okidokiteam.gouken.macosx.MacOSBoot.java

public synchronized void stop() throws KernelException {
    try {//from   ww  w  .  j ava  2 s .co m
        LOG.info("Stop hook triggered.");

        if (m_registry != null) {
            m_registry.unbind(Vault.class.getName());
            UnicastRemoteObject.unexportObject(this, true);
            UnicastRemoteObject.unexportObject(m_registry, true);
            m_registry = null;
        }
        System.gc();

        LOG.info("Shutdown complete.");

    } catch (Exception e) {
        LOG.error("Problem stopping framework.", e);
    }
}

From source file:org.opendaylight.infrautils.diagstatus.MBeanUtils.java

public static void stopRMIConnectorServer(Pair<JMXConnectorServer, Registry> jmxConnector) throws IOException {
    try {//w  w  w.j  ava  2 s.  co m
        jmxConnector.getLeft().stop();
        LOG.info("JMX Connector Server stopped {}", jmxConnector);
        UnicastRemoteObject.unexportObject(jmxConnector.getRight(), true);
    } catch (IOException e) {
        LOG.error("Error while trying to stop jmx connector server {}", jmxConnector);
        throw e;
    }
}

From source file:org.ops4j.pax.exam.rbc.internal.Activator.java

/**
 * {@inheritDoc}/*from  ww w  . j  av  a  2  s.c  o m*/
 */
public void stop(BundleContext bundleContext) throws Exception {
    LOG.debug("Unbinding " + RemoteBundleContext.class.getSimpleName());
    m_registry.unbind(RemoteBundleContext.class.getName());
    UnicastRemoteObject.unexportObject(m_remoteBundleContext, true);
    m_registry = null;
    m_remoteBundleContext = null;
    LOG.info("Remote Bundle Context stopped");
}

From source file:org.mule.transport.rmi.RmiMessageReceiverTestCase.java

@Override
protected void doTearDown() throws Exception {
    try {//from ww  w  .j a  v  a 2s .  c o  m
        messageReceiver.disconnect(); // the message receiver is disposed by its connector

        connector.disconnect();
        connector.dispose();

        UnicastRemoteObject.unexportObject(rmiRegistry, true);
    } catch (Exception e) {
        LOGGER.warn(e.toString(), e);
    }

    super.doTearDown();
}

From source file:org.sybila.parasim.computation.lifecycle.impl.distributed.RemoteExecutorImpl.java

@Override
public synchronized void destroyComputation(UUID id) throws RemoteException {
    Validate.notNull(id);/*  w  w w.j av  a 2  s . co m*/
    Context ctxt = contexts.get(id);
    if (ctxt == null) {
        throw new IllegalStateException("The computation " + id + " has already started.");
    }
    // clean exported objects
    UnicastRemoteObject.unexportObject(ctxt.resolve(RemoteQueue.class, Original.class), true);
    if (ctxt != null) {
        try {
            ctxt.destroy();
        } catch (Exception e) {
            throw new IllegalStateException("Can't destroy context.", e);
        }
    }
    contexts.remove(id);
}

From source file:xbird.engine.remote.RemoteSequenceProxy.java

public void close(final boolean force) throws RemoteException {
    if (_closed.compareAndSet(false, true)) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("unexportObject `" + this.toString() + (force ? "' explicitly." : "' by finalizer."));
        }//from   ww w.j  ava 2 s  . c om
        try {
            UnicastRemoteObject.unexportObject(this, force);
        } catch (NoSuchObjectException e) {
            LOG.error(
                    "failed unexportObject `" + this.toString() + (force ? "' explicitly." : "' by finilizer."),
                    e);
            throw e;
        }
    }
}

From source file:org.ngrinder.monitor.agent.MonitorServer.java

/**
 * Stop monitoring.//from   w ww.  j  a v  a 2 s.com
 */
public void stop() {
    LOG.info("Stop monitor.");
    if (!isRunning) {
        LOG.info("Monitor was not started!");
        return;
    }
    isRunning = false;
    try {
        jmxServer.stop();
        DataCollectManager.getInstance().stop();
        UnicastRemoteObject.unexportObject(rmiRegistry, true);
    } catch (IOException e) {
        LOG.error(e.getMessage(), e);
    }
}