org.eclipse.ecf.example.clients
Class TrivialSharedObject

java.lang.Object
  extended by org.eclipse.ecf.core.sharedobject.AbstractSharedObject
      extended by org.eclipse.ecf.example.clients.TrivialSharedObject
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IIdentifiable, ISharedObject, IEventHandler

public class TrivialSharedObject
extends AbstractSharedObject


Constructor Summary
TrivialSharedObject()
           
 
Method Summary
protected  void handleMessage(java.lang.String message)
           
protected  Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event)
          Handle a SharedObjectMessageEvent.
protected  void initialize()
          Initialize this shared object.
 void sendMessageTo(ID targetID, java.lang.String message)
           
 
Methods inherited from class org.eclipse.ecf.core.sharedobject.AbstractSharedObject
addEventProcessor, clearEventProcessors, creationCompleted, destroyRemote, destroySelf, destroySelfLocal, dispose, fireEventProcessors, getAdapter, getConfig, getContext, getGroupID, getHomeContainerID, getID, getLocalContainerID, getProperties, getReplicaDescription, getReplicaDescriptions, handleEvent, handleEvents, handleUnhandledEvent, init, isConnected, isPrimary, removeEventProcessor, replicateToRemoteContainers, sendSharedObjectMsgTo, sendSharedObjectMsgToPrimary, sendSharedObjectMsgToSelf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrivialSharedObject

public TrivialSharedObject()
Method Detail

initialize

protected void initialize()
                   throws SharedObjectInitException
Description copied from class: AbstractSharedObject
Initialize this shared object. Subclasses may override as appropriate to define custom initialization behavior. If initialization should fail, then a SharedObjectInitException should be thrown by implementing code. Also, subclasses overriding this method should call super.initialize() before running their own code.

Overrides:
initialize in class AbstractSharedObject
Throws:
SharedObjectInitException - if initialization should throw

sendMessageTo

public void sendMessageTo(ID targetID,
                          java.lang.String message)

handleSharedObjectMsgEvent

protected Event handleSharedObjectMsgEvent(ISharedObjectMessageEvent event)
Description copied from class: AbstractSharedObject
Handle a SharedObjectMessageEvent. This method will be automatically called by the SharedObjectMsgEventProcessor when a SharedObjectMessageEvent is received. The SharedObjectMsgEventProcessor is associated with this object via the initialize() method

Overrides:
handleSharedObjectMsgEvent in class AbstractSharedObject
Parameters:
event - the event to handle
Returns:
Event the Event for subsequent processing. If null, the provided event will receive no further processing. If non-null the provided Event will be passed to subsequent event processors.

handleMessage

protected void handleMessage(java.lang.String message)