org.jppf.server.nio
Class AbstractNioContext<S extends Enum<S>>

java.lang.Object
  extended by org.jppf.server.nio.AbstractNioContext<S>
Type Parameters:
S - the type of states associated with this context.
All Implemented Interfaces:
NioContext<S>
Direct Known Subclasses:
AbstractNodeContext, SimpleNioContext

public abstract class AbstractNioContext<S extends Enum<S>>
extends Object
implements NioContext<S>

Context associated with an open communication channel.

Author:
Laurent Cohen

Field Summary
protected  String connectionUuid
          Unique ID for the corresponding connection on the remote peer.
protected  NioMessage message
          Container for the current message data.
 int readByteCount
          Count of bytes read.
protected  S state
          The current state of the channel this context is associated with.
protected  String uuid
          Uuid for this context.
 int writeByteCount
          Count of bytes written.
 
Constructor Summary
AbstractNioContext()
           
 
Method Summary
 ChannelWrapper<?> getChannel()
          Get the associated channel.
 String getConnectionUuid()
          Get the nique ID for the corresponding connection on the remote peer.
 NioMessage getMessage()
          Get the container for the current message data.
protected  String getShortClassName()
          Give the non qualified name of the class of this instance.
 S getState()
          Get the current state of the channel this context is associated with.
 String getUuid()
          Get the uuid for this node context.
 void setChannel(ChannelWrapper<?> channel)
          Set the associated channel.
 void setConnectionUuid(String connectionUuid)
          Set the nique ID for the corresponding connection on the remote peer.
 void setMessage(NioMessage message)
          Set the container for the current message data.
 void setState(S state)
          Set the current state of the channel this context is associated with.
 void setUuid(String uuid)
          Set the uuid for this node context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.server.nio.NioContext
handleException, readMessage, writeMessage
 

Field Detail

state

protected S extends Enum<S> state
The current state of the channel this context is associated with.


uuid

protected String uuid
Uuid for this context.


connectionUuid

protected String connectionUuid
Unique ID for the corresponding connection on the remote peer.


message

protected NioMessage message
Container for the current message data.


readByteCount

public int readByteCount
Count of bytes read.


writeByteCount

public int writeByteCount
Count of bytes written.

Constructor Detail

AbstractNioContext

public AbstractNioContext()
Method Detail

getState

public S getState()
Get the current state of the channel this context is associated with.

Specified by:
getState in interface NioContext<S extends Enum<S>>
Returns:
a state enum value.

setState

public void setState(S state)
Set the current state of the channel this context is associated with.

Specified by:
setState in interface NioContext<S extends Enum<S>>
Parameters:
state - a state enum value.

getUuid

public String getUuid()
Get the uuid for this node context.

Specified by:
getUuid in interface NioContext<S extends Enum<S>>
Returns:
the uuid as a string.

setUuid

public void setUuid(String uuid)
Set the uuid for this node context.

Specified by:
setUuid in interface NioContext<S extends Enum<S>>
Parameters:
uuid - the uuid as a string.

getShortClassName

protected String getShortClassName()
Give the non qualified name of the class of this instance.

Returns:
a class name as a string.

getMessage

public NioMessage getMessage()
Get the container for the current message data.

Returns:
an NioMessage instance.

setMessage

public void setMessage(NioMessage message)
Set the container for the current message data.

Parameters:
message - an NioMessage instance.

getChannel

public ChannelWrapper<?> getChannel()
Get the associated channel.

Specified by:
getChannel in interface NioContext<S extends Enum<S>>
Returns:
a ChannelWrapper instance.

setChannel

public void setChannel(ChannelWrapper<?> channel)
Set the associated channel.

Specified by:
setChannel in interface NioContext<S extends Enum<S>>
Parameters:
channel - a ChannelWrapper instance.

getConnectionUuid

public String getConnectionUuid()
Get the nique ID for the corresponding connection on the remote peer.

Returns:
the id as a string.

setConnectionUuid

public void setConnectionUuid(String connectionUuid)
Set the nique ID for the corresponding connection on the remote peer.

Parameters:
connectionUuid - the id as a string.


Copyright © 2005-2010 JPPF Team.