Package org.eclipse.ecf.provider.generic
Class ClientSOContainer
java.lang.Object
org.eclipse.ecf.core.AbstractContainer
org.eclipse.ecf.provider.generic.SOContainer
org.eclipse.ecf.provider.generic.ClientSOContainer
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,IContainer,IIdentifiable,IReliableContainer,ISharedObjectContainer,ISharedObjectContainerClient
- Direct Known Subclasses:
SSLClientSOContainer,TCPClientSOContainer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final byteprotected ISynchAsynchConnectionprotected byteprotected org.eclipse.ecf.provider.generic.ClientSOContainer.Lockprotected IConnectInitiatorPolicystatic final intstatic final byteprotected IDFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect(ID targetID, IConnectContext joinContext) Connect to a target remote process or process group.protected Callback[]protected abstract ISynchAsynchConnectioncreateConnection(ID targetID, Object data) Create connection instance.voidDisconnect.protected voiddisconnect(Throwable exception) voiddispose()Dispose this IContainer instance.protected voidforwardExcluding(ID from, ID excluding, byte msg, Serializable data) protected voidforwardExcluding(ID from, ID excluding, ContainerMessage data) protected voidforwardToRemote(ID from, ID to, ContainerMessage message) protected ObjectgetConnectData(ID remote, IConnectContext joinContext) Get the target ID that this container instance has connected to.protected ISynchAsynchConnectionprotected org.eclipse.ecf.provider.generic.ClientSOContainer.Lockprotected intprotected IDprotected SerializablegetLeaveData(ID target) protected IDhandleConnectResponse(ID orginalTarget, Object serverData) protected voidhandleLeave(ID fromID, IConnection conn) protected voidprotected voidprotected booleanprotected booleanfinal booleanprotected voidprocessAsynch(AsynchEvent evt) protected voidprotected SerializableprocessSynch(SynchEvent evt) protected voidqueueContainerMessage(ContainerMessage message) protected voidsendCreate(ID sharedObjectId, ID toContainerId, SharedObjectDescription sd) protected ID[]sendCreateMsg(ID toID, SharedObjectDescription createInfo) protected voidsendCreateResponse(ID homeId, ID sharedObjectId, Throwable t, long identifier) protected voidsendCreateResponseSharedObjectMessage(ID toContainerId, ID fromSharedObject, Throwable t, long ident) protected ID[]sendCreateSharedObjectMessage(ID toContainerId, SharedObjectDescription sd) protected voidsendDispose(ID toContainerId, ID sharedObjectId) protected voidsendDisposeSharedObjectMessage(ID toContainerId, ID fromSharedObject) protected voidsendMessage(ID toContainerId, ID sharedObjectId, Object message) protected voidsendMessage(ContainerMessage data) protected voidsendSharedObjectMessage(ID toContainerId, ID fromSharedObject, Serializable data) voidSet the connect initiator policy handler for authentication policyMethods 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, getMessageReceiver, getNewSharedObjectThread, getNextSequenceNumber, getOtherMemberIDs, getReceiver, getSharedObject, getSharedObjectIDs, getSharedObjectManager, getSharedObjectMessageSerializer, getSharedObjectWrapper, handleAsynchIOException, handleCreateMessage, handleCreateResponseMessage, handleSharedObjectDisposeMessage, handleSharedObjectMessage, handleUndeliveredSharedObjectMessage, handleUnidentifiedMessage, isClosing, load, moveFromLoadingToActive, notifySharedObjectActivated, notifySharedObjectDeactivated, printToSystemError, removeFromLoading, removeRemoteMember, removeSharedObject, serialize, serializeSharedObjectMessage, setMaxGroupMembers, setRemoteAddPolicy, setSharedObjectMessageSerializer, traceStack, validateContainerMessage, verifySharedObjectMessageTarget, verifyToIDForSharedObjectMessageMethods inherited from class org.eclipse.ecf.core.AbstractContainer
addListener, fireContainerEvent, getPasswordFromConnectContext, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ecf.core.IContainer
addListener, removeListener
-
Field Details
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT- See Also:
-
connection
-
remoteServerID
-
connectionState
protected byte connectionState -
connectPolicy
-
DISCONNECTED
public static final byte DISCONNECTED- See Also:
-
CONNECTING
public static final byte CONNECTING- See Also:
-
CONNECTED
public static final byte CONNECTED- See Also:
-
connectLock
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock connectLock
-
-
Constructor Details
-
Method Details
-
getConnectLock
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock getConnectLock() -
getConnection
-
setConnectInitiatorPolicy
Description copied from interface:ISharedObjectContainerClientSet the connect initiator policy handler for authentication policy- Specified by:
setConnectInitiatorPolicyin interfaceISharedObjectContainerClient- Parameters:
policy- the policy to use
-
dispose
public void dispose()Description copied from interface:IContainerDispose 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:
disposein interfaceIContainer- Overrides:
disposein classSOContainer
-
isGroupManager
public final boolean isGroupManager()- Specified by:
isGroupManagerin interfaceIReliableContainer- Specified by:
isGroupManagerin classSOContainer- Returns:
- true if this IReliableContainer instance is in the 'manager' role for the group, false otherwise.
-
getConnectedID
Description copied from interface:IContainerGet the target ID that this container instance has connected to. Returns null if not connected.- Specified by:
getConnectedIDin interfaceIContainer- Specified by:
getConnectedIDin classSOContainer- Returns:
- ID of the target we are connected to. Returns
nullif container not connected.
-
connect
Description copied from interface:IContainerConnect 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:
connectin interfaceIContainer- Specified by:
connectin classSOContainer- Parameters:
targetID- the ID of the remote server or group to connect to. SeeIContainer.getConnectNamespace()for a explanation of the constraints upon this parameter.joinContext- any required context to allow this container to authenticate. May benullif underlying provider does not have any authentication requirements for connection.- Throws:
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.
-
createAuthorizationCallbacks
-
getConnectData
protected Object getConnectData(ID remote, IConnectContext joinContext) throws IOException, UnsupportedCallbackException -
getConnectTimeout
protected int getConnectTimeout() -
handleLeaveGroupMessage
- Specified by:
handleLeaveGroupMessagein classSOContainer- Parameters:
mess- leave group message
-
handleViewChangeMessage
- Specified by:
handleViewChangeMessagein classSOContainer- Throws:
IOException
-
forwardExcluding
- Specified by:
forwardExcludingin classSOContainer- Parameters:
from- fromexcluding- excludingdata- data- Throws:
IOException- not thrown by this implementation.
-
getLeaveData
-
disconnect
public void disconnect()Description copied from interface:IContainerDisconnect. This operation will disconnect the local container instance from any previously joined target or group. Subsequent calls to getConnectedID() will returnnull.- Specified by:
disconnectin interfaceIContainer- Specified by:
disconnectin classSOContainer
-
createConnection
protected abstract ISynchAsynchConnection createConnection(ID targetID, Object data) throws ConnectionCreateException Create connection instance. This method is called byconnect(ID, IConnectContext). Following a return from this method, the new ISynchAsynchConnection instance'sIConnection.connect(ID, Object, int)method is subsequently called.- Parameters:
targetID- the targetID to connect to. The value is the same as that passed intoconnect(ID, IConnectContext).data- and data provided to the connection via the IConnectContext passed into theconnect(ID, IConnectContext)call.- Returns:
ISynchAsynchConnectiona connection instance. Will not benull.- Throws:
ConnectionCreateException- thrown if the connection cannot be created.
-
queueContainerMessage
- Specified by:
queueContainerMessagein classSOContainer- Throws:
IOException
-
forwardExcluding
protected void forwardExcluding(ID from, ID excluding, byte msg, Serializable data) throws IOException - Parameters:
from- fromexcluding- excludingmsg- msgdata- data- Throws:
IOException- not thrown by this implementation.
-
forwardToRemote
- Specified by:
forwardToRemotein classSOContainer- Parameters:
from- fromto- tomessage- message- Throws:
IOException- not thrown by this implementation.
-
getIDForConnection
- Specified by:
getIDForConnectionin classSOContainer
-
handleLeave
- Overrides:
handleLeavein classSOContainer
-
sendMessage
- Overrides:
sendMessagein classSOContainer- Throws:
IOException
-
sendCreateResponse
protected void sendCreateResponse(ID homeId, ID sharedObjectId, Throwable t, long identifier) throws IOException - Overrides:
sendCreateResponsein classSOContainer- Throws:
IOException
-
sendDispose
- Overrides:
sendDisposein classSOContainer- Throws:
IOException
-
sendMessage
- Overrides:
sendMessagein classSOContainer- Throws:
IOException
-
disconnect
-
processDisconnect
- Specified by:
processDisconnectin classSOContainer
-
processAsynch
- Overrides:
processAsynchin classSOContainer- Parameters:
evt- event- Throws:
IOException- not thrown by this implementation.
-
processSynch
- Overrides:
processSynchin classSOContainer- Throws:
IOException
-
isConnected
protected boolean isConnected() -
isConnecting
protected boolean isConnecting() -
handleConnectResponse
- Throws:
Exception
-