org.eclipse.ecf.provider.datashare
Class DatashareContainerAdapter

java.lang.Object
  extended by org.eclipse.ecf.provider.datashare.DatashareContainerAdapter
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IAbstractChannelContainerAdapter, IChannelContainerAdapter

public class DatashareContainerAdapter
extends java.lang.Object
implements IChannelContainerAdapter


Field Summary
protected  SOContainer container
           
protected static int DEFAULT_TRANSACTION_WAIT
           
protected  SharedObjectDatashareContainerAdapter delegate
           
protected  ID delegateID
           
protected static int SO_CREATION_ERROR
           
 
Constructor Summary
DatashareContainerAdapter(SOContainer container)
           
 
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
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 IChannel getChannel(ID channelID)
          Get IChannel with given channelID.
 Namespace getChannelNamespace()
          Get expected Namespace for channel ID creation
protected  void initialize()
           
 boolean removeChannel(ID channelID)
          Remove channel with given ID.
 void removeListener(IChannelContainerListener listener)
          Remove listener for IChannelContainerAdapter events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected SOContainer container

DEFAULT_TRANSACTION_WAIT

protected static final int DEFAULT_TRANSACTION_WAIT
See Also:
Constant Field Values

SO_CREATION_ERROR

protected static final int SO_CREATION_ERROR
See Also:
Constant Field Values

delegate

protected SharedObjectDatashareContainerAdapter delegate

delegateID

protected ID delegateID
Constructor Detail

DatashareContainerAdapter

public DatashareContainerAdapter(SOContainer container)
Method Detail

initialize

protected void initialize()

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.

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable