public class SOManager extends java.lang.Object implements ISharedObjectManager
Constructor and Description |
---|
SOManager(SOContainer cont) |
Modifier and Type | Method and Description |
---|---|
protected void |
addConnector(ISharedObjectConnector conn) |
ID |
addSharedObject(ID sharedObjectID,
ISharedObject sharedObject,
java.util.Map properties)
Add an ISharedObject to this container.
|
ISharedObjectConnector |
connectSharedObjects(ID sharedObjectFrom,
ID[] sharedObjectsTo)
Create an ISharedObjectConnector instance for sending messages from a
single ISharedObject to one or more receiver ISharedObjects.
|
protected ID |
createNewSharedObjectID(SharedObjectDescription sd,
ISharedObject newObject) |
ID |
createSharedObject(SharedObjectDescription sd)
Create a new ISharedObject within this container from the given
SharedObjectDescription.
|
protected ISharedObject |
createSharedObjectInstance(java.lang.Class newClass,
java.lang.Class[] argTypes,
java.lang.Object[] args) |
protected void |
debug(java.lang.String msg) |
void |
disconnectSharedObjects(ISharedObjectConnector connector)
Destroy an ISharedObjectConnector instance.
|
protected void |
dispose() |
protected java.lang.Class[] |
getArgTypes(java.lang.String[] argTypes,
java.lang.Object[] args,
java.lang.ClassLoader cl) |
static java.lang.Class[] |
getClassesForTypes(java.lang.String[] argTypes,
java.lang.Object[] args,
java.lang.ClassLoader cl) |
protected java.util.List |
getConnectors() |
ISharedObject |
getSharedObject(ID sharedObjectID)
Get the ISharedObject instance corresponding to the given sharedObjectID.
|
java.util.List |
getSharedObjectConnectors(ID sharedObjectFrom)
Get the sharedObjectConnectors associated with the given sharedObjectID
|
ID[] |
getSharedObjectIDs()
Get the array of SharedObject instances currently contained by this
ISharedObjectContainer
|
protected ISharedObject |
loadSharedObject(SharedObjectDescription sd) |
protected boolean |
removeConnector(ISharedObjectConnector conn) |
ISharedObject |
removeSharedObject(ID sharedObjectID)
Remove the given sharedObjectID from this ISharedObjectContainer.
|
void |
setRemoteAddPolicy(ISharedObjectPolicy policy)
Set this shared object manager's policy for adding remote shared objects.
|
protected void |
traceStack(java.lang.String msg,
java.lang.Throwable e) |
protected ISharedObject |
verifySharedObject(java.lang.Object newSharedObject) |
public SOManager(SOContainer cont)
protected void debug(java.lang.String msg)
protected void traceStack(java.lang.String msg, java.lang.Throwable e)
protected void addConnector(ISharedObjectConnector conn)
protected boolean removeConnector(ISharedObjectConnector conn)
protected java.util.List getConnectors()
protected java.lang.Class[] getArgTypes(java.lang.String[] argTypes, java.lang.Object[] args, java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected ISharedObject createSharedObjectInstance(java.lang.Class newClass, java.lang.Class[] argTypes, java.lang.Object[] args) throws java.lang.Exception
java.lang.Exception
protected ISharedObject verifySharedObject(java.lang.Object newSharedObject)
protected ISharedObject loadSharedObject(SharedObjectDescription sd) throws java.lang.Exception
java.lang.Exception
public ID[] getSharedObjectIDs()
ISharedObjectManager
getSharedObjectIDs
in interface ISharedObjectManager
public ID createSharedObject(SharedObjectDescription sd) throws SharedObjectCreateException
ISharedObjectManager
createSharedObject
in interface ISharedObjectManager
sd
- the SharedObjectDescription that describes the SharedObject to
be createdSharedObjectCreateException
- if the SharedObject cannot be createdprotected ID createNewSharedObjectID(SharedObjectDescription sd, ISharedObject newObject) throws IDCreateException
IDCreateException
public ID addSharedObject(ID sharedObjectID, ISharedObject sharedObject, java.util.Map properties) throws SharedObjectAddException
ISharedObjectManager
addSharedObject
in interface ISharedObjectManager
sharedObjectID
- the ID of new SharedObjectsharedObject
- the ISharedObject instance to addproperties
- the Map associated with the added ISharedObjectSharedObjectAddException
- if the add cannot be accomplished for any reasonpublic ISharedObject getSharedObject(ID sharedObjectID)
ISharedObjectManager
getSharedObject
in interface ISharedObjectManager
sharedObjectID
- of the desired ISharedObjectpublic ISharedObject removeSharedObject(ID sharedObjectID)
ISharedObjectManager
removeSharedObject
in interface ISharedObjectManager
sharedObjectID
- the ID of the ISharedObject to removepublic ISharedObjectConnector connectSharedObjects(ID sharedObjectFrom, ID[] sharedObjectsTo) throws SharedObjectConnectException
ISharedObjectManager
connectSharedObjects
in interface ISharedObjectManager
sharedObjectFrom
- the ID of the sender ISharedObjectsharedObjectsTo
- the ID[] of the receiver ISharedObjectsSharedObjectConnectException
- thrown if specified sender or receivers do not exist within
the context of this containerpublic void disconnectSharedObjects(ISharedObjectConnector connector) throws SharedObjectDisconnectException
ISharedObjectManager
disconnectSharedObjects
in interface ISharedObjectManager
connector
- the connector previously created via connectSharedObjectsSharedObjectDisconnectException
- thrown if specified connector does not exist in the context
of this containerprotected void dispose()
public java.util.List getSharedObjectConnectors(ID sharedObjectFrom)
ISharedObjectManager
getSharedObjectConnectors
in interface ISharedObjectManager
public static java.lang.Class[] getClassesForTypes(java.lang.String[] argTypes, java.lang.Object[] args, java.lang.ClassLoader cl) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void setRemoteAddPolicy(ISharedObjectPolicy policy)
ISharedObjectManager
setRemoteAddPolicy
in interface ISharedObjectManager
policy
- the ISharedObjectPolicy instance to use to check the validity
of remote requests to add/replicate a shared object into this
container