public class Channel extends Lifecycle implements InternalChannel, IExecutorServiceProvider
| Modifier and Type | Class and Description |
|---|---|
protected class |
Channel.ReceiverWork
Deprecated.
As of 4.10 scheduled for future removal.
|
protected class |
Channel.ReceiveSerializer
Deprecated.
As of 4.4 scheduled for future removal.
|
protected class |
Channel.SendQueue
A queue that holds buffers that shall be sent.
|
InternalChannel.SendQueueEventILocationAware.LocationIBufferProvider.Introspection, IBufferProvider.NotificationILifecycle.DeferrableActivation| Constructor and Description |
|---|
Channel() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected Channel.ReceiverWork |
createReceiverWork(IBuffer buffer)
Deprecated.
As of 4.10 scheduled for future removal.
|
protected void |
doActivate() |
protected void |
doBeforeActivate() |
protected void |
doDeactivate() |
short |
getBufferCapacity()
Returns the capacity of the buffers provided by
IBufferProvider.provideBuffer() . |
java.util.concurrent.ExecutorService |
getExecutorService() |
short |
getID()
Returns the ID of this channel.
|
ILocationAware.Location |
getLocation()
|
IChannelMultiplexer |
getMultiplexer()
Returns the multiplexer this channel is associated with.
|
long |
getReceivedBuffers()
Returns the number of
buffers that are received from the multiplexer of this channel
and are passed on to the receive handler of this channel. |
java.util.concurrent.ExecutorService |
getReceiveExecutor()
Deprecated.
|
IBufferHandler |
getReceiveHandler()
Returns the
IBufferHandler that handles buffers received from the peer channel. |
java.util.Queue<IBuffer> |
getSendQueue() |
long |
getSentBuffers()
Returns the number of
buffers that are sent to the multiplexer of this channel. |
java.lang.String |
getUserID() |
void |
handleBuffer(IBuffer buffer)
Handles the given buffer.
|
void |
handleBufferFromMultiplexer(IBuffer buffer)
Handles a buffer sent by the multiplexer.
|
boolean |
isClient()
|
boolean |
isClosed() |
boolean |
isServer()
|
IBuffer |
provideBuffer()
Provides a buffer from this
BufferProvider. |
void |
retainBuffer(IBuffer buffer)
Retains a buffer to this
BufferProvider. |
void |
sendBuffer(IBuffer buffer)
Asynchronously sends the given buffer to the receive handler of the peer channel.
|
void |
setID(short id) |
void |
setMultiplexer(IChannelMultiplexer channelMultiplexer) |
void |
setReceiveExecutor(java.util.concurrent.ExecutorService receiveExecutor)
Deprecated.
|
void |
setReceiveHandler(IBufferHandler receiveHandler)
Sets the
IBufferHandler to handle buffers received from the peer channel. |
void |
setUserID(java.lang.String userID) |
java.lang.String |
toString() |
protected void |
unregisterFromMultiplexer() |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivationaddListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactivate, deactivate, getLifecycleState, isActiveaddListener, getListeners, hasListeners, removeListenerpublic java.lang.String getUserID()
getUserID in interface IUserAwarepublic void setUserID(java.lang.String userID)
setUserID in interface InternalChannelpublic ILocationAware.Location getLocation()
ILocationAwaregetLocation in interface ILocationAwarepublic boolean isClient()
ILocationAwareisClient in interface ILocationAwarepublic boolean isServer()
ILocationAwareisServer in interface ILocationAwarepublic IChannelMultiplexer getMultiplexer()
IChannelgetMultiplexer in interface IChannelpublic void setMultiplexer(IChannelMultiplexer channelMultiplexer)
setMultiplexer in interface InternalChannelpublic short getID()
IChannelmultiplexer.public void setID(short id)
setID in interface InternalChannelpublic java.util.concurrent.ExecutorService getExecutorService()
getExecutorService in interface IExecutorServiceProvider@Deprecated public java.util.concurrent.ExecutorService getReceiveExecutor()
getReceiveExecutor in interface InternalChannel@Deprecated public void setReceiveExecutor(java.util.concurrent.ExecutorService receiveExecutor)
setReceiveExecutor in interface InternalChannelpublic IBufferHandler getReceiveHandler()
IChannelIBufferHandler that handles buffers received from the peer channel.getReceiveHandler in interface IChannelpublic void setReceiveHandler(IBufferHandler receiveHandler)
IChannelIBufferHandler to handle buffers received from the peer channel.setReceiveHandler in interface IChannelpublic long getSentBuffers()
IChannelbuffers that are sent to the multiplexer of this channel.getSentBuffers in interface IChannelpublic long getReceivedBuffers()
IChannelbuffers that are received from the multiplexer of this channel
and are passed on to the receive handler of this channel.getReceivedBuffers in interface IChannelpublic java.util.Queue<IBuffer> getSendQueue()
getSendQueue in interface InternalChannelpublic void sendBuffer(IBuffer buffer)
IChannelsendBuffer in interface IChannelpublic void handleBuffer(IBuffer buffer)
handleBuffer in interface IBufferHandlerbuffer - The buffer to be handled.IBuffer.getState(),
BufferState.PUTTING,
sendQueuepublic void handleBufferFromMultiplexer(IBuffer buffer)
handleBufferFromMultiplexer in interface InternalChannelInternalChannelMultiplexer.multiplexChannel(org.eclipse.spi.net4j.InternalChannel)@Deprecated protected Channel.ReceiverWork createReceiverWork(IBuffer buffer)
public short getBufferCapacity()
IBufferProviderIBufferProvider.provideBuffer() .getBufferCapacity in interface IBufferProviderpublic IBuffer provideBuffer()
IBufferProviderBufferProvider.provideBuffer in interface IBufferProviderpublic void retainBuffer(IBuffer buffer)
IBufferProviderBufferProvider.retainBuffer in interface IBufferProviderprotected void doBeforeActivate()
throws java.lang.Exception
doBeforeActivate in class Lifecyclejava.lang.Exceptionprotected void doActivate()
throws java.lang.Exception
doActivate in class Lifecyclejava.lang.Exceptionprotected void doDeactivate()
throws java.lang.Exception
doDeactivate in class Lifecyclejava.lang.Exceptionprotected void unregisterFromMultiplexer()
Copyright (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