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.SendQueueEvent
ILocationAware.Location
IBufferProvider.Introspection, IBufferProvider.Notification
ILifecycle.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, isDeferredActivation
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activate, deactivate, getLifecycleState, isActive
addListener, getListeners, hasListeners, removeListener
public java.lang.String getUserID()
getUserID
in interface IUserAware
public void setUserID(java.lang.String userID)
setUserID
in interface InternalChannel
public ILocationAware.Location getLocation()
ILocationAware
getLocation
in interface ILocationAware
public boolean isClient()
ILocationAware
isClient
in interface ILocationAware
public boolean isServer()
ILocationAware
isServer
in interface ILocationAware
public IChannelMultiplexer getMultiplexer()
IChannel
getMultiplexer
in interface IChannel
public void setMultiplexer(IChannelMultiplexer channelMultiplexer)
setMultiplexer
in interface InternalChannel
public short getID()
IChannel
multiplexer
.public void setID(short id)
setID
in interface InternalChannel
public 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 InternalChannel
public IBufferHandler getReceiveHandler()
IChannel
IBufferHandler
that handles buffers received from the peer channel.getReceiveHandler
in interface IChannel
public void setReceiveHandler(IBufferHandler receiveHandler)
IChannel
IBufferHandler
to handle buffers received from the peer channel.setReceiveHandler
in interface IChannel
public long getSentBuffers()
IChannel
buffers
that are sent to the multiplexer
of this channel.getSentBuffers
in interface IChannel
public long getReceivedBuffers()
IChannel
buffers
that are received from the multiplexer
of this channel
and are passed on to the receive handler
of this channel.getReceivedBuffers
in interface IChannel
public java.util.Queue<IBuffer> getSendQueue()
getSendQueue
in interface InternalChannel
public void sendBuffer(IBuffer buffer)
IChannel
sendBuffer
in interface IChannel
public void handleBuffer(IBuffer buffer)
handleBuffer
in interface IBufferHandler
buffer
- The buffer to be handled.IBuffer.getState()
,
BufferState.PUTTING
,
sendQueue
public void handleBufferFromMultiplexer(IBuffer buffer)
handleBufferFromMultiplexer
in interface InternalChannel
InternalChannelMultiplexer.multiplexChannel(org.eclipse.spi.net4j.InternalChannel)
@Deprecated protected Channel.ReceiverWork createReceiverWork(IBuffer buffer)
public short getBufferCapacity()
IBufferProvider
IBufferProvider.provideBuffer()
.getBufferCapacity
in interface IBufferProvider
public IBuffer provideBuffer()
IBufferProvider
BufferProvider
.provideBuffer
in interface IBufferProvider
public void retainBuffer(IBuffer buffer)
IBufferProvider
BufferProvider
.retainBuffer
in interface IBufferProvider
protected void doBeforeActivate() throws java.lang.Exception
doBeforeActivate
in class Lifecycle
java.lang.Exception
protected void doActivate() throws java.lang.Exception
doActivate
in class Lifecycle
java.lang.Exception
protected void doDeactivate() throws java.lang.Exception
doDeactivate
in class Lifecycle
java.lang.Exception
protected 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