Package org.eclipse.spi.net4j
Class Channel
- java.lang.Object
- 
- org.eclipse.net4j.util.event.Notifier
- 
- org.eclipse.net4j.util.lifecycle.Lifecycle
- 
- org.eclipse.spi.net4j.Channel
 
 
 
- 
- All Implemented Interfaces:
- IBufferHandler,- IBufferProvider,- IChannel,- ILocationAware,- org.eclipse.net4j.util.collection.Closeable,- org.eclipse.net4j.util.concurrent.IExecutorServiceProvider,- org.eclipse.net4j.util.container.IManagedContainerProvider,- org.eclipse.net4j.util.event.INotifier,- org.eclipse.net4j.util.event.INotifier.INotifier2,- org.eclipse.net4j.util.lifecycle.IDeactivateable,- org.eclipse.net4j.util.lifecycle.ILifecycle,- org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation,- org.eclipse.net4j.util.security.IUserAware,- InternalChannel
 
 public class Channel extends org.eclipse.net4j.util.lifecycle.Lifecycle implements InternalChannel, org.eclipse.net4j.util.concurrent.IExecutorServiceProvider, org.eclipse.net4j.util.container.IManagedContainerProvider If the meaning of this type isn't clear, there really should be more of a description here...- Since:
- 2.0
- Author:
- Eike Stepper
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classChannel.ReceiverWorkDeprecated.As of 4.10 scheduled for future removal.protected classChannel.ReceiveSerializerDeprecated.As of 4.4 scheduled for future removal.protected classChannel.SendQueueA queue that holds buffers that shall be sent.- 
Nested classes/interfaces inherited from interface org.eclipse.net4j.buffer.IBufferProviderIBufferProvider.Introspection, IBufferProvider.Notification
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycleorg.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.ILocationAwareILocationAware.Location
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifierorg.eclipse.net4j.util.event.INotifier.INotifier2
 - 
Nested classes/interfaces inherited from interface org.eclipse.spi.net4j.InternalChannelInternalChannel.CountersChangedEvent, InternalChannel.SendQueueEvent
 
- 
 - 
Constructor SummaryConstructors Constructor Description Channel()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()protected Channel.ReceiverWorkcreateReceiverWork(IBuffer buffer)Deprecated.As of 4.10 scheduled for future removal.protected voiddoActivate()protected voiddoBeforeActivate()protected voiddoDeactivate()shortgetBufferCapacity()Returns the capacity of the buffers provided byIBufferProvider.provideBuffer().org.eclipse.net4j.util.container.IManagedContainergetContainer()java.util.concurrent.ExecutorServicegetExecutorService()shortgetID()Returns the ID of this channel.ILocationAware.LocationgetLocation()IChannelMultiplexergetMultiplexer()Returns the multiplexer this channel is associated with.longgetReceivedBuffers()Returns the number ofbuffersthat are received from themultiplexerof this channel and are passed on to thereceive handlerof this channel.longgetReceivedBytes()Returns the number of bytes that are received from themultiplexerof this channel and are passed on to thereceive handlerof this channel.java.util.concurrent.ExecutorServicegetReceiveExecutor()Deprecated.IBufferHandlergetReceiveHandler()Returns theIBufferHandlerthat handles buffers received from the peer channel.java.util.Queue<IBuffer>getSendQueue()longgetSentBuffers()Returns the number ofbuffersthat are sent to themultiplexerof this channel.longgetSentBytes()Returns the number of bytes that are sent to themultiplexerof this channel.java.lang.StringgetUserID()voidhandleBuffer(IBuffer buffer)Handles the given buffer.voidhandleBufferFromMultiplexer(IBuffer buffer)Handles a buffer sent by the multiplexer.booleanisClient()booleanisClosed()booleanisServer()IBufferprovideBuffer()Provides a buffer from thisBufferProvider.voidretainBuffer(IBuffer buffer)Retains a buffer to thisBufferProvider.voidsendBuffer(IBuffer buffer)Asynchronously sends the given buffer to the receive handler of the peer channel.voidsetID(short id)voidsetMultiplexer(IChannelMultiplexer channelMultiplexer)voidsetReceiveExecutor(java.util.concurrent.ExecutorService receiveExecutor)Deprecated.voidsetReceiveHandler(IBufferHandler receiveHandler)Sets theIBufferHandlerto handle buffers received from the peer channel.voidsetUserID(java.lang.String userID)java.lang.StringtoString()protected voidunregisterFromMultiplexer()- 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycleactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation
 - 
Methods inherited from class org.eclipse.net4j.util.event.NotifieraddListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
- 
 
- 
- 
- 
Method Detail- 
getContainerpublic org.eclipse.net4j.util.container.IManagedContainer getContainer() - Specified by:
- getContainerin interface- org.eclipse.net4j.util.container.IManagedContainerProvider
 
 - 
getUserIDpublic java.lang.String getUserID() - Specified by:
- getUserIDin interface- org.eclipse.net4j.util.security.IUserAware
 
 - 
setUserIDpublic void setUserID(java.lang.String userID) - Specified by:
- setUserIDin interface- InternalChannel
 
 - 
getLocationpublic ILocationAware.Location getLocation() Description copied from interface:ILocationAware- Specified by:
- getLocationin interface- ILocationAware
 
 - 
isClientpublic boolean isClient() Description copied from interface:ILocationAware- Specified by:
- isClientin interface- ILocationAware
 
 - 
isServerpublic boolean isServer() Description copied from interface:ILocationAware- Specified by:
- isServerin interface- ILocationAware
 
 - 
getMultiplexerpublic IChannelMultiplexer getMultiplexer() Description copied from interface:IChannelReturns the multiplexer this channel is associated with. This channel multiplexer can be used, for example, to open additional channels that will be multiplexed through the same transport medium.- Specified by:
- getMultiplexerin interface- IChannel
 
 - 
setMultiplexerpublic void setMultiplexer(IChannelMultiplexer channelMultiplexer) - Specified by:
- setMultiplexerin interface- InternalChannel
 
 - 
getIDpublic short getID() Description copied from interface:IChannelReturns the ID of this channel. The ID is unique at any time among all channels of the associatedmultiplexer.
 - 
setIDpublic void setID(short id) - Specified by:
- setIDin interface- InternalChannel
 
 - 
getExecutorServicepublic java.util.concurrent.ExecutorService getExecutorService() - Specified by:
- getExecutorServicein interface- org.eclipse.net4j.util.concurrent.IExecutorServiceProvider
- Since:
- 4.5
 
 - 
getReceiveExecutor@Deprecated public java.util.concurrent.ExecutorService getReceiveExecutor() Deprecated.- Specified by:
- getReceiveExecutorin interface- InternalChannel
 
 - 
setReceiveExecutor@Deprecated public void setReceiveExecutor(java.util.concurrent.ExecutorService receiveExecutor) Deprecated.- Specified by:
- setReceiveExecutorin interface- InternalChannel
 
 - 
getReceiveHandlerpublic IBufferHandler getReceiveHandler() Description copied from interface:IChannelReturns theIBufferHandlerthat handles buffers received from the peer channel.- Specified by:
- getReceiveHandlerin interface- IChannel
 
 - 
setReceiveHandlerpublic void setReceiveHandler(IBufferHandler receiveHandler) Description copied from interface:IChannelSets theIBufferHandlerto handle buffers received from the peer channel.- Specified by:
- setReceiveHandlerin interface- IChannel
 
 - 
getSentBufferspublic long getSentBuffers() Description copied from interface:IChannelReturns the number ofbuffersthat are sent to themultiplexerof this channel.- Specified by:
- getSentBuffersin interface- IChannel
- Since:
- 3.0
 
 - 
getSentBytespublic final long getSentBytes() Description copied from interface:IChannelReturns the number of bytes that are sent to themultiplexerof this channel.- Specified by:
- getSentBytesin interface- IChannel
- Since:
- 4.13
 
 - 
getReceivedBufferspublic long getReceivedBuffers() Description copied from interface:IChannelReturns the number ofbuffersthat are received from themultiplexerof this channel and are passed on to thereceive handlerof this channel.- Specified by:
- getReceivedBuffersin interface- IChannel
- Since:
- 3.0
 
 - 
getReceivedBytespublic final long getReceivedBytes() Description copied from interface:IChannelReturns the number of bytes that are received from themultiplexerof this channel and are passed on to thereceive handlerof this channel.- Specified by:
- getReceivedBytesin interface- IChannel
- Since:
- 4.13
 
 - 
getSendQueuepublic java.util.Queue<IBuffer> getSendQueue() - Specified by:
- getSendQueuein interface- InternalChannel
 
 - 
sendBufferpublic void sendBuffer(IBuffer buffer) Description copied from interface:IChannelAsynchronously sends the given buffer to the receive handler of the peer channel.- Specified by:
- sendBufferin interface- IChannel
 
 - 
handleBufferpublic void handleBuffer(IBuffer buffer) Handles the given buffer. Ensures it is in the PUTTING state (otherwise ignores it) and sends it on behalf of the send queue.- Specified by:
- handleBufferin interface- IBufferHandler
- Parameters:
- buffer- The buffer to be handled.
- See Also:
- IBuffer.getState(),- BufferState.PUTTING,- sendQueue
 
 - 
handleBufferFromMultiplexerpublic void handleBufferFromMultiplexer(IBuffer buffer) Handles a buffer sent by the multiplexer. Adds work to the receive queue or releases the buffer.- Specified by:
- handleBufferFromMultiplexerin interface- InternalChannel
- See Also:
- InternalChannelMultiplexer.multiplexChannel(org.eclipse.spi.net4j.InternalChannel)
 
 - 
createReceiverWork@Deprecated protected Channel.ReceiverWork createReceiverWork(IBuffer buffer) Deprecated.As of 4.10 scheduled for future removal.
 - 
getBufferCapacitypublic short getBufferCapacity() Description copied from interface:IBufferProviderReturns the capacity of the buffers provided byIBufferProvider.provideBuffer().- Specified by:
- getBufferCapacityin interface- IBufferProvider
 
 - 
provideBufferpublic IBuffer provideBuffer() Description copied from interface:IBufferProviderProvides a buffer from thisBufferProvider.- Specified by:
- provideBufferin interface- IBufferProvider
 
 - 
retainBufferpublic void retainBuffer(IBuffer buffer) Description copied from interface:IBufferProviderRetains a buffer to thisBufferProvider.- Specified by:
- retainBufferin interface- IBufferProvider
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- org.eclipse.net4j.util.lifecycle.Lifecycle
 
 - 
doBeforeActivateprotected void doBeforeActivate() throws java.lang.Exception- Overrides:
- doBeforeActivatein class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doActivateprotected void doActivate() throws java.lang.Exception- Overrides:
- doActivatein class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doDeactivateprotected void doDeactivate() throws java.lang.Exception- Overrides:
- doDeactivatein class- org.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
- java.lang.Exception
 
 - 
unregisterFromMultiplexerprotected void unregisterFromMultiplexer() 
 - 
closepublic void close() - Specified by:
- closein interface- org.eclipse.net4j.util.collection.Closeable
 
 - 
isClosedpublic boolean isClosed() - Specified by:
- isClosedin interface- org.eclipse.net4j.util.collection.Closeable
 
 
- 
 
-