|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
ChannelFactoryNioBuffer
public class ChannelFactoryNioBuffer
ChannelFactoryNioBuffer. Channel factory using java.nio and no Thread. Deliveres ObjectChannels based on nio ByteBuffers. Usage: ChannelFactoryNioBuffer(port).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
(package private) int |
capacity
Capacity for ByteBuffer. |
static int |
DEFAULT_PORT
default port of socket. |
private int |
port
port of socket. |
private java.nio.channels.Selector |
selector
local selector. |
private java.nio.channels.ServerSocketChannel |
server
local server socket channel. |
private java.nio.channels.SelectionKey |
serverkey
local server key. |
static int |
WAIT_TIME
wait time 500ms. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ChannelFactoryNioBuffer()
Constructs a ChannelFactory using Nio and ByteBuffer. |
|
ChannelFactoryNioBuffer(int p)
Constructs a ChannelFactory using Nio and ByteBuffer. |
|
ChannelFactoryNioBuffer(int p,
int cap)
Constructs a ChannelFactory using Nio and ByteBuffer. |
Method Summary | |
---|---|
void |
close()
Close the Channel Factory. |
ObjectBufferChannel |
getChannel()
Get a new socket channel from a server socket. |
ObjectBufferChannel |
getChannel(java.lang.String h,
int p)
Get a new socket channel to a given host. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
public static final int WAIT_TIME
private final int port
final int capacity
private java.nio.channels.Selector selector
private java.nio.channels.SelectionKey serverkey
private java.nio.channels.ServerSocketChannel server
Constructor Detail |
---|
public ChannelFactoryNioBuffer(int p, int cap)
p
- port.cap
- capacity of ByteBuffer.public ChannelFactoryNioBuffer()
public ChannelFactoryNioBuffer(int p)
p
- port.Method Detail |
---|
public ObjectBufferChannel getChannel() throws java.io.IOException
java.io.IOException
public ObjectBufferChannel getChannel(java.lang.String h, int p) throws java.io.IOException
h
- hostname.p
- port.
java.io.IOException
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |