Package org.eclipse.spi.net4j

# Klasse Channel

java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.spi.net4j.Channel

Alle implementierten Schnittstellen:
  `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...

Seit:
  2.0
Autor:
  Eike Stepper

## Verschachtelte Klassen - Übersicht

Verschachtelte Klassen
Modifizierer und Typ
Klasse
Beschreibung
`protected class`
`Channel.ReceiverWork`
Veraltet.
As of 4.10 scheduled for future removal.
`protected class`
`Channel.ReceiveSerializer`
Veraltet.
As of 4.4 scheduled for future removal.
`protected class`
`Channel.SendQueue`
A queue that holds buffers that shall be sent.

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.buffer.IBufferProvider

`IBufferProvider.Introspection, IBufferProvider.Notification`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.lifecycle.ILifecycle

`org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.ILocationAware

`ILocationAware.Location`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.event.INotifier

`org.eclipse.net4j.util.event.INotifier.INotifier2`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.spi.net4j.InternalChannel

`InternalChannel.CountersChangedEvent, InternalChannel.SendQueueEvent`

## Feldübersicht

### Von Klasse geerbte Felder org.eclipse.net4j.util.lifecycle.Lifecycle

`USE_LABEL`

## Konstruktorübersicht

Konstruktoren
Konstruktor
Beschreibung
`Channel()`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`void`
`close()`
`protected Channel.ReceiverWork`
`createReceiverWork(IBuffer buffer)`
Veraltet.
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()` .
`org.eclipse.net4j.util.container.IManagedContainer`
`getContainer()`
`ExecutorService`
`getExecutorService()`
`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()`
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.
`final long`
`getReceivedBytes()`
Returns the number of bytes that are received from the `multiplexer` of this channel and are passed on to the `receive handler` of this channel.
`ExecutorService`
`getReceiveExecutor()`
Veraltet.
`IBufferHandler`
`getReceiveHandler()`
Returns the `IBufferHandler` that handles buffers received from the peer channel.
`Queue<IBuffer>`
`getSendQueue()`
`long`
`getSentBuffers()`
Returns the number of `buffers` that are sent to the `multiplexer` of this channel.
`final long`
`getSentBytes()`
Returns the number of bytes that are sent to the `multiplexer` of this channel.
`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 ``ILocationAware.getLocation()` == `ILocationAware.Location.CLIENT``.
`boolean`
`isClosed()`
`boolean`
`isServer()`
Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.SERVER``.
`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)`
Veraltet.
`void`
`setReceiveHandler(IBufferHandler receiveHandler)`
Sets the `IBufferHandler` to handle buffers received from the peer channel.
`void`
`setUserID(String userID)`
`String`
`toString()`
`protected void`
`unregisterFromMultiplexer()`

### Von Klasse geerbte Methoden org.eclipse.net4j.util.lifecycle.Lifecycle

`activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation`

### Von Klasse geerbte Methoden org.eclipse.net4j.util.event.Notifier

`addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener`

### Von Klasse geerbte Methoden java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Von Schnittstelle geerbte Methoden org.eclipse.net4j.util.lifecycle.ILifecycle

`activate, deactivate, getLifecycleState, isActive`

### Von Schnittstelle geerbte Methoden org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Konstruktordetails

### Channel

public Channel()

## Methodendetails

### getContainer

public org.eclipse.net4j.util.container.IManagedContainer getContainer()

Angegeben von:
  `getContainer` in Schnittstelle `org.eclipse.net4j.util.container.IManagedContainerProvider`

### getUserID

public String getUserID()

Angegeben von:
  `getUserID` in Schnittstelle `org.eclipse.net4j.util.security.IUserAware`

### setUserID

public void setUserID(String userID)

Angegeben von:
  `setUserID` in Schnittstelle `InternalChannel`

### getLocation

public ILocationAware.Location getLocation()
Beschreibung aus Schnittstelle kopiert: `ILocationAware`
Returns the location of this object in a `client`/`server` scenario.

Angegeben von:
  `getLocation` in Schnittstelle `ILocationAware`

### isClient

public boolean isClient()
Beschreibung aus Schnittstelle kopiert: `ILocationAware`
Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.CLIENT``.

Angegeben von:
  `isClient` in Schnittstelle `ILocationAware`

### isServer

public boolean isServer()
Beschreibung aus Schnittstelle kopiert: `ILocationAware`
Same as ``ILocationAware.getLocation()` == `ILocationAware.Location.SERVER``.

Angegeben von:
  `isServer` in Schnittstelle `ILocationAware`

### getMultiplexer

public IChannelMultiplexer getMultiplexer()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns 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.

Angegeben von:
  `getMultiplexer` in Schnittstelle `IChannel`

### setMultiplexer

public void setMultiplexer(IChannelMultiplexer channelMultiplexer)

Angegeben von:
  `setMultiplexer` in Schnittstelle `InternalChannel`

### getID

public short getID()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns the ID of this channel. The ID is unique at any time among all channels of the associated `multiplexer`.

Angegeben von:
  `getID` in Schnittstelle `IChannel`

### setID

public void setID(short id)

Angegeben von:
  `setID` in Schnittstelle `InternalChannel`

### getExecutorService

public ExecutorService getExecutorService()

Angegeben von:
  `getExecutorService` in Schnittstelle `org.eclipse.net4j.util.concurrent.IExecutorServiceProvider`
Seit:
  4.5

### getReceiveExecutor

@Deprecated public ExecutorService getReceiveExecutor()
Veraltet.

Angegeben von:
  `getReceiveExecutor` in Schnittstelle `InternalChannel`

### setReceiveExecutor

@Deprecated public void setReceiveExecutor(ExecutorService receiveExecutor)
Veraltet.

Angegeben von:
  `setReceiveExecutor` in Schnittstelle `InternalChannel`

### getReceiveHandler

public IBufferHandler getReceiveHandler()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns the `IBufferHandler` that handles buffers received from the peer channel.

Angegeben von:
  `getReceiveHandler` in Schnittstelle `IChannel`

### setReceiveHandler

public void setReceiveHandler(IBufferHandler receiveHandler)
Beschreibung aus Schnittstelle kopiert: `IChannel`
Sets the `IBufferHandler` to handle buffers received from the peer channel.

Angegeben von:
  `setReceiveHandler` in Schnittstelle `IChannel`

### getSentBuffers

public long getSentBuffers()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns the number of `buffers` that are sent to the `multiplexer` of this channel.

Angegeben von:
  `getSentBuffers` in Schnittstelle `IChannel`
Seit:
  3.0

### getSentBytes

public final long getSentBytes()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns the number of bytes that are sent to the `multiplexer` of this channel.

Angegeben von:
  `getSentBytes` in Schnittstelle `IChannel`
Seit:
  4.13

### getReceivedBuffers

public long getReceivedBuffers()
Beschreibung aus Schnittstelle kopiert: `IChannel`
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.

Angegeben von:
  `getReceivedBuffers` in Schnittstelle `IChannel`
Seit:
  3.0

### getReceivedBytes

public final long getReceivedBytes()
Beschreibung aus Schnittstelle kopiert: `IChannel`
Returns the number of bytes that are received from the `multiplexer` of this channel and are passed on to the `receive handler` of this channel.

Angegeben von:
  `getReceivedBytes` in Schnittstelle `IChannel`
Seit:
  4.13

### getSendQueue

public Queue<IBuffer> getSendQueue()

Angegeben von:
  `getSendQueue` in Schnittstelle `InternalChannel`

### sendBuffer

public void sendBuffer(IBuffer buffer)
Beschreibung aus Schnittstelle kopiert: `IChannel`
Asynchronously sends the given buffer to the receive handler of the peer channel.

Angegeben von:
  `sendBuffer` in Schnittstelle `IChannel`

### handleBuffer

public 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.

Angegeben von:
  `handleBuffer` in Schnittstelle `IBufferHandler`
Parameter:
  `buffer` - The buffer to be handled.
Siehe auch:
  - `IBuffer.getState()`
  - `BufferState.PUTTING`
  - `sendQueue`

### handleBufferFromMultiplexer

public void handleBufferFromMultiplexer(IBuffer buffer)
Handles a buffer sent by the multiplexer. Adds work to the receive queue or releases the buffer.

Angegeben von:
  `handleBufferFromMultiplexer` in Schnittstelle `InternalChannel`
Siehe auch:
  - `InternalChannelMultiplexer.multiplexChannel(org.eclipse.spi.net4j.InternalChannel)`

### createReceiverWork

@Deprecated protected Channel.ReceiverWork createReceiverWork(IBuffer buffer)
Veraltet.
As of 4.10 scheduled for future removal.

### getBufferCapacity

public short getBufferCapacity()
Beschreibung aus Schnittstelle kopiert: `IBufferProvider`
Returns the capacity of the buffers provided by `IBufferProvider.provideBuffer()` .

Angegeben von:
  `getBufferCapacity` in Schnittstelle `IBufferProvider`

### provideBuffer

public IBuffer provideBuffer()
Beschreibung aus Schnittstelle kopiert: `IBufferProvider`
Provides a buffer from this `BufferProvider`.

Angegeben von:
  `provideBuffer` in Schnittstelle `IBufferProvider`

### retainBuffer

public void retainBuffer(IBuffer buffer)
Beschreibung aus Schnittstelle kopiert: `IBufferProvider`
Retains a buffer to this `BufferProvider`.

Angegeben von:
  `retainBuffer` in Schnittstelle `IBufferProvider`

### toString

public String toString()

Setzt außer Kraft:
  `toString` in Klasse `org.eclipse.net4j.util.lifecycle.Lifecycle`

### doBeforeActivate

protected void doBeforeActivate() throws Exception

Setzt außer Kraft:
  `doBeforeActivate` in Klasse `org.eclipse.net4j.util.lifecycle.Lifecycle`
Löst aus:
  `Exception`

### doActivate

protected void doActivate() throws Exception

Setzt außer Kraft:
  `doActivate` in Klasse `org.eclipse.net4j.util.lifecycle.Lifecycle`
Löst aus:
  `Exception`

### doDeactivate

protected void doDeactivate() throws Exception

Setzt außer Kraft:
  `doDeactivate` in Klasse `org.eclipse.net4j.util.lifecycle.Lifecycle`
Löst aus:
  `Exception`

### unregisterFromMultiplexer

protected void unregisterFromMultiplexer()

### close

public void close()

Angegeben von:
  `close` in Schnittstelle `org.eclipse.net4j.util.collection.Closeable`

### isClosed

public boolean isClosed()

Angegeben von:
  `isClosed` in Schnittstelle `org.eclipse.net4j.util.collection.Closeable`