|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.net4j.util.event.Notifier org.eclipse.net4j.util.lifecycle.Lifecycle org.eclipse.spi.net4j.Channel
Nested Class Summary | |
---|---|
protected class |
Channel.ReceiverWork
|
protected class |
Channel.ReceiveSerializer
|
protected class |
Channel.SendQueue
A queue that holds buffers that shall be sent. |
Nested classes/interfaces inherited from interface org.eclipse.spi.net4j.InternalChannel |
---|
InternalChannel.SendQueueEvent |
Nested classes/interfaces inherited from interface org.eclipse.net4j.ILocationAware |
---|
ILocationAware.Location |
Nested classes/interfaces inherited from interface org.eclipse.net4j.buffer.IBufferProvider |
---|
IBufferProvider.Introspection |
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle |
---|
ILifecycle.DeferrableActivation |
Field Summary |
---|
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle |
---|
USE_LABEL |
Constructor Summary | |
---|---|
Channel()
|
Method Summary | |
---|---|
void |
close()
|
protected Channel.ReceiverWork |
createReceiverWork(IBuffer buffer)
|
protected void |
doActivate()
|
protected void |
doBeforeActivate()
|
protected void |
doDeactivate()
|
short |
getBufferCapacity()
Returns the capacity of the buffers provided by IBufferProvider.provideBuffer() . |
short |
getID()
Returns the ID of this channel. |
ILocationAware.Location |
getLocation()
Returns the location of this object in a client /server scenario. |
IChannelMultiplexer |
getMultiplexer()
Returns the multiplexer this channel is associated with. |
long |
getReceivedBuffers()
|
ExecutorService |
getReceiveExecutor()
|
IBufferHandler |
getReceiveHandler()
Returns the IBufferHandler that handles buffers received from the peer channel. |
Queue<IBuffer> |
getSendQueue()
|
long |
getSentBuffers()
|
String |
getUserID()
|
void |
handleBuffer(IBuffer buffer)
Handles the given buffer. |
void |
handleBufferFromMultiplexer(IBuffer buffer)
Handles a buffer sent by the multiplexer. |
boolean |
isClient()
Same as . |
boolean |
isClosed()
|
boolean |
isServer()
Same as . |
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(ExecutorService receiveExecutor)
|
void |
setReceiveHandler(IBufferHandler receiveHandler)
Sets the IBufferHandler to handle buffers received from the peer channel. |
void |
setUserID(String userID)
|
String |
toString()
|
protected void |
unregisterFromMultiplexer()
|
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle |
---|
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation |
Methods inherited from class org.eclipse.net4j.util.event.Notifier |
---|
addListener, fireEvent, fireEvent, fireEvent, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle |
---|
activate, deactivate, getLifecycleState, isActive |
Methods inherited from interface org.eclipse.net4j.util.event.INotifier |
---|
addListener, getListeners, hasListeners, removeListener |
Constructor Detail |
---|
public Channel()
Method Detail |
---|
public String getUserID()
getUserID
in interface IUserAware
public void setUserID(String userID)
setUserID
in interface InternalChannel
public ILocationAware.Location getLocation()
ILocationAware
client
/server
scenario.
getLocation
in interface ILocationAware
public boolean isClient()
ILocationAware
ILocationAware.getLocation()
== ILocationAware.Location.CLIENT
.
isClient
in interface ILocationAware
public boolean isServer()
ILocationAware
ILocationAware.getLocation()
== ILocationAware.Location.SERVER
.
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
.
getID
in interface IChannel
public void setID(short id)
setID
in interface InternalChannel
public ExecutorService getReceiveExecutor()
getReceiveExecutor
in interface InternalChannel
public void setReceiveExecutor(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()
getSentBuffers
in interface InternalChannel
public long getReceivedBuffers()
getReceivedBuffers
in interface InternalChannel
public 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 and otionally released.IBuffer.getState()
,
BufferState.PUTTING
,
sendQueue
public void handleBufferFromMultiplexer(IBuffer buffer)
handleBufferFromMultiplexer
in interface InternalChannel
InternalChannelMultiplexer.multiplexChannel(org.eclipse.spi.net4j.InternalChannel)
,
IWorkSerializer
,
Channel.ReceiverWork
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
public String toString()
toString
in class Lifecycle
protected void doBeforeActivate() throws Exception
doBeforeActivate
in class Lifecycle
Exception
protected void doActivate() throws Exception
doActivate
in class Lifecycle
Exception
protected void doDeactivate() throws Exception
doDeactivate
in class Lifecycle
Exception
protected void unregisterFromMultiplexer()
public void close()
close
in interface Closeable
public boolean isClosed()
isClosed
in interface Closeable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |