org.eclipse.ecf.provider.fileshare
Class BaseFileShareReceiver
java.lang.Object
org.eclipse.ecf.core.sharedobject.AbstractSharedObject
org.eclipse.ecf.core.sharedobject.TransactionSharedObject
org.eclipse.ecf.provider.fileshare.BaseFileShareReceiver
- All Implemented Interfaces:
- org.eclipse.core.runtime.IAdaptable, IIdentifiable, ISharedObject, IEventHandler
public class BaseFileShareReceiver
- extends TransactionSharedObject
Methods inherited from class org.eclipse.ecf.core.sharedobject.AbstractSharedObject |
addEventProcessor, clearEventProcessors, creationCompleted, destroyRemote, destroySelf, destroySelfLocal, dispose, fireEventProcessors, getConfig, getContext, getGroupID, getHomeContainerID, getID, getLocalContainerID, getProperties, getReplicaDescription, getReplicaDescriptions, getSharedObjectMsgFromEvent, handleEvent, handleEvents, handleSharedObjectCreateResponseEvent, handleSharedObjectMsgEvent, 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 |
localTarget
protected ID localTarget
out
protected java.io.OutputStream out
BaseFileShareReceiver
public BaseFileShareReceiver()
initialize
public 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 TransactionSharedObject
- Throws:
SharedObjectInitException
- if initialization should throw
handleSharedObjectMsg
protected boolean handleSharedObjectMsg(SharedObjectMsg msg)
- Description copied from class:
AbstractSharedObject
- SharedObjectMsg handler method. This method will be called by
AbstractSharedObject.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.
- Overrides:
handleSharedObjectMsg
in class AbstractSharedObject
- Parameters:
msg
- the SharedObjectMsg received
- Returns:
- true if the msg has been completely handled and subsequent
processing should stop. False if processing should continue
receive
protected void receive(FileShareMessage message)
- This method will be invoked via handleSharedObjectMsg when data are received
- Parameters:
message
- the content of the file share message (data or complete)
getLocalFileNameFromLocalTarget
protected java.lang.String getLocalFileNameFromLocalTarget()
receiveAndSaveToFile
protected void receiveAndSaveToFile(FileShareMessage message)
handleExceptionOnDataReceive
protected void handleExceptionOnDataReceive(java.lang.Throwable e)
closeOutput
protected void closeOutput()