Search in sources :

Example 1 with UnknownGroupException

use of java.rmi.activation.UnknownGroupException in project jdk8u_jdk by JetBrains.

the class PipeWriter method init.

/**
     * Initialize the Activation instantiation; start activation
     * services.
     */
private void init(int port, RMIServerSocketFactory ssf, ReliableLog log, String[] childArgs) throws Exception {
    // initialize
    this.log = log;
    numUpdates = 0;
    shutdownHook = new ShutdownHook();
    groupSemaphore = getInt("sun.rmi.activation.groupThrottle", 3);
    groupCounter = 0;
    Runtime.getRuntime().addShutdownHook(shutdownHook);
    // Use array size of 0, since the value from calling size()
    // may be out of date by the time toArray() is called.
    ActivationGroupID[] gids = groupTable.keySet().toArray(new ActivationGroupID[0]);
    synchronized (startupLock = new Object()) {
        // all the remote methods briefly synchronize on startupLock
        // (via checkShutdown) to make sure they don't happen in the
        // middle of this block.  This block must not cause any such
        // incoming remote calls to happen, or deadlock would result!
        activator = new ActivatorImpl(port, ssf);
        activatorStub = (Activator) RemoteObject.toStub(activator);
        system = new ActivationSystemImpl(port, ssf);
        systemStub = (ActivationSystem) RemoteObject.toStub(system);
        monitor = new ActivationMonitorImpl(port, ssf);
        initCommand(childArgs);
        registry = new SystemRegistryImpl(port, null, ssf, systemStub);
        if (ssf != null) {
            synchronized (initLock) {
                initDone = true;
                initLock.notifyAll();
            }
        }
    }
    startupLock = null;
    // restart services
    for (int i = gids.length; --i >= 0; ) {
        try {
            getGroupEntry(gids[i]).restartServices();
        } catch (UnknownGroupException e) {
            System.err.println(getTextResource("rmid.restart.group.warning"));
            e.printStackTrace();
        }
    }
}
Also used : ActivationGroupID(java.rmi.activation.ActivationGroupID) UnknownGroupException(java.rmi.activation.UnknownGroupException) MarshalledObject(java.rmi.MarshalledObject) UnicastRemoteObject(java.rmi.server.UnicastRemoteObject) RemoteObject(java.rmi.server.RemoteObject)

Aggregations

MarshalledObject (java.rmi.MarshalledObject)1 ActivationGroupID (java.rmi.activation.ActivationGroupID)1 UnknownGroupException (java.rmi.activation.UnknownGroupException)1 RemoteObject (java.rmi.server.RemoteObject)1 UnicastRemoteObject (java.rmi.server.UnicastRemoteObject)1