|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.sharedobject.AbstractSharedObject
public class AbstractSharedObject
Base class for shared object classes.
Constructor Summary | |
---|---|
AbstractSharedObject()
|
Method Summary | |
---|---|
protected boolean |
addEventProcessor(IEventProcessor proc)
|
protected void |
clearEventProcessors()
|
protected void |
creationCompleted()
Called by replication strategy code (e.g. |
protected void |
destroyRemote(ID remoteID)
|
protected void |
destroySelf()
|
protected void |
destroySelfLocal()
|
void |
dispose(ID containerID)
Method called by the ISharedObjectContainer upon ISharedObject destruction. |
protected void |
fireEventProcessors(Event event)
|
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
protected ISharedObjectConfig |
getConfig()
|
protected ISharedObjectContext |
getContext()
|
protected ID |
getGroupID()
|
protected ID |
getHomeContainerID()
|
ID |
getID()
Return the ID for this 'identifiable' object. |
protected ID |
getLocalContainerID()
|
protected java.util.Map |
getProperties()
|
protected ReplicaSharedObjectDescription |
getReplicaDescription(ID receiver)
Get a ReplicaSharedObjectDescription for a replica to be created on a given receiver. |
protected ReplicaSharedObjectDescription[] |
getReplicaDescriptions(ID[] receivers)
This method is called by replicateToRemoteContainers to determine the ReplicaSharedObjectDescriptions associated with the given receivers. |
protected SharedObjectMsg |
getSharedObjectMsgFromEvent(ISharedObjectMessageEvent event)
Get SharedObjectMsg from ISharedObjectMessageEvent. |
void |
handleEvent(Event event)
Handle Event passed to this IEventHandler. |
void |
handleEvents(Event[] events)
Handle Events passed to this IEventHandler. |
protected boolean |
handleSharedObjectCreateResponseEvent(ISharedObjectCreateResponseEvent createResponseEvent)
Handle a ISharedObjectCreateResponseEvent. |
protected boolean |
handleSharedObjectMsg(SharedObjectMsg msg)
SharedObjectMsg handler method. |
protected boolean |
handleSharedObjectMsgEvent(ISharedObjectMessageEvent event)
Handle a ISharedObjectMessageEvent. |
protected void |
handleUnhandledEvent(Event event)
|
void |
init(ISharedObjectConfig initData)
Initialize this ISharedObject. |
protected void |
initialize()
Initialize this shared object. |
protected boolean |
isConnected()
|
protected boolean |
isPrimary()
|
protected boolean |
removeEventProcessor(IEventProcessor proc)
|
protected void |
replicateToRemoteContainers(ID[] remoteContainers)
Replicate this shared object to a given set of remote containers. |
protected void |
sendSharedObjectMsgTo(ID toID,
SharedObjectMsg msg)
Send SharedObjectMessage to container with given ID. |
protected void |
sendSharedObjectMsgToPrimary(SharedObjectMsg msg)
Send SharedObjectMsg to this shared object's primary instance. |
protected void |
sendSharedObjectMsgToSelf(SharedObjectMsg msg)
Send SharedObjectMsg to local shared object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSharedObject()
Method Detail |
---|
public final void init(ISharedObjectConfig initData) throws SharedObjectInitException
ISharedObject
init
in interface ISharedObject
initData
- the initialization data passed by the ISharedObjectContainer
upon initialization
SharedObjectInitException
- thrown by ISharedObject to halt initialization.
ISharedObjectContainers must respond to such an exception
by halting the addition of the ISharedObject instance and
treating it as not in the container.protected void initialize() throws SharedObjectInitException
SharedObjectInitException
- if initialization should throwprotected void creationCompleted()
public void dispose(ID containerID)
ISharedObject
dispose
in interface ISharedObject
containerID
- the ID of the container that is disposing this ISharedObjectpublic java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
public void handleEvent(Event event)
IEventHandler
handleEvent
in interface IEventHandler
event
- the Event for the implementer to handleprotected boolean addEventProcessor(IEventProcessor proc)
protected boolean removeEventProcessor(IEventProcessor proc)
protected void clearEventProcessors()
protected void handleUnhandledEvent(Event event)
protected void fireEventProcessors(Event event)
public void handleEvents(Event[] events)
IEventHandler
handleEvents
in interface IEventHandler
events
- the Events [] for the implementer to handlepublic ID getID()
IIdentifiable
getID
in interface IIdentifiable
protected ISharedObjectConfig getConfig()
protected ISharedObjectContext getContext()
protected ID getHomeContainerID()
protected ID getLocalContainerID()
protected ID getGroupID()
protected boolean isConnected()
protected boolean isPrimary()
protected java.util.Map getProperties()
protected void destroySelf()
protected void destroySelfLocal()
protected void destroyRemote(ID remoteID) throws java.io.IOException
java.io.IOException
protected void sendSharedObjectMsgTo(ID toID, SharedObjectMsg msg) throws java.io.IOException
toID
- the target container ID for the SharedObjectMsg. If null, the
given message is sent to all other containers currently in
groupmsg
- the message instance to send
java.io.IOException
- thrown if the local container is not connected or unable to
send for other reasonprotected void sendSharedObjectMsgToPrimary(SharedObjectMsg msg) throws java.io.IOException
msg
- the message instance to send
java.io.IOException
- throws if the local container is not connect or unable to
send for other reasonprotected void sendSharedObjectMsgToSelf(SharedObjectMsg msg)
msg
- the message instance to send.protected SharedObjectMsg getSharedObjectMsgFromEvent(ISharedObjectMessageEvent event)
event
-
protected boolean handleSharedObjectMsgEvent(ISharedObjectMessageEvent event)
event
- the event to handle
protected boolean handleSharedObjectCreateResponseEvent(ISharedObjectCreateResponseEvent createResponseEvent)
createResponseEvent
- the ISharedObjectCreateResponseEvent received
protected boolean handleSharedObjectMsg(SharedObjectMsg msg)
handleSharedObjectMsgEvent(ISharedObjectMessageEvent)
when a
SharedObjectMsg is received either from a local source or a remote
source. This default implementation simply returns false so that other
processing of of the given msg can occur. Subclasses should override this
behavior to define custom logic for handling SharedObjectMsgs.
msg
- the SharedObjectMsg received
protected ReplicaSharedObjectDescription getReplicaDescription(ID receiver)
receiver
- the receiver the ReplicaSharedObjectDescription is for
protected ReplicaSharedObjectDescription[] getReplicaDescriptions(ID[] receivers)
receivers
- an ID[] of the intended receivers for the resulting
ReplicaSharedObjectDescriptions. If null, then the entire
current group is assumed to be the target, and this
method should return a ReplicaSharedObjectDescriptions array
of length 1, with a single ReplicaSharedObjectDescriptions for
all target receivers.
protected void replicateToRemoteContainers(ID[] remoteContainers)
remoteContainers
- the set of remote containers to replicate to. If null, all
containers in the current group are sent a message to create a
replica of this shared object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |