|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.net.IOService
public abstract class IOService
IOService offers thread thread safe
call() method execution, however you must be prepared that other
methods can be called simultanously like stop(),
getProtocol() or isConnected().
It is recomended that developers extend AbsractServerService
rather then implement ServerService interface directly.
If you directly implement ServerService interface you must
take care about SocketChannel I/O, queueing tasks, processing
results and thread safe execution of call() method. If you
however extend IOService class all this basic
operation are implemented and you have only to take care about parsing data
received from network socket. Parsing data is expected to be implemented in
parseData(char[] data) method.
Created: Tue Sep 28 23:00:34 2004
| Field Summary | |
|---|---|
long |
empty_read_call_count
|
static java.lang.String |
HOSTNAME_KEY
|
static java.lang.String |
PORT_TYPE_PROP_KEY
|
static java.lang.String |
SESSION_ID_KEY
This is key used to store session ID in temporary session data storage. |
| Constructor Summary | |
|---|---|
IOService()
|
|
| Method Summary | |
|---|---|
void |
accept(java.nio.channels.SocketChannel socketChannel)
Method accept is used to perform |
IOService |
call()
Method run is used to perform |
ConnectionType |
connectionType()
|
protected boolean |
debug(char[] msg)
Describe debug method here. |
protected boolean |
debug(java.lang.String msg,
java.lang.String prefix)
Describe debug method here. |
void |
forceStop()
|
java.lang.String |
getDataReceiver()
|
long |
getLastTransferTime()
This method returns the time of last transfer in any direction through this service. |
java.lang.String |
getLocalAddress()
|
long[] |
getReadCounters()
|
java.lang.String |
getRemoteAddress()
|
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> |
getSessionData()
|
java.nio.channels.SocketChannel |
getSocketChannel()
Method getSocketChannel is used to perform |
void |
getStatistics(StatisticsList list)
|
java.lang.String |
getUniqueId()
|
long[] |
getWriteCounters()
|
boolean |
isConnected()
Describe isConnected method here. |
protected abstract void |
processSocketData()
|
abstract void |
processWaitingPackets()
|
protected void |
readCompleted()
|
protected char[] |
readData()
Describe readData method here. |
protected abstract int |
receivedPackets()
|
void |
setDataReceiver(java.lang.String address)
|
void |
setIOServiceListener(IOServiceListener sl)
|
void |
setSessionData(java.util.Map<java.lang.String,java.lang.Object> props)
|
void |
setSSLId(java.lang.String id)
|
void |
startSSL(boolean clientMode)
|
void |
startTLS(boolean clientMode)
|
void |
startZLib(int level)
|
void |
stop()
Describe stop method here. |
boolean |
waitingToSend()
|
int |
waitingToSendSize()
|
protected void |
writeData(java.lang.String data)
Describe writeData method here. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SESSION_ID_KEY
public static final java.lang.String PORT_TYPE_PROP_KEY
public static final java.lang.String HOSTNAME_KEY
public long empty_read_call_count
| Constructor Detail |
|---|
public IOService()
| Method Detail |
|---|
public long[] getReadCounters()
public long[] getWriteCounters()
public void setDataReceiver(java.lang.String address)
public java.lang.String getDataReceiver()
public void setSSLId(java.lang.String id)
public long getLastTransferTime()
public void startSSL(boolean clientMode)
throws java.io.IOException
java.io.IOException
public void startTLS(boolean clientMode)
throws java.io.IOException
java.io.IOExceptionpublic void startZLib(int level)
public void setIOServiceListener(IOServiceListener sl)
public java.lang.String getUniqueId()
public ConnectionType connectionType()
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getSessionData()
public void setSessionData(java.util.Map<java.lang.String,java.lang.Object> props)
public boolean isConnected()
isConnected method here.
boolean valuepublic java.lang.String getRemoteAddress()
public java.lang.String getLocalAddress()
public void accept(java.nio.channels.SocketChannel socketChannel)
throws java.io.IOException
accept is used to perform
socketChannel - a SocketChannel value
java.io.IOExceptionpublic java.nio.channels.SocketChannel getSocketChannel()
getSocketChannel is used to perform
SocketChannel valuepublic void stop()
stop method here.
java.io.IOException - if an error occurspublic void forceStop()
public IOService call()
throws java.io.IOException
run is used to perform
call in interface java.util.concurrent.Callable<IOService>java.io.IOException
public abstract void processWaitingPackets()
throws java.io.IOException
java.io.IOException
protected abstract void processSocketData()
throws java.io.IOException
java.io.IOExceptionprotected abstract int receivedPackets()
protected void readCompleted()
protected char[] readData()
throws java.io.IOException
readData method here.
char[] value
java.io.IOException - if an error occurspublic boolean waitingToSend()
public int waitingToSendSize()
protected void writeData(java.lang.String data)
writeData method here.
data - a String valuepublic void getStatistics(StatisticsList list)
protected boolean debug(char[] msg)
debug method here.
msg - a char[] value
boolean value
protected boolean debug(java.lang.String msg,
java.lang.String prefix)
debug method here.
msg - a String value
boolean value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||