org.eclipse.ecf.provider.datashare
Class DatashareContainer

java.lang.Object
  extended by org.eclipse.ecf.core.AbstractContainer
      extended by org.eclipse.ecf.provider.generic.SOContainer
          extended by org.eclipse.ecf.provider.generic.ClientSOContainer
              extended by org.eclipse.ecf.provider.generic.TCPClientSOContainer
                  extended by org.eclipse.ecf.provider.datashare.DatashareContainer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IContainer, IIdentifiable, IReliableContainer, ISharedObjectContainer, ISharedObjectContainerClient, IAbstractChannelContainerAdapter, IChannelContainerAdapter

public class DatashareContainer
extends TCPClientSOContainer
implements IChannelContainerAdapter


Field Summary
protected  DatashareContainerAdapter adapter
           
protected static int DEFAULT_CONTAINER_KEEP_ALIVE
           
protected static int DEFAULT_TRANSACTION_WAIT
           
 
Fields inherited from class org.eclipse.ecf.provider.generic.TCPClientSOContainer
DEFAULT_COMM_NAME, DEFAULT_TCP_CONNECT_TIMEOUT
 
Fields inherited from class org.eclipse.ecf.provider.generic.ClientSOContainer
CONNECTED, CONNECTING, connection, connectionState, connectLock, connectPolicy, DEFAULT_CONNECT_TIMEOUT, DISCONNECTED, remoteServerID
 
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
DatashareContainer(ISharedObjectContainerConfig config)
           
 
Method Summary
 void addListener(IChannelContainerListener listener)
          Add listener for IChannelContainerAdapter events.
 IChannel createChannel(IChannelConfig newChannelConfig)
          Create a new channel within this container
 IChannel createChannel(ID newID, IChannelListener listener, java.util.Map properties)
          Create a new channel within this container
 IChannel getChannel(ID channelID)
          Get IChannel with given channelID.
 Namespace getChannelNamespace()
          Get expected Namespace for channel ID creation
 boolean removeChannel(ID channelID)
          Remove channel with given ID.
 void removeListener(IChannelContainerListener listener)
          Remove listener for IChannelContainerAdapter events
 
Methods inherited from class org.eclipse.ecf.provider.generic.TCPClientSOContainer
createConnection, getConnectTimeout, main
 
Methods inherited from class org.eclipse.ecf.provider.generic.ClientSOContainer
connect, createAuthorizationCallbacks, disconnect, disconnect, dispose, forwardExcluding, forwardExcluding, forwardToRemote, getConnectData, getConnectedID, getConnection, getConnectLock, getIDForConnection, getLeaveData, handleConnectResponse, handleLeave, handleLeaveGroupMessage, handleViewChangeMessage, isConnected, isConnecting, isGroupManager, processAsynch, processDisconnect, processSynch, queueContainerMessage, sendCreate, sendCreateMsg, sendCreateResponse, sendCreateResponseSharedObjectMessage, sendCreateSharedObjectMessage, sendDispose, sendDisposeSharedObjectMessage, sendMessage, sendMessage, sendSharedObjectMessage, setConnectInitiatorPolicy
 
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, handleSharedObjectDisposeMessage, handleSharedObjectMessage, handleUndeliveredSharedObjectMessage, handleUnidentifiedMessage, isClosing, load, moveFromLoadingToActive, notifySharedObjectActivated, notifySharedObjectDeactivated, printToSystemError, removeFromLoading, removeRemoteMember, removeSharedObject, 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.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.ecf.core.IContainer
addListener, removeListener
 

Field Detail

DEFAULT_CONTAINER_KEEP_ALIVE

protected static final int DEFAULT_CONTAINER_KEEP_ALIVE
See Also:
Constant Field Values

DEFAULT_TRANSACTION_WAIT

protected static final int DEFAULT_TRANSACTION_WAIT
See Also:
Constant Field Values

adapter

protected DatashareContainerAdapter adapter
Constructor Detail

DatashareContainer

public DatashareContainer(ISharedObjectContainerConfig config)
Method Detail

createChannel

public IChannel createChannel(ID newID,
                              IChannelListener listener,
                              java.util.Map properties)
                       throws ECFException
Description copied from interface: IChannelContainerAdapter
Create a new channel within this container

Specified by:
createChannel in interface IChannelContainerAdapter
Parameters:
newID - the ID of the new channel. Must not be null.
listener - a listener for receiving messages from remotes for this channel. May be null if no listener is to be notified.
properties - a Map of properties to provide to the channel. May be null.
Returns:
IChannel the new IChannel instance
Throws:
ECFException - if some problem creating IChannel instance

createChannel

public IChannel createChannel(IChannelConfig newChannelConfig)
                       throws ECFException
Description copied from interface: IChannelContainerAdapter
Create a new channel within this container

Specified by:
createChannel in interface IChannelContainerAdapter
Parameters:
newChannelConfig - the configuration for the newly created channel. Must not be null.
Returns:
IChannel the new IChannel instance. Will not be null.
Throws:
ECFException - if some problem creating IChannel instance

getChannel

public IChannel getChannel(ID channelID)
Description copied from interface: IAbstractChannelContainerAdapter
Get IChannel with given channelID.

Specified by:
getChannel in interface IAbstractChannelContainerAdapter
Parameters:
channelID - the ID of the channel to get. Must not be null.
Returns:
IChannel of channel within container with given ID. Returns null if channel not found.

removeChannel

public boolean removeChannel(ID channelID)
Description copied from interface: IAbstractChannelContainerAdapter
Remove channel with given ID. If the channel is found in the container, the enclosing container will call IAbstractChannel.dispose() to dispose the channel before returning from this method.

Specified by:
removeChannel in interface IAbstractChannelContainerAdapter
Parameters:
channelID - the ID of the channel to remove within this container. Must not be null.
Returns:
true if channel found and Removed. False if channel not found within container.

getChannelNamespace

public Namespace getChannelNamespace()
Description copied from interface: IAbstractChannelContainerAdapter
Get expected Namespace for channel ID creation

Specified by:
getChannelNamespace in interface IAbstractChannelContainerAdapter
Returns:
Namespace that can be used to create channel ID instances for this channel container. Will not be null.

addListener

public void addListener(IChannelContainerListener listener)
Description copied from interface: IAbstractChannelContainerAdapter
Add listener for IChannelContainerAdapter events.

Specified by:
addListener in interface IAbstractChannelContainerAdapter
Parameters:
listener - to be added. Must not be null.

removeListener

public void removeListener(IChannelContainerListener listener)
Description copied from interface: IAbstractChannelContainerAdapter
Remove listener for IChannelContainerAdapter events

Specified by:
removeListener in interface IAbstractChannelContainerAdapter
Parameters:
listener - to be removed. Must not be null.