|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.provider.datashare.nio.NIODatashareContainer
public abstract class NIODatashareContainer
A datashare channel container implementation that creates channels that uses NIO for sending and receiving messages.
The channel container facilitates communication at a socket-level to a
corresponding NIOChannel
. When a request has been received from a
remote peer to establish a channel connection, the request can be honoured
via calling the enqueue(SocketAddress)
method with the remote peer's
corresponding socket address as the parameter.
Subclasses must implement the following:
Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Constructor Summary | |
---|---|
NIODatashareContainer(IContainer container)
Instantiates a new datashare container that will connect to remote clients using NIO functionality. |
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 channelId,
IChannelListener listener,
java.util.Map properties)
Create a new channel within this container |
protected abstract NIOChannel |
createNIOChannel(IChannelConfig newChannelConfig)
Creates a new NIO-capable channel within this container. |
protected abstract NIOChannel |
createNIOChannel(ID channelId,
IChannelListener listener,
java.util.Map properties)
Creates a new NIO-capable channel within this container. |
void |
enqueue(java.net.SocketAddress address)
Enqueues the specified address to be connected to. |
java.lang.Object |
getAdapter(java.lang.Class adapter)
|
IChannel |
getChannel(ID channelId)
Get IChannel with given channelID. |
protected abstract void |
log(org.eclipse.core.runtime.IStatus status)
|
boolean |
removeChannel(ID channelId)
Remove channel with given ID. |
void |
removeListener(IChannelContainerListener listener)
Remove listener for IChannelContainerAdapter events |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.ecf.datashare.IAbstractChannelContainerAdapter |
---|
getChannelNamespace |
Constructor Detail |
---|
public NIODatashareContainer(IContainer container)
container
- the parent container of this datashare container, must not be
null
Method Detail |
---|
protected abstract void log(org.eclipse.core.runtime.IStatus status)
public void enqueue(java.net.SocketAddress address)
address
- the address to connect to, cannot be null
NIOChannel.sendRequest(ID)
protected abstract NIOChannel createNIOChannel(ID channelId, IChannelListener listener, java.util.Map properties) throws ECFException
channelId
- the ID of the channel, must not be null
listener
- the listener for receiving notifications pertaining to the
created channel, may be null
if no listener needs
to be notifiedproperties
- a map of properties to provide to this channel, may be
null
ECFException
- if an error occurred while creating the channelcreateChannel(ID, IChannelListener, Map)
protected abstract NIOChannel createNIOChannel(IChannelConfig newChannelConfig) throws ECFException
newChannelConfig
- the configuration for the newly created channel, must not be
null
ECFException
- if an error occurred while creating the channelcreateChannel(IChannelConfig)
public final IChannel createChannel(ID channelId, IChannelListener listener, java.util.Map properties) throws ECFException
IChannelContainerAdapter
createChannel
in interface IChannelContainerAdapter
channelId
- 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
.
ECFException
- if some problem creating IChannel instancepublic final IChannel createChannel(IChannelConfig newChannelConfig) throws ECFException
IChannelContainerAdapter
createChannel
in interface IChannelContainerAdapter
newChannelConfig
- the configuration for the newly created channel. Must not be
null
.
null
.
ECFException
- if some problem creating IChannel instancepublic void addListener(IChannelContainerListener listener)
IAbstractChannelContainerAdapter
addListener
in interface IAbstractChannelContainerAdapter
listener
- to be added. Must not be null
.public IChannel getChannel(ID channelId)
IAbstractChannelContainerAdapter
getChannel
in interface IAbstractChannelContainerAdapter
channelId
- the ID of the channel to get. Must not be null
.
null
if channel not found.public boolean removeChannel(ID channelId)
IAbstractChannelContainerAdapter
IAbstractChannel.dispose()
to dispose the channel
before returning from this method.
removeChannel
in interface IAbstractChannelContainerAdapter
channelId
- the ID of the channel to remove within this container. Must
not be null
.
public void removeListener(IChannelContainerListener listener)
IAbstractChannelContainerAdapter
removeListener
in interface IAbstractChannelContainerAdapter
listener
- to be removed. Must not be null
.public java.lang.Object getAdapter(java.lang.Class adapter)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |