public class SOContext extends Object implements ISharedObjectContext
| Modifier and Type | Field and Description |
|---|---|
protected SOContainer |
container |
protected ID |
homeContainerID |
protected boolean |
isActive |
protected Map |
properties |
protected IQueueEnqueue |
queue |
protected ID |
sharedObjectID |
| Constructor and Description |
|---|
SOContext(ID objID,
ID homeID,
SOContainer cont,
Map props,
IQueueEnqueue queue) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(ID groupID,
IConnectContext joinContext)
(non-Javadoc)
|
void |
disconnect()
(non-Javadoc)
|
Object |
getAdapter(Class clazz) |
ID |
getConnectedID()
(non-Javadoc)
|
Namespace |
getConnectNamespace()
Get the Namespace instance that defines the ID type expected by the
remote target container
|
ID[] |
getGroupMemberIDs()
(non-Javadoc)
|
ID |
getLocalContainerID()
Get the local container instance's ID
|
Map |
getLocalContainerProperties()
Get local container properties that it wishes to expose to shared object
access
|
IQueueEnqueue |
getQueue()
Get the IQueueEnqueue instance associated with this ISharedObject.
|
ISharedObjectManager |
getSharedObjectManager()
Get the ISharedObjectManager for this context
|
boolean |
isActive() |
boolean |
isGroupManager()
(non-Javadoc)
|
boolean |
isGroupServer() |
protected boolean |
isInactive() |
protected void |
makeInactive() |
void |
sendCreate(ID toContainerID,
ReplicaSharedObjectDescription sd)
Send message to create a remote instance of an ISharedObject with the
same ID as this instance.
|
void |
sendCreateResponse(ID toContainerID,
Throwable throwable,
long identifier)
Send create response back to an ISharedObject with the same ID as this
instance.
|
void |
sendDispose(ID toContainerID)
Send message to dispose of a remote instance of the ISharedObject with
same ID as this instance.
|
void |
sendMessage(ID toContainerID,
Object data)
Send arbitrary message to remote instance of the ISharedObject with same
ID as this instance.
|
protected void |
trace(String msg) |
protected void |
traceStack(String msg,
Throwable e) |
protected SOContainer container
protected ID sharedObjectID
protected ID homeContainerID
protected boolean isActive
protected Map properties
protected IQueueEnqueue queue
public SOContext(ID objID, ID homeID, SOContainer cont, Map props, IQueueEnqueue queue)
public boolean isActive()
isActive in interface ISharedObjectContextprotected void trace(String msg)
protected void makeInactive()
protected boolean isInactive()
public ID getLocalContainerID()
ISharedObjectContextgetLocalContainerID in interface ISharedObjectContextpublic ISharedObjectManager getSharedObjectManager()
ISharedObjectContextgetSharedObjectManager in interface ISharedObjectContextpublic IQueueEnqueue getQueue()
ISharedObjectContextgetQueue in interface ISharedObjectContextpublic void connect(ID groupID, IConnectContext joinContext) throws ContainerConnectException
ISharedObjectContextconnect in interface ISharedObjectContextContainerConnectExceptionIContainer.connect(ID,IConnectContext)public void disconnect()
ISharedObjectContextdisconnect in interface ISharedObjectContextIContainer.disconnect()public ID getConnectedID()
ISharedObjectContextgetConnectedID in interface ISharedObjectContextIContainer.getConnectedID()public boolean isGroupManager()
ISharedObjectContextisGroupManager in interface ISharedObjectContextIReliableContainer.isGroupManager()public boolean isGroupServer()
public ID[] getGroupMemberIDs()
ISharedObjectContextgetGroupMemberIDs in interface ISharedObjectContextIReliableContainer.getGroupMemberIDs()public void sendCreate(ID toContainerID, ReplicaSharedObjectDescription sd) throws IOException
ISharedObjectContextsendCreate in interface ISharedObjectContexttoContainerID - the ID of the remote that is the target
of the create request. If this parameter is null, the request
is assumed to be made of all currently in the
given group (excepting the local container).sd - the ReplicaSharedObjectDescription describing the class,
constructor and other properties to be associated with the new
instanceIOException - thrown if message cannot be sent by containerpublic void sendCreateResponse(ID toContainerID, Throwable throwable, long identifier) throws IOException
ISharedObjectContextsendCreateResponse in interface ISharedObjectContexttoContainerID - the ID of the target that is to receive this responsethrowable - a throwable associated with the creation. Null means that no
exception occurredidentifier - the identifier used in the original create message (in the
shared object description)IOException - thrown if the create response cannot be sentpublic void sendDispose(ID toContainerID) throws IOException
ISharedObjectContextsendDispose in interface ISharedObjectContexttoContainerID - the ID of the remote that is the target
of the dispose request. If this parameter is null, the request
is assumed to be made of all remotes
currently in the given group (excepting the local container).IOException - thrown if message cannot be sent by container, or if data
cannot be serializedpublic void sendMessage(ID toContainerID, Object data) throws IOException
ISharedObjectContextsendMessage in interface ISharedObjectContexttoContainerID - the ID of the remote that is the target
for the sendMessage. If this parameter is null,
the message is sent to the entire group membership all remote
containers currently in the given group (excepting the local
container).data - arbitrary message object. The allowable types of this
parameter are dependent upon the type of the underlying
implementing containerIOException - thrown if message cannot be sent by container, or if data
cannot be serializedpublic Object getAdapter(Class clazz)
getAdapter in interface org.eclipse.core.runtime.IAdaptablepublic Namespace getConnectNamespace()
ISharedObjectContextgetConnectNamespace in interface ISharedObjectContextpublic Map getLocalContainerProperties()
ISharedObjectContextgetLocalContainerProperties in interface ISharedObjectContextCopyright © 2004–2020 Eclipse Foundation. All rights reserved.