|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.ThreadSynchronization
org.jppf.server.nio.AbstractChannelWrapper<S>
S - the type of wrapped channel.public abstract class AbstractChannelWrapper<S>
Wraps a communication channel, no matter what the channel is.
| Field Summary | |
|---|---|
protected S |
channel
The channel to wrap. |
protected long |
id
Id of this instance. |
protected ChannelSelector |
selector
The selctor for this channel. |
| Fields inherited from class org.jppf.utils.ThreadSynchronization |
|---|
stopped |
| Constructor Summary | |
|---|---|
AbstractChannelWrapper(S channel)
Initialize this channel wrapper with the specified channel. |
|
| Method Summary | |
|---|---|
void |
close()
Close the channel. |
boolean |
equals(Object obj)
Determine whether an other object is equal to this one. |
S |
getChannel()
Get the channel to wrap. |
abstract NioContext |
getContext()
Get the AbstractNioContext attached to the channel. |
String |
getId()
Get a string uniquely identifying this channel. |
int |
getKeyOps()
Get the operations enabled for this channel. |
abstract int |
getReadyOps()
Get the operations available for this channel. |
ChannelSelector |
getSelector()
Default implementation of this method returns null. |
int |
hashCode()
|
boolean |
isAcceptable()
Determine whether the channel can accept connections. |
boolean |
isConnectable()
Determine whether the channel can be connected. |
boolean |
isOpen()
Determine whether the channel is opened. |
boolean |
isReadable()
Determine whether the channel can be read from. |
boolean |
isWritable()
Determine whether the channel can be written to. |
void |
setKeyOps(int keyOps)
Get the operations enabled for this channel. |
void |
setSelector(ChannelSelector selector)
By default, this method does nothing. |
String |
toString()
|
| Methods inherited from class org.jppf.utils.ThreadSynchronization |
|---|
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final long id
protected S channel
protected ChannelSelector selector
| Constructor Detail |
|---|
public AbstractChannelWrapper(S channel)
channel - the channel to wrap.| Method Detail |
|---|
public S getChannel()
getChannel in interface ChannelWrapper<S>
public void close()
throws Exception
close in interface ChannelWrapper<S>Exception - if any error occurs while closing the channel.ChannelWrapper.close()public abstract NioContext getContext()
AbstractNioContext attached to the channel.
getContext in interface ChannelWrapper<S>AbstractNioContext instance.public boolean isOpen()
isOpen in interface ChannelWrapper<S>public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectobj - the object to compare with.
Object.equals(java.lang.Object)public String toString()
toString in class Objectpublic int getKeyOps()
getKeyOps in interface ChannelWrapper<S>ChannelWrapper.getKeyOps()public void setKeyOps(int keyOps)
setKeyOps in interface ChannelWrapper<S>keyOps - the operations as an int value.ChannelWrapper.setKeyOps(int)public abstract int getReadyOps()
getReadyOps in interface ChannelWrapper<S>public boolean isReadable()
isReadable in interface ChannelWrapper<S>ChannelWrapper.isReadable()public boolean isWritable()
isWritable in interface ChannelWrapper<S>ChannelWrapper.isWritable()public boolean isAcceptable()
isAcceptable in interface ChannelWrapper<S>ChannelWrapper.isAcceptable()public boolean isConnectable()
isConnectable in interface ChannelWrapper<S>ChannelWrapper.isConnectable()public ChannelSelector getSelector()
getSelector in interface ChannelWrapper<S>ChannelWrapper.getSelector()public void setSelector(ChannelSelector selector)
setSelector in interface ChannelWrapper<S>selector - the selector associated with this mechanism.ChannelWrapper.setSelector(org.jppf.server.nio.ChannelSelector)public String getId()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||