public class SOManager extends 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,
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(Class newClass,
Class[] argTypes,
Object[] args) |
protected void |
debug(String msg) |
void |
disconnectSharedObjects(ISharedObjectConnector connector)
Destroy an ISharedObjectConnector instance.
|
protected void |
dispose() |
protected Class[] |
getArgTypes(String[] argTypes,
Object[] args,
ClassLoader cl) |
static Class[] |
getClassesForTypes(String[] argTypes,
Object[] args,
ClassLoader cl) |
protected List |
getConnectors() |
ISharedObject |
getSharedObject(ID sharedObjectID)
Get the ISharedObject instance corresponding to the given sharedObjectID.
|
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(String msg,
Throwable e) |
protected ISharedObject |
verifySharedObject(Object newSharedObject) |
public SOManager(SOContainer cont)
protected void debug(String msg)
protected void addConnector(ISharedObjectConnector conn)
protected boolean removeConnector(ISharedObjectConnector conn)
protected List getConnectors()
protected Class[] getArgTypes(String[] argTypes, Object[] args, ClassLoader cl) throws ClassNotFoundException
ClassNotFoundException
protected ISharedObject createSharedObjectInstance(Class newClass, Class[] argTypes, Object[] args) throws Exception
Exception
protected ISharedObject verifySharedObject(Object newSharedObject)
protected ISharedObject loadSharedObject(SharedObjectDescription sd) throws Exception
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, 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 List getSharedObjectConnectors(ID sharedObjectFrom)
ISharedObjectManager
getSharedObjectConnectors
in interface ISharedObjectManager
public static Class[] getClassesForTypes(String[] argTypes, Object[] args, ClassLoader cl) throws ClassNotFoundException
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
containerCopyright © 2004–2020 Eclipse Foundation. All rights reserved.