Class ServerSOContainer

  extended by org.eclipse.ecf.core.AbstractContainer
      extended by org.eclipse.ecf.provider.generic.SOContainer
          extended by org.eclipse.ecf.provider.generic.ServerSOContainer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IContainer, IIdentifiable, IReliableContainer, ISharedObjectContainer, ISharedObjectContainerGroupManager
Direct Known Subclasses:

public class ServerSOContainer
extends SOContainer
implements ISharedObjectContainerGroupManager

Field Summary
protected  IConnectHandlerPolicy connectHandlerPolicy
Fields inherited from class org.eclipse.ecf.provider.generic.SOContainer
config, DEFAULT_OBJECT_ARG_KEY, DEFAULT_OBJECT_ARGTYPES_KEY, groupManager, isClosing, loadingThreadGroup, policy, receiver, sharedObjectManager, sharedObjectMessageSerializer, sharedObjectThreadGroup
Constructor Summary
ServerSOContainer(ISharedObjectContainerConfig config)
Method Summary
protected  ContainerMessage acceptNewClient( socket, java.lang.String target, data, ISynchAsynchConnection conn)
protected  java.lang.Object checkJoin( saddr, ID fromID, java.lang.String target, data)
 void connect(ID groupID, IConnectContext joinContext)
          Connect to a target remote process or process group.
 void disconnect()
 void dispose()
          Dispose this IContainer instance.
 void ejectAllGroupMembers( reason)
          Eject all, for the given reason.
 void ejectGroupMember(ID memberID, reason)
          Eject the given groupMemberID from the current group of containers, for the given reason.
protected  void forwardExcluding(ID from, ID excluding, ContainerMessage data)
protected  void forwardToRemote(ID from, ID to, ContainerMessage data)
 ID getConnectedID()
          Get the target ID that this container instance has connected to.
protected  IAsynchConnection getConnectionForID(ID memberID)
protected  ID getIDForConnection(IAsynchConnection conn)
protected  ISynchConnection getSynchConnectionForID(ID memberID)
protected  void handleLeaveGroupMessage(ContainerMessage mess)
protected  void handleViewChangeMessage(ContainerMessage mess)
 boolean isGroupManager()
protected  void processDisconnect(DisconnectEvent e)
protected  void queueContainerMessage(ContainerMessage message)
 void setConnectPolicy(IConnectHandlerPolicy policy)
          Set the join policy for this group manager.
Methods inherited from class org.eclipse.ecf.provider.generic.SOContainer
addNewRemoteMember, addSharedObject0, addSharedObjectAndWait, addSharedObjectWrapper, addToLoading, checkRemoteCreate, createContainerPropertiesForSharedObject, createRemoteSharedObjectConfig, createRemoteSharedObjectContext, createRemoteSharedObjectWrapper, createSharedObjectConfig, createSharedObjectContext, createSharedObjectWrapper, debug, defaultDeserializeSharedObjectMessage, defaultSerializeSharedObjectMessage, deserializeContainerMessage, deserializeSharedObjectMessage, destroySharedObject, disconnect, fireDelegateContainerEvent, forward, getAdapter, getArgsFromProperties, getArgTypesFromProperties, getClassLoaderForContainer, getClassLoaderForSharedObject, getConfig, getConnectNamespace, getGroupMemberIDs, getGroupMembershipLock, getID, getMaxGroupMembers, getNewSharedObjectThread, getNextSequenceNumber, getOtherMemberIDs, getReceiver, getSharedObject, getSharedObjectIDs, getSharedObjectManager, getSharedObjectMessageSerializer, getSharedObjectWrapper, handleAsynchIOException, handleCreateMessage, handleCreateResponseMessage, handleLeave, handleSharedObjectDisposeMessage, handleSharedObjectMessage, handleUndeliveredSharedObjectMessage, handleUnidentifiedMessage, isClosing, load, moveFromLoadingToActive, notifySharedObjectActivated, notifySharedObjectDeactivated, printToSystemError, processAsynch, processSynch, removeFromLoading, removeRemoteMember, removeSharedObject, sendCreate, sendCreateResponse, sendCreateResponseSharedObjectMessage, sendCreateSharedObjectMessage, sendDispose, sendDisposeSharedObjectMessage, sendMessage, sendMessage, sendSharedObjectMessage, serialize, serializeSharedObjectMessage, setMaxGroupMembers, setRemoteAddPolicy, setSharedObjectMessageSerializer, traceStack, validateContainerMessage, verifySharedObjectMessageTarget, verifyToIDForSharedObjectMessage
Methods inherited from class org.eclipse.ecf.core.AbstractContainer
addListener, fireContainerEvent, getPasswordFromConnectContext, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.ecf.core.IContainer
addListener, removeListener

Field Detail


protected IConnectHandlerPolicy connectHandlerPolicy
Constructor Detail


public ServerSOContainer(ISharedObjectContainerConfig config)
Method Detail


public boolean isGroupManager()
Specified by:
isGroupManager in interface IReliableContainer
Specified by:
isGroupManager in class SOContainer
true if this IReliableContainer instance is in the 'manager' role for the group, false otherwise.


public ID getConnectedID()
Description copied from interface: IContainer
Get the target ID that this container instance has connected to. Returns null if not connected.

Specified by:
getConnectedID in interface IContainer
Specified by:
getConnectedID in class SOContainer
ID of the target we are connected to. Returns null if container not connected.


public void disconnect()
Description copied from interface: IContainer
Disconnect. This operation will disconnect the local container instance from any previously joined target or group. Subsequent calls to getConnectedID() will return null.

Specified by:
disconnect in interface IContainer
Specified by:
disconnect in class SOContainer


public void ejectGroupMember(ID memberID,
Description copied from interface: ISharedObjectContainerGroupManager
Eject the given groupMemberID from the current group of containers, for the given reason.

Specified by:
ejectGroupMember in interface ISharedObjectContainerGroupManager
memberID - the ID of the group member to eject. If null, or if group member is not in group managed by this object, the method has no effect
reason - a reason for the ejection


public void ejectAllGroupMembers( reason)
Description copied from interface: ISharedObjectContainerGroupManager
Eject all, for the given reason.

Specified by:
ejectAllGroupMembers in interface ISharedObjectContainerGroupManager
reason - a reason for the ejection


public void dispose()
Description copied from interface: IContainer
Dispose this IContainer instance. The container instance will be made inactive after the completion of this method and will be unavailable for subsequent usage.

Specified by:
dispose in interface IContainer
dispose in class SOContainer


public void connect(ID groupID,
                    IConnectContext joinContext)
             throws ContainerConnectException
Description copied from interface: IContainer
Connect to a target remote process or process group. The target identified by the first parameter (targetID) is connected the implementation class. If authentication information is required, the required information is given via via the second parameter (connectContext). Callers note that depending upon the provider implementation this method may block. It is suggested that callers use a separate thread to call this method. This method provides an implementation independent way for container implementations to connect, authenticate, and communicate with a remote service or group of services. Providers are responsible for implementing this operation in a way appropriate to the given remote service (or group) via expected protocol.

Specified by:
connect in interface IContainer
Specified by:
connect in class SOContainer
groupID - the ID of the remote server or group to connect to. See IContainer.getConnectNamespace() for a explanation of the constraints upon this parameter.
joinContext - any required context to allow this container to authenticate. May be null if underlying provider does not have any authentication requirements for connection.
ContainerConnectException - thrown if communication cannot be established with remote service. Causes can include network connection failure, authentication failure, server error, or if container is already connected.


public void setConnectPolicy(IConnectHandlerPolicy policy)
Description copied from interface: ISharedObjectContainerGroupManager
Set the join policy for this group manager. If the policy is set to null, the implementing container is not obligated to consult the policy. If non-null, the given policy's checkJoin method is called before the manager agrees to the join of a given group participant.

Specified by:
setConnectPolicy in interface ISharedObjectContainerGroupManager


protected void queueContainerMessage(ContainerMessage message)
Specified by:
queueContainerMessage in class SOContainer


protected void forwardToRemote(ID from,
                               ID to,
                               ContainerMessage data)
Specified by:
forwardToRemote in class SOContainer


protected void forwardExcluding(ID from,
                                ID excluding,
                                ContainerMessage data)
Specified by:
forwardExcluding in class SOContainer


protected void handleViewChangeMessage(ContainerMessage mess)
Specified by:
handleViewChangeMessage in class SOContainer
mess -
Throws: - not thrown by this implementation.


protected ContainerMessage acceptNewClient( socket,
                                           java.lang.String target,
                                           ISynchAsynchConnection conn)


protected java.lang.Object checkJoin( saddr,
                                     ID fromID,
                                     java.lang.String target,
                              throws java.lang.Exception


protected void handleLeaveGroupMessage(ContainerMessage mess)
Specified by:
handleLeaveGroupMessage in class SOContainer


protected ID getIDForConnection(IAsynchConnection conn)
Specified by:
getIDForConnection in class SOContainer


protected IAsynchConnection getConnectionForID(ID memberID)


protected ISynchConnection getSynchConnectionForID(ID memberID)


protected void processDisconnect(DisconnectEvent e)
Specified by:
processDisconnect in class SOContainer