Package org.eclipse.ecf.provider.generic
Class SOContext
java.lang.Object
org.eclipse.ecf.provider.generic.SOContext
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable
,ISharedObjectContext
-
Field Summary
Modifier and TypeFieldDescriptionprotected SOContainer
protected ID
protected boolean
protected Map
protected IQueueEnqueue
protected ID
-
Constructor Summary
ConstructorDescriptionSOContext
(ID objID, ID homeID, SOContainer cont, Map props, IQueueEnqueue queue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(ID groupID, IConnectContext joinContext) (non-Javadoc)void
(non-Javadoc)getAdapter
(Class clazz) (non-Javadoc)Get the Namespace instance that defines the ID type expected by the remote target containerID[]
(non-Javadoc)Get the local container instance's IDGet local container properties that it wishes to expose to shared object accessgetQueue()
Get the IQueueEnqueue instance associated with this ISharedObject.Get the ISharedObjectManager for this contextboolean
isActive()
boolean
(non-Javadoc)boolean
protected boolean
protected void
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
protected void
traceStack
(String msg, Throwable e)
-
Field Details
-
container
-
homeContainerID
-
isActive
protected boolean isActive -
properties
-
queue
-
-
Constructor Details
-
Method Details
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceISharedObjectContext
-
trace
-
traceStack
-
makeInactive
protected void makeInactive() -
isInactive
protected boolean isInactive() -
getLocalContainerID
Description copied from interface:ISharedObjectContext
Get the local container instance's ID- Specified by:
getLocalContainerID
in interfaceISharedObjectContext
- Returns:
- the ID of the enclosing container
-
getQueue
Description copied from interface:ISharedObjectContext
Get the IQueueEnqueue instance associated with this ISharedObject. If the given container provides a queue for this ISharedObject, this method will return a IQueueEnqueue reference to the appropriate queue.- Specified by:
getQueue
in interfaceISharedObjectContext
- Returns:
- IQueueEnqueue instance if an active queue is associated with this ISharedObject. If no active queue is associated with the ISharedObject, returns null.
-
connect
Description copied from interface:ISharedObjectContext
(non-Javadoc)- Specified by:
connect
in interfaceISharedObjectContext
- Throws:
ContainerConnectException
- See Also:
-
disconnect
public void disconnect()Description copied from interface:ISharedObjectContext
(non-Javadoc)- Specified by:
disconnect
in interfaceISharedObjectContext
- See Also:
-
getConnectedID
Description copied from interface:ISharedObjectContext
(non-Javadoc)- Specified by:
getConnectedID
in interfaceISharedObjectContext
- See Also:
-
isGroupManager
public boolean isGroupManager()Description copied from interface:ISharedObjectContext
(non-Javadoc)- Specified by:
isGroupManager
in interfaceISharedObjectContext
- See Also:
-
isGroupServer
public boolean isGroupServer() -
getGroupMemberIDs
Description copied from interface:ISharedObjectContext
(non-Javadoc)- Specified by:
getGroupMemberIDs
in interfaceISharedObjectContext
- See Also:
-
sendCreateResponse
public void sendCreateResponse(ID toContainerID, Throwable throwable, long identifier) throws IOException Description copied from interface:ISharedObjectContext
Send create response back to an ISharedObject with the same ID as this instance. This method allows ISharedObject instances (with a reference to a valid ISharedObjectContext) to send messages to remote containers asking them to deliver the create response status back to the ISharedObject.- Specified by:
sendCreateResponse
in interfaceISharedObjectContext
- Parameters:
toContainerID
- 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)- Throws:
IOException
- thrown if the create response cannot be sent
-
sendDispose
Description copied from interface:ISharedObjectContext
Send message to dispose of a remote instance of the ISharedObject with same ID as this instance. This method allows ISharedObject instances to control the destruction of remote replicas.- Specified by:
sendDispose
in interfaceISharedObjectContext
- Parameters:
toContainerID
- 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).- Throws:
IOException
- thrown if message cannot be sent by container, or if data cannot be serialized
-
sendMessage
Description copied from interface:ISharedObjectContext
Send arbitrary message to remote instance of the ISharedObject with same ID as this instance. This method allows ISharedObject instances to send arbitrary data to one or more remote replicas of this ISharedObject.- Specified by:
sendMessage
in interfaceISharedObjectContext
- Parameters:
toContainerID
- 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 container- Throws:
IOException
- thrown if message cannot be sent by container, or if data cannot be serialized
-
getAdapter
- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-
getConnectNamespace
Description copied from interface:ISharedObjectContext
Get the Namespace instance that defines the ID type expected by the remote target container- Specified by:
getConnectNamespace
in interfaceISharedObjectContext
- Returns:
- Namespace the namespace by the target for a call to connect(). Null if container namespace no longer available
-
getLocalContainerProperties
Description copied from interface:ISharedObjectContext
Get local container properties that it wishes to expose to shared object access- Specified by:
getLocalContainerProperties
in interfaceISharedObjectContext
- Returns:
- Map of properties available to calling shared object. Map returned must not be null.
-