|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.net.IOService<RefObject>
RefObject - is a refrence object stored by this service. This is e reference
to higher level data object keeping more information about the connection.public abstract class IOService<RefObject>
IOService offers 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
Field description |
static java.lang.String |
HOSTNAME_KEY
Field description |
static java.lang.String |
PORT_TYPE_PROP_KEY
Field description |
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()
Method description |
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()
Method description |
tigase.xmpp.JID |
getDataReceiver()
Method description |
long |
getLastTransferTime()
This method returns the time of last transfer in any direction through this service. |
java.lang.String |
getLocalAddress()
Method description |
long[] |
getReadCounters()
Method description |
RefObject |
getRefObject()
Method description |
java.lang.String |
getRemoteAddress()
Method description |
java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> |
getSessionData()
Method description |
java.nio.channels.SocketChannel |
getSocketChannel()
Method getSocketChannel is used to perform |
void |
getStatistics(StatisticsList list)
Method description |
java.lang.String |
getUniqueId()
Method description |
long[] |
getWriteCounters()
Method description |
boolean |
isConnected()
Describe isConnected method here. |
protected abstract void |
processSocketData()
|
abstract void |
processWaitingPackets()
Method description |
protected void |
readCompleted()
|
protected char[] |
readData()
Describe readData method here. |
protected abstract int |
receivedPackets()
|
void |
setDataReceiver(tigase.xmpp.JID address)
Method description |
void |
setIOServiceListener(IOServiceListener<IOService<RefObject>> sl)
Method description |
void |
setRefObject(RefObject refObject)
Method description |
void |
setSessionData(java.util.Map<java.lang.String,java.lang.Object> props)
Method description |
void |
setSSLId(java.lang.String id)
Method description |
void |
startSSL(boolean clientMode)
Method description |
void |
startTLS(boolean clientMode)
Method description |
void |
startZLib(int level)
Method description |
void |
stop()
Describe stop method here. |
java.lang.String |
toString()
Method description |
boolean |
waitingToSend()
Method description |
int |
waitingToSendSize()
Method description |
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, 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 abstract void processWaitingPackets()
throws java.io.IOException
java.io.IOException
protected abstract void processSocketData()
throws java.io.IOException
java.io.IOExceptionprotected abstract int receivedPackets()
public void accept(java.nio.channels.SocketChannel socketChannel)
throws java.io.IOException
accept is used to perform
socketChannel - a SocketChannel value
java.io.IOException
public IOService call()
throws java.io.IOException
run is used to perform
call in interface java.util.concurrent.Callable<IOService>java.io.IOExceptionpublic ConnectionType connectionType()
public void forceStop()
public tigase.xmpp.JID getDataReceiver()
public long getLastTransferTime()
public java.lang.String getLocalAddress()
public long[] getReadCounters()
public RefObject getRefObject()
public java.lang.String getRemoteAddress()
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getSessionData()
public java.nio.channels.SocketChannel getSocketChannel()
getSocketChannel is used to perform
SocketChannel valuepublic void getStatistics(StatisticsList list)
list - public java.lang.String getUniqueId()
public long[] getWriteCounters()
public boolean isConnected()
isConnected method here.
boolean valuepublic void setDataReceiver(tigase.xmpp.JID address)
address - public void setIOServiceListener(IOServiceListener<IOService<RefObject>> sl)
sl - public void setRefObject(RefObject refObject)
refObject - public void setSSLId(java.lang.String id)
id - public void setSessionData(java.util.Map<java.lang.String,java.lang.Object> props)
props -
public void startSSL(boolean clientMode)
throws java.io.IOException
clientMode -
java.io.IOException
public void startTLS(boolean clientMode)
throws java.io.IOException
clientMode -
java.io.IOExceptionpublic void startZLib(int level)
level - public void stop()
stop method here.
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean waitingToSend()
public int waitingToSendSize()
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 valueprotected void readCompleted()
protected char[] readData()
throws java.io.IOException
readData method here.
char[] value
java.io.IOException - if an error occursprotected void writeData(java.lang.String data)
writeData method here.
data - a String value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||