java.rmi.activation

Class ActivationGroup

Implemented Interfaces:
ActivationInstantiator, Remote, Serializable

public abstract class ActivationGroup
extends UnicastRemoteObject
implements ActivationInstantiator

The entity that receives the request to activate object and activates it. Frequently there is one activation group per virtual machine.
See Also:
Serialized Form

Field Summary

Fields inherited from class java.rmi.server.RemoteObject

ref

Constructor Summary

ActivationGroup(ActivationGroupID aGroupId)
Create the new activation group with the given group id.

Method Summary

protected void
activeObject(ActivationID id, MarshalledObject mObject)
Makes the call back to the groups ActivationMonitor.
abstract void
activeObject(ActivationID id, Remote obj)
The method is called when the object is exported.
static ActivationGroup
createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation)
Create the new instance of the activation group, using the class name and location information, stored in the passed descriptor.
static ActivationGroupID
currentGroupID()
Get the id of current activation group.
static ActivationSystem
getSystem()
Get the current activation system.
protected void
inactiveGroup()
Makes the call back to the groups ActivationMonitor and sets the current group to null.
boolean
inactiveObject(ActivationID id)
Notifies the monitor about the object being inactivated.
static void
setSystem(ActivationSystem aSystem)
Set the activation system for this virtual machine.

Methods inherited from class java.rmi.server.UnicastRemoteObject

clone, exportObject, exportObject, exportObject, unexportObject

Methods inherited from class java.rmi.server.RemoteServer

getClientHost, getLog, setLog

Methods inherited from class java.rmi.server.RemoteObject

equals, getRef, hashCode, toString, toStub

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

ActivationGroup

protected ActivationGroup(ActivationGroupID aGroupId)
            throws RemoteException
Create the new activation group with the given group id.
Parameters:
aGroupId - the group Id.
Throws:
RemoteException - if the group export fails.

Method Details

activeObject

protected void activeObject(ActivationID id,
                            MarshalledObject mObject)
            throws ActivationException,
                   UnknownObjectException,
                   RemoteException
Makes the call back to the groups ActivationMonitor.
Parameters:
id - the id obj the object being activated
mObject - the marshalled object, contains the activated remote object stub.
Throws:
ActivationException - on activation error
UnknownObjectException - if such object is not registered
RemoteException - on remote call (to monitor) error

activeObject

public abstract void activeObject(ActivationID id,
                                  Remote obj)
            throws ActivationException,
                   UnknownObjectException,
                   RemoteException
The method is called when the object is exported. The group must notify the activation monitor, if this was not already done before.
Parameters:
id - the object activation id
obj - the remote object implementation
Throws:
ActivationException - if the group is inactive
UnknownObjectException - if such object is not known
RemoteException - if the call to monitor fails

createGroup

public static ActivationGroup createGroup(ActivationGroupID id,
                                          ActivationGroupDesc desc,
                                          long incarnation)
            throws ActivationException
Create the new instance of the activation group, using the class name and location information, stored in the passed descriptor. The method expects the group class to have the two parameter constructor, the first parameter being the ActivationGroupID and the second the MarshalledObject. The group must be first be registered with the ActivationSystem. Once a group is created, the currentGroupID method returns the identifier for this group until the group becomes inactive.
Parameters:
id - the activation group id
desc - the group descriptor, providing the information, necessary to create the group
incarnation - the incarnation number
Returns:
the created group instance
Throws:
ActivationException - if the activation fails due any reason

currentGroupID

public static ActivationGroupID currentGroupID()
Get the id of current activation group.
Returns:
the id of the current activation group or null if none exists.

getSystem

public static ActivationSystem getSystem()
            throws ActivationException
Get the current activation system. If the system is not set via setSystem(ActivationSystem) method, the default system for this virtual machine is returned. The default system is first searched by name "java.rmi.activation.ActivationSystem" on the activation registry port. The default value of the activation registry port is ActivationSystem.SYSTEM_PORT, but it can be changed by putting the system property java.rmi.activation.port. Both activation system and activation registry are provided by the RMI daemon tool, RMID, if it is running on the local host. If the RMID is not running, the internal transient activation system will be created and returned. This internal system is highly limited in in capabilities and is not intended to be used anywhere apart automated testing.
Returns:
the activation system for this virtual machine

inactiveGroup

protected void inactiveGroup()
            throws UnknownGroupException,
                   RemoteException
Makes the call back to the groups ActivationMonitor and sets the current group to null.

inactiveObject

public boolean inactiveObject(ActivationID id)
            throws ActivationException,
                   UnknownObjectException,
                   RemoteException
Notifies the monitor about the object being inactivated.
Parameters:
id - the object being inactivated.
Returns:
true always (must be overridden to return other values).
Throws:
ActivationException - never
UnknownObjectException - if the object is not known
RemoteException - if the remote call to monitor fails

setSystem

public static void setSystem(ActivationSystem aSystem)
            throws ActivationException
Set the activation system for this virtual machine. The system can only be set if no group is active.
Parameters:
aSystem - the system to set
Throws:
ActivationException - if some group is active now.

ActivationGroup.java -- the RMI activation group. Copyright (c) 1996, 1997, 1998, 1999, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.