java.rmi.activation.ActivationGroupID Java Examples

The following examples show how to use java.rmi.activation.ActivationGroupID. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ActivationGroupImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a default activation group implementation.
 *
 * @param id the group's identifier
 * @param data ignored
 */
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
    throws RemoteException
{
    super(id);
    groupID = id;

    /*
     * Unexport activation group impl and attempt to export it on
     * an unshared anonymous port.  See 4692286.
     */
    unexportObject(this, true);
    RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
    UnicastRemoteObject.exportObject(this, 0, null, ssf);

    if (System.getSecurityManager() == null) {
        try {
            // Provide a default security manager.
            System.setSecurityManager(new SecurityManager());

        } catch (Exception e) {
            throw new RemoteException("unable to set security manager", e);
        }
    }
}
 
Example #2
Source File: Activation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the group entry for the group id, optionally removing it.
 * Throws UnknownGroupException if the group is not registered.
 */
private GroupEntry getGroupEntry(ActivationGroupID id, boolean rm)
    throws UnknownGroupException
{
    if (id.getClass() == ActivationGroupID.class) {
        GroupEntry entry;
        if (rm) {
            entry = groupTable.remove(id);
        } else {
            entry = groupTable.get(id);
        }
        if (entry != null && !entry.removed) {
            return entry;
        }
    }
    throw new UnknownGroupException("group unknown");
}
 
Example #3
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the group entry for the group id, optionally removing it.
 * Throws UnknownGroupException if the group is not registered.
 */
private GroupEntry getGroupEntry(ActivationGroupID id, boolean rm)
    throws UnknownGroupException
{
    if (id.getClass() == ActivationGroupID.class) {
        GroupEntry entry;
        if (rm) {
            entry = groupTable.remove(id);
        } else {
            entry = groupTable.get(id);
        }
        if (entry != null && !entry.removed) {
            return entry;
        }
    }
    throw new UnknownGroupException("group unknown");
}
 
Example #4
Source File: ActivationGroupImpl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a default activation group implementation.
 *
 * @param id the group's identifier
 * @param data ignored
 */
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
    throws RemoteException
{
    super(id);
    groupID = id;

    /*
     * Unexport activation group impl and attempt to export it on
     * an unshared anonymous port.  See 4692286.
     */
    unexportObject(this, true);
    RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
    UnicastRemoteObject.exportObject(this, 0, null, ssf);

    if (System.getSecurityManager() == null) {
        try {
            // Provide a default security manager.
            System.setSecurityManager(new SecurityManager());

        } catch (Exception e) {
            throw new RemoteException("unable to set security manager", e);
        }
    }
}
 
Example #5
Source File: ActivationGroupImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a default activation group implementation.
 *
 * @param id the group's identifier
 * @param data ignored
 */
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
    throws RemoteException
{
    super(id);
    groupID = id;

    /*
     * Unexport activation group impl and attempt to export it on
     * an unshared anonymous port.  See 4692286.
     */
    unexportObject(this, true);
    RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
    UnicastRemoteObject.exportObject(this, 0, null, ssf);

    if (System.getSecurityManager() == null) {
        try {
            // Provide a default security manager.
            System.setSecurityManager(new SecurityManager());

        } catch (Exception e) {
            throw new RemoteException("unable to set security manager", e);
        }
    }
}
 
Example #6
Source File: ActivationGroupImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a default activation group implementation.
 *
 * @param id the group's identifier
 * @param data ignored
 */
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
    throws RemoteException
{
    super(id);
    groupID = id;

    /*
     * Unexport activation group impl and attempt to export it on
     * an unshared anonymous port.  See 4692286.
     */
    unexportObject(this, true);
    RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
    UnicastRemoteObject.exportObject(this, 0, null, ssf);

    if (System.getSecurityManager() == null) {
        try {
            // Provide a default security manager.
            System.setSecurityManager(new SecurityManager());

        } catch (Exception e) {
            throw new RemoteException("unable to set security manager", e);
        }
    }
}
 
Example #7
Source File: Activation.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the group entry for the group id, optionally removing it.
 * Throws UnknownGroupException if the group is not registered.
 */
private GroupEntry getGroupEntry(ActivationGroupID id, boolean rm)
    throws UnknownGroupException
{
    if (id.getClass() == ActivationGroupID.class) {
        GroupEntry entry;
        if (rm) {
            entry = groupTable.remove(id);
        } else {
            entry = groupTable.get(id);
        }
        if (entry != null && !entry.removed) {
            return entry;
        }
    }
    throw new UnknownGroupException("group unknown");
}
 
Example #8
Source File: ActivationGroupImpl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a default activation group implementation.
 *
 * @param id the group's identifier
 * @param data ignored
 */
public ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
    throws RemoteException
{
    super(id);
    groupID = id;

    /*
     * Unexport activation group impl and attempt to export it on
     * an unshared anonymous port.  See 4692286.
     */
    unexportObject(this, true);
    RMIServerSocketFactory ssf = new ServerSocketFactoryImpl();
    UnicastRemoteObject.exportObject(this, 0, null, ssf);

    if (System.getSecurityManager() == null) {
        try {
            // Provide a default security manager.
            System.setSecurityManager(new SecurityManager());

        } catch (Exception e) {
            throw new RemoteException("unable to set security manager", e);
        }
    }
}
 
Example #9
Source File: Activation.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void inactiveGroup(ActivationGroupID id,
                          long incarnation)
    throws UnknownGroupException, RemoteException
{
    try {
        checkShutdown();
    } catch (ActivationException e) {
        return;
    }
    RegistryImpl.checkAccess("ActivationMonitor.inactiveGroup");
    getGroupEntry(id).inactiveGroup(incarnation, false);
}
 
Example #10
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void unregisterGroup(ActivationGroupID id)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    // RegistryImpl.checkAccess() is done in the SameHostOnlyServerRef
    // during unmarshallCustomData and is not applicable to local access.

    // remove entry before unregister so state is updated before
    // logged
    removeGroupEntry(id).unregisterGroup(true);
}
 
Example #11
Source File: Activation.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the group entry for the object's id. Throws
 * UnknownObjectException if the object is not registered or the
 * object's group is not registered.
 */
private GroupEntry getGroupEntry(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID gid = getGroupID(id);
    GroupEntry entry = groupTable.get(gid);
    if (entry != null && !entry.removed) {
        return entry;
    }
    throw new UnknownObjectException("object's group removed");
}
 
Example #12
Source File: Activation.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the groupID for a given id of an object in the group.
 * Throws UnknownObjectException if the object is not registered.
 */
private ActivationGroupID getGroupID(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID groupID = idTable.get(id);
    if (groupID != null) {
        return groupID;
    }
    throw new UnknownObjectException("unknown object: " + id);
}
 
Example #13
Source File: Activation.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void unregisterGroup(ActivationGroupID id)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    // RegistryImpl.checkAccess() is done in the SameHostOnlyServerRef
    // during unmarshallCustomData and is not applicable to local access.

    // remove entry before unregister so state is updated before
    // logged
    removeGroupEntry(id).unregisterGroup(true);
}
 
Example #14
Source File: Activation.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void inactiveGroup(ActivationGroupID id,
                          long incarnation)
    throws UnknownGroupException, RemoteException
{
    try {
        checkShutdown();
    } catch (ActivationException e) {
        return;
    }
    RegistryImpl.checkAccess("ActivationMonitor.inactiveGroup");
    getGroupEntry(id).inactiveGroup(incarnation, false);
}
 
Example #15
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
                                                  ActivationGroupDesc desc)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    RegistryImpl.checkAccess(
        "ActivationSystem.setActivationGroupDesc");

    checkArgs(desc, null);
    return getGroupEntry(id).setActivationGroupDesc(id, desc, true);
}
 
Example #16
Source File: Activation.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
synchronized ActivationGroupDesc setActivationGroupDesc(
        ActivationGroupID id,
        ActivationGroupDesc desc,
        boolean addRecord)
    throws UnknownGroupException, ActivationException
{
    checkRemoved();
    ActivationGroupDesc oldDesc = this.desc;
    this.desc = desc;
    // state update should occur before log update
    if (addRecord) {
        addLogRecord(new LogUpdateGroupDesc(id, desc));
    }
    return oldDesc;
}
 
Example #17
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void unregisterGroup(ActivationGroupID id)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    RegistryImpl.checkAccess("ActivationSystem.unregisterGroup");

    // remove entry before unregister so state is updated before
    // logged
    removeGroupEntry(id).unregisterGroup(true);
}
 
Example #18
Source File: Activation.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ActivationID registerObject(ActivationDesc desc)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    // RegistryImpl.checkAccess() is done in the SameHostOnlyServerRef
    // during unmarshallCustomData and is not applicable to local access.
    ActivationGroupID groupID = desc.getGroupID();
    ActivationID id = new ActivationID(activatorStub);
    getGroupEntry(groupID).registerObject(id, desc, true);
    return id;
}
 
Example #19
Source File: Activation.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void inactiveGroup(ActivationGroupID id,
                          long incarnation)
    throws UnknownGroupException, RemoteException
{
    try {
        checkShutdown();
    } catch (ActivationException e) {
        return;
    }
    RegistryImpl.checkAccess("ActivationMonitor.inactiveGroup");
    getGroupEntry(id).inactiveGroup(incarnation, false);
}
 
Example #20
Source File: Activation.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the groupID for a given id of an object in the group.
 * Throws UnknownObjectException if the object is not registered.
 */
private ActivationGroupID getGroupID(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID groupID = idTable.get(id);
    if (groupID != null) {
        return groupID;
    }
    throw new UnknownObjectException("unknown object: " + id);
}
 
Example #21
Source File: ActivationGroupInit.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Main program to start a VM for an activation group.
 */
public static void main(String args[])
{
    try {
        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }
        // read group id, descriptor, and incarnation number from stdin
        MarshalInputStream in = new MarshalInputStream(System.in);
        ActivationGroupID id  = (ActivationGroupID)in.readObject();
        ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
        long incarnation = in.readLong();

        // create and set group for the VM
        ActivationGroup.createGroup(id, desc, incarnation);
    } catch (Exception e) {
        System.err.println("Exception in starting ActivationGroupInit:");
        e.printStackTrace();
    } finally {
        try {
            System.in.close();
            // note: system out/err shouldn't be closed
            // since the parent may want to read them.
        } catch (Exception ex) {
            // ignore exceptions
        }
    }
}
 
Example #22
Source File: Activation.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the groupID for a given id of an object in the group.
 * Throws UnknownObjectException if the object is not registered.
 */
private ActivationGroupID getGroupID(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID groupID = idTable.get(id);
    if (groupID != null) {
        return groupID;
    }
    throw new UnknownObjectException("unknown object: " + id);
}
 
Example #23
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the group entry for the object's id. Throws
 * UnknownObjectException if the object is not registered or the
 * object's group is not registered.
 */
private GroupEntry getGroupEntry(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID gid = getGroupID(id);
    GroupEntry entry = groupTable.get(gid);
    if (entry != null && !entry.removed) {
        return entry;
    }
    throw new UnknownObjectException("object's group removed");
}
 
Example #24
Source File: Activation.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the group entry for the object's id. Throws
 * UnknownObjectException if the object is not registered or the
 * object's group is not registered.
 */
private GroupEntry getGroupEntry(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID gid = getGroupID(id);
    GroupEntry entry = groupTable.get(gid);
    if (entry != null && !entry.removed) {
        return entry;
    }
    throw new UnknownObjectException("object's group removed");
}
 
Example #25
Source File: Activation.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void inactiveGroup(ActivationGroupID id,
                          long incarnation)
    throws UnknownGroupException, RemoteException
{
    try {
        checkShutdown();
    } catch (ActivationException e) {
        return;
    }
    RegistryImpl.checkAccess("ActivationMonitor.inactiveGroup");
    getGroupEntry(id).inactiveGroup(incarnation, false);
}
 
Example #26
Source File: ActivationGroupInit.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Main program to start a VM for an activation group.
 */
public static void main(String args[])
{
    try {
        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }
        // read group id, descriptor, and incarnation number from stdin
        MarshalInputStream in = new MarshalInputStream(System.in);
        ActivationGroupID id  = (ActivationGroupID)in.readObject();
        ActivationGroupDesc desc = (ActivationGroupDesc)in.readObject();
        long incarnation = in.readLong();

        // create and set group for the VM
        ActivationGroup.createGroup(id, desc, incarnation);
    } catch (Exception e) {
        System.err.println("Exception in starting ActivationGroupInit:");
        e.printStackTrace();
    } finally {
        try {
            System.in.close();
            // note: system out/err shouldn't be closed
            // since the parent may want to read them.
        } catch (Exception ex) {
            // ignore exceptions
        }
    }
}
 
Example #27
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public ActivationMonitor activeGroup(ActivationGroupID id,
                                     ActivationInstantiator group,
                                     long incarnation)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    RegistryImpl.checkAccess("ActivationSystem.activeGroup");

    getGroupEntry(id).activeGroup(group, incarnation);
    return monitor;
}
 
Example #28
Source File: Activation.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the groupID for a given id of an object in the group.
 * Throws UnknownObjectException if the object is not registered.
 */
private ActivationGroupID getGroupID(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID groupID = idTable.get(id);
    if (groupID != null) {
        return groupID;
    }
    throw new UnknownObjectException("unknown object: " + id);
}
 
Example #29
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
                                                  ActivationGroupDesc desc)
    throws ActivationException, UnknownGroupException, RemoteException
{
    checkShutdown();
    // RegistryImpl.checkAccess() is done in the SameHostOnlyServerRef
    // during unmarshallCustomData and is not applicable to local access.

    checkArgs(desc, null);
    return getGroupEntry(id).setActivationGroupDesc(id, desc, true);
}
 
Example #30
Source File: Activation.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the group entry for the object's id. Throws
 * UnknownObjectException if the object is not registered or the
 * object's group is not registered.
 */
private GroupEntry getGroupEntry(ActivationID id)
    throws UnknownObjectException
{
    ActivationGroupID gid = getGroupID(id);
    GroupEntry entry = groupTable.get(gid);
    if (entry != null && !entry.removed) {
        return entry;
    }
    throw new UnknownObjectException("object's group removed");
}