public abstract class ChannelMultiplexer extends Container<IChannel> implements InternalChannelMultiplexer, IExecutorServiceProvider
ILocationAware.LocationIContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>IBufferProvider.Introspection, IBufferProvider.NotificationILifecycle.DeferrableActivationCONTEXT_MULTIPLEXER, RESERVED_CHANNELDEFAULT_OPEN_CHANNEL_TIMEOUT, NO_CHANNEL_TIMEOUT| Constructor and Description |
|---|
ChannelMultiplexer() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeChannel(InternalChannel channel) |
protected InternalChannel |
createChannel() |
protected abstract INegotiationContext |
createNegotiationContext() |
protected <INFRA_STRUCTURE> |
createProtocol(java.lang.String type,
INFRA_STRUCTURE infraStructure) |
protected IFactoryKey |
createProtocolFactoryKey(java.lang.String type) |
protected abstract void |
deregisterChannelFromPeer(InternalChannel channel) |
protected void |
doBeforeOpenChannel(IProtocol<?> protocol) |
protected void |
doDeactivate() |
InternalChannel |
getChannel(short channelID) |
java.util.Collection<IChannel> |
getChannels()
Returns a collection of currently open channels.
|
ITransportConfig |
getConfig()
Returns the current transport configuration if there is one, a new empty one otherwise.
|
IChannel[] |
getElements() |
java.util.concurrent.ExecutorService |
getExecutorService() |
long |
getOpenChannelTimeout() |
protected void |
initChannel(InternalChannel channel,
IProtocol<?> protocol) |
void |
inverseCloseChannel(short channelID) |
InternalChannel |
inverseOpenChannel(short channelID,
java.lang.String protocolID)
Deprecated.
|
InternalChannel |
inverseOpenChannel(short channelID,
java.lang.String protocolID,
int protocolVersion) |
boolean |
isEmpty() |
InternalChannel |
openChannel()
Synchronous request to open a new
IChannel with an undefined channel protocol. |
InternalChannel |
openChannel(IProtocol<?> protocol)
Synchronous request to open a new
IChannel with the given channel protocol . |
InternalChannel |
openChannel(java.lang.String protocolID,
java.lang.Object infraStructure)
Synchronous request to open a new
IChannel with a channel protocol defined by a given protocol identifier. |
protected abstract void |
registerChannelWithPeer(short channelID,
long timeout,
IProtocol<?> protocol) |
void |
setConfig(ITransportConfig config)
Sets a new transport configuration by copying the given one.
|
void |
setOpenChannelTimeout(long openChannelTimeout) |
fireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEventactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringaddListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmultiplexChannelgetLocation, isClient, isServeraddListener, getListeners, hasListeners, removeListenergetBufferCapacity, provideBuffer, retainBufferpublic ITransportConfig getConfig()
ITransportConfigAwaregetConfig in interface ITransportConfigAwarepublic void setConfig(ITransportConfig config)
ITransportConfigAwaresetConfig in interface ITransportConfigAwarepublic java.util.concurrent.ExecutorService getExecutorService()
getExecutorService in interface IExecutorServiceProviderpublic long getOpenChannelTimeout()
getOpenChannelTimeout in interface IChannelMultiplexerpublic void setOpenChannelTimeout(long openChannelTimeout)
setOpenChannelTimeout in interface IChannelMultiplexerpublic final InternalChannel getChannel(short channelID)
public final java.util.Collection<IChannel> getChannels()
IChannelMultiplexergetChannels in interface IChannelMultiplexerpublic boolean isEmpty()
public IChannel[] getElements()
getElements in interface IContainer<IChannel>public InternalChannel openChannel() throws ChannelException
IChannelMultiplexerIChannel with an undefined channel protocol. Since the peer connector
can't lookup a protocol factory without a protocol identifier the IBufferHandler of the
peer IChannel can only be provided by externally provided channel lifecycle
listeners.
openChannel in interface IChannelMultiplexerChannelExceptionIChannelMultiplexer.openChannel(String, Object),
IChannelMultiplexer.openChannel(IProtocol)public InternalChannel openChannel(java.lang.String protocolID, java.lang.Object infraStructure) throws ChannelException
IChannelMultiplexerIChannel with a channel protocol defined by a given protocol identifier.
The peer connector will lookup a protocol factory with the protocol identifier, create a
IBufferHandler and inject it into the peer IChannel.
openChannel in interface IChannelMultiplexerChannelExceptionIChannelMultiplexer.openChannel(),
IChannelMultiplexer.openChannel(IProtocol)public InternalChannel openChannel(IProtocol<?> protocol) throws ChannelException
IChannelMultiplexerIChannel with the given channel protocol . The peer connector will lookup
a protocol factory with the protocol identifier, create a IBufferHandler and inject it
into the peer channel.
openChannel in interface IChannelMultiplexerChannelExceptionIChannelMultiplexer.openChannel(),
IChannelMultiplexer.openChannel(String, Object)@Deprecated public InternalChannel inverseOpenChannel(short channelID, java.lang.String protocolID)
inverseOpenChannel(short, String, int).public InternalChannel inverseOpenChannel(short channelID, java.lang.String protocolID, int protocolVersion)
public void closeChannel(InternalChannel channel) throws ChannelException
closeChannel in interface InternalChannelMultiplexerChannelExceptionpublic void inverseCloseChannel(short channelID)
throws ChannelException
ChannelExceptionprotected InternalChannel createChannel()
protected void initChannel(InternalChannel channel, IProtocol<?> protocol)
protected <INFRA_STRUCTURE> IProtocol<INFRA_STRUCTURE> createProtocol(java.lang.String type, INFRA_STRUCTURE infraStructure)
protected IFactoryKey createProtocolFactoryKey(java.lang.String type)
protected void doBeforeOpenChannel(IProtocol<?> protocol)
protected void doDeactivate()
throws java.lang.Exception
doDeactivate in class Lifecyclejava.lang.Exceptionprotected abstract INegotiationContext createNegotiationContext()
protected abstract void registerChannelWithPeer(short channelID,
long timeout,
IProtocol<?> protocol)
throws ChannelException
ChannelExceptionprotected abstract void deregisterChannelFromPeer(InternalChannel channel) throws ChannelException
ChannelExceptionCopyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html