public abstract class ClientSOContainer extends SOContainer implements ISharedObjectContainerClient
Modifier and Type | Field and Description |
---|---|
static byte |
CONNECTED |
static byte |
CONNECTING |
protected ISynchAsynchConnection |
connection |
protected byte |
connectionState |
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock |
connectLock |
protected IConnectInitiatorPolicy |
connectPolicy |
static int |
DEFAULT_CONNECT_TIMEOUT |
static byte |
DISCONNECTED |
protected ID |
remoteServerID |
config, DEFAULT_OBJECT_ARG_KEY, DEFAULT_OBJECT_ARGTYPES_KEY, groupManager, isClosing, loadingThreadGroup, policy, receiver, sharedObjectManager, sharedObjectMessageSerializer, sharedObjectThreadGroup
Constructor and Description |
---|
ClientSOContainer(ISharedObjectContainerConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
connect(ID targetID,
IConnectContext joinContext)
Connect to a target remote process or process group.
|
protected Callback[] |
createAuthorizationCallbacks() |
protected abstract ISynchAsynchConnection |
createConnection(ID targetID,
java.lang.Object data)
Create connection instance.
|
void |
disconnect()
Disconnect.
|
protected void |
disconnect(java.lang.Throwable exception) |
void |
dispose()
Dispose this IContainer instance.
|
protected void |
forwardExcluding(ID from,
ID excluding,
byte msg,
java.io.Serializable data) |
protected void |
forwardExcluding(ID from,
ID excluding,
ContainerMessage data) |
protected void |
forwardToRemote(ID from,
ID to,
ContainerMessage message) |
protected java.lang.Object |
getConnectData(ID remote,
IConnectContext joinContext) |
ID |
getConnectedID()
Get the target ID that this container instance has connected to.
|
protected ISynchAsynchConnection |
getConnection() |
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock |
getConnectLock() |
protected int |
getConnectTimeout() |
protected ID |
getIDForConnection(IAsynchConnection conn) |
protected java.io.Serializable |
getLeaveData(ID target) |
protected ID |
handleConnectResponse(ID orginalTarget,
java.lang.Object serverData) |
protected void |
handleLeave(ID fromID,
IConnection conn) |
protected void |
handleLeaveGroupMessage(ContainerMessage mess) |
protected void |
handleViewChangeMessage(ContainerMessage mess) |
protected boolean |
isConnected() |
protected boolean |
isConnecting() |
boolean |
isGroupManager() |
protected void |
processAsynch(AsynchEvent evt) |
protected void |
processDisconnect(DisconnectEvent evt) |
protected java.io.Serializable |
processSynch(SynchEvent evt) |
protected void |
queueContainerMessage(ContainerMessage message) |
protected void |
sendCreate(ID sharedObjectId,
ID toContainerId,
SharedObjectDescription sd) |
protected ID[] |
sendCreateMsg(ID toID,
SharedObjectDescription createInfo) |
protected void |
sendCreateResponse(ID homeId,
ID sharedObjectId,
java.lang.Throwable t,
long identifier) |
protected void |
sendCreateResponseSharedObjectMessage(ID toContainerId,
ID fromSharedObject,
java.lang.Throwable t,
long ident) |
protected ID[] |
sendCreateSharedObjectMessage(ID toContainerId,
SharedObjectDescription sd) |
protected void |
sendDispose(ID toContainerId,
ID sharedObjectId) |
protected void |
sendDisposeSharedObjectMessage(ID toContainerId,
ID fromSharedObject) |
protected void |
sendMessage(ContainerMessage data) |
protected void |
sendMessage(ID toContainerId,
ID sharedObjectId,
java.lang.Object message) |
protected void |
sendSharedObjectMessage(ID toContainerId,
ID fromSharedObject,
java.io.Serializable data) |
void |
setConnectInitiatorPolicy(IConnectInitiatorPolicy policy)
Set the connect initiator policy handler for authentication policy
|
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, verifyToIDForSharedObjectMessage
addListener, fireContainerEvent, getPasswordFromConnectContext, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, removeListener
public static final int DEFAULT_CONNECT_TIMEOUT
protected ISynchAsynchConnection connection
protected ID remoteServerID
protected byte connectionState
protected IConnectInitiatorPolicy connectPolicy
public static final byte DISCONNECTED
public static final byte CONNECTING
public static final byte CONNECTED
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock connectLock
public ClientSOContainer(ISharedObjectContainerConfig config)
protected org.eclipse.ecf.provider.generic.ClientSOContainer.Lock getConnectLock()
protected ISynchAsynchConnection getConnection()
public void setConnectInitiatorPolicy(IConnectInitiatorPolicy policy)
ISharedObjectContainerClient
setConnectInitiatorPolicy
in interface ISharedObjectContainerClient
policy
- the policy to usepublic void dispose()
IContainer
dispose
in interface IContainer
dispose
in class SOContainer
public final boolean isGroupManager()
isGroupManager
in interface IReliableContainer
isGroupManager
in class SOContainer
public ID getConnectedID()
IContainer
getConnectedID
in interface IContainer
getConnectedID
in class SOContainer
null
if container not connected.public void connect(ID targetID, IConnectContext joinContext) throws ContainerConnectException
IContainer
connect
in interface IContainer
connect
in class SOContainer
targetID
- 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.protected Callback[] createAuthorizationCallbacks()
protected java.lang.Object getConnectData(ID remote, IConnectContext joinContext) throws java.io.IOException, UnsupportedCallbackException
java.io.IOException
UnsupportedCallbackException
protected int getConnectTimeout()
protected void handleLeaveGroupMessage(ContainerMessage mess)
handleLeaveGroupMessage
in class SOContainer
mess
- leave group messageprotected void handleViewChangeMessage(ContainerMessage mess) throws java.io.IOException
handleViewChangeMessage
in class SOContainer
java.io.IOException
protected void forwardExcluding(ID from, ID excluding, ContainerMessage data) throws java.io.IOException
forwardExcluding
in class SOContainer
from
- fromexcluding
- excludingdata
- datajava.io.IOException
- not thrown by this implementation.protected java.io.Serializable getLeaveData(ID target)
public void disconnect()
IContainer
null
.disconnect
in interface IContainer
disconnect
in class SOContainer
protected abstract ISynchAsynchConnection createConnection(ID targetID, java.lang.Object data) throws ConnectionCreateException
connect(ID, IConnectContext)
. Following
a return from this method, the new ISynchAsynchConnection instance's IConnection.connect(ID, Object, int)
method is subsequently
called.targetID
- the targetID to connect to. The value is the same as that passed into connect(ID, IConnectContext)
.data
- and data provided to the connection via the IConnectContext passed into the connect(ID, IConnectContext)
call.ISynchAsynchConnection
a connection instance. Will not be null
.ConnectionCreateException
- thrown if the connection cannot be created.protected void queueContainerMessage(ContainerMessage message) throws java.io.IOException
queueContainerMessage
in class SOContainer
java.io.IOException
protected void forwardExcluding(ID from, ID excluding, byte msg, java.io.Serializable data) throws java.io.IOException
from
- fromexcluding
- excludingmsg
- msgdata
- datajava.io.IOException
- not thrown by this implementation.protected void forwardToRemote(ID from, ID to, ContainerMessage message) throws java.io.IOException
forwardToRemote
in class SOContainer
from
- fromto
- tomessage
- messagejava.io.IOException
- not thrown by this implementation.protected ID getIDForConnection(IAsynchConnection conn)
getIDForConnection
in class SOContainer
protected void handleLeave(ID fromID, IConnection conn)
handleLeave
in class SOContainer
protected void sendMessage(ContainerMessage data) throws java.io.IOException
sendMessage
in class SOContainer
java.io.IOException
protected ID[] sendCreateMsg(ID toID, SharedObjectDescription createInfo) throws java.io.IOException
java.io.IOException
protected void sendCreate(ID sharedObjectId, ID toContainerId, SharedObjectDescription sd) throws java.io.IOException
sendCreate
in class SOContainer
java.io.IOException
protected void sendCreateResponse(ID homeId, ID sharedObjectId, java.lang.Throwable t, long identifier) throws java.io.IOException
sendCreateResponse
in class SOContainer
java.io.IOException
protected void sendCreateResponseSharedObjectMessage(ID toContainerId, ID fromSharedObject, java.lang.Throwable t, long ident) throws java.io.IOException
sendCreateResponseSharedObjectMessage
in class SOContainer
java.io.IOException
protected ID[] sendCreateSharedObjectMessage(ID toContainerId, SharedObjectDescription sd) throws java.io.IOException
sendCreateSharedObjectMessage
in class SOContainer
java.io.IOException
protected void sendDispose(ID toContainerId, ID sharedObjectId) throws java.io.IOException
sendDispose
in class SOContainer
java.io.IOException
protected void sendDisposeSharedObjectMessage(ID toContainerId, ID fromSharedObject) throws java.io.IOException
sendDisposeSharedObjectMessage
in class SOContainer
java.io.IOException
protected void sendMessage(ID toContainerId, ID sharedObjectId, java.lang.Object message) throws java.io.IOException
sendMessage
in class SOContainer
java.io.IOException
protected void sendSharedObjectMessage(ID toContainerId, ID fromSharedObject, java.io.Serializable data) throws java.io.IOException
sendSharedObjectMessage
in class SOContainer
java.io.IOException
protected void disconnect(java.lang.Throwable exception)
protected void processDisconnect(DisconnectEvent evt)
processDisconnect
in class SOContainer
protected void processAsynch(AsynchEvent evt) throws java.io.IOException
processAsynch
in class SOContainer
evt
- eventjava.io.IOException
- not thrown by this implementation.protected java.io.Serializable processSynch(SynchEvent evt) throws java.io.IOException
processSynch
in class SOContainer
java.io.IOException
protected boolean isConnected()
protected boolean isConnecting()