|
QuickServer v1.4.6 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.quickserver.net.server.impl.BasicClientHandler
org.quickserver.net.server.impl.BlockingClientHandler
Field Summary |
Fields inherited from class org.quickserver.net.server.impl.BasicClientHandler |
appLogger, authenticator, authorised, b_in, b_out, bufferedReader, charset, clientAuthenticationHandler, clientBinaryHandler, clientCommandHandler, clientConnectedTime, clientData, clientEventHandler, clientEvents, clientExtendedEventHandler, clientObjectHandler, closeOrLostNotified, communicationLogging, connection, counAuthTry, dataModeIN, dataModeOUT, in, lastCommunicationTime, lockObj, lost, maxAuthTry, maxAuthTryMsg, maxConnectionMsg, NEW_LINE, NEW_LINE_BYTES, o_in, o_out, out, quickServer, secure, socket, socketTimeout, threadEvent, timeoutMsg, unprocessedClientEvents, willClean |
Constructor Summary | |
BlockingClientHandler()
|
|
BlockingClientHandler(int instanceCount)
|
Method Summary | |
protected boolean |
checkReturnClientHandler()
|
void |
clean()
|
void |
closeConnection()
Closes client socket associated. |
protected void |
finalize()
|
java.io.BufferedReader |
getBufferedReader()
Returns the BufferedReader associated with
the Client being handled. |
java.nio.channels.SelectionKey |
getSelectionKey()
Returns client SelectionKey associated, if any. |
java.nio.channels.SocketChannel |
getSocketChannel()
Returns client socket channel associated, if any. |
void |
handleClient(TheClient theClient)
Associates the ClientHanlder with the client encapsulated by theClient . |
protected byte[] |
readInputStream()
Read the byte input. |
void |
registerForRead()
Register OP_READ with the SelectionKey associated with the channel. |
void |
registerForWrite()
Register OP_WRITE with the SelectionKey associated with the channel. |
protected void |
returnClientHandler()
|
void |
run()
|
protected void |
setClientWriteHandler(ClientWriteHandler handler)
Sets the ClientWriteHandler class that interacts with client sockets. |
void |
setDataMode(DataMode dataMode,
DataType dataType)
Sets the DataMode for the ClientHandler
Note: When mode is DataMode.OBJECT and type is DataType.IN
this call will block until the client ObjectOutputStream has
written and flushes the header. |
protected void |
setInputStream(java.io.InputStream in)
Sets the InputStream associated with
the Client being handled. |
void |
setSelectionKey(java.nio.channels.SelectionKey selectionKey)
Sets client SelectionKey associated, if any. |
void |
setSocketChannel(java.nio.channels.SocketChannel socketChannel)
Sets client socket channel associated, if any. |
void |
updateInputOutputStreams()
Updates the InputStream and OutputStream for the ClientHandler for the set Socket. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BlockingClientHandler(int instanceCount)
public BlockingClientHandler()
Method Detail |
public void clean()
clean
in interface ClientHandler
clean
in class BasicClientHandler
protected void finalize() throws java.lang.Throwable
finalize
in class BasicClientHandler
java.lang.Throwable
public void handleClient(TheClient theClient)
BasicClientHandler
theClient
.
handleClient
in interface ClientHandler
handleClient
in class BasicClientHandler
theClient
- object that encapsulates client socket
and its configuration details.protected void setInputStream(java.io.InputStream in) throws java.io.IOException
BasicClientHandler
InputStream
associated with
the Client being handled.
setInputStream
in class BasicClientHandler
java.io.IOException
BasicClientHandler.getInputStream()
public java.io.BufferedReader getBufferedReader()
BasicClientHandler
BufferedReader
associated with
the Client being handled. Note that this is only available under blocking mode.
getBufferedReader
in interface ClientHandler
getBufferedReader
in class BasicClientHandler
BasicClientHandler.getBufferedWriter()
public void closeConnection()
BasicClientHandler
closeConnection
in interface ClientHandler
closeConnection
in class BasicClientHandler
public void run()
run
in interface ClientHandler
run
in class BasicClientHandler
protected boolean checkReturnClientHandler()
protected void returnClientHandler()
returnClientHandler
in class BasicClientHandler
public void setDataMode(DataMode dataMode, DataType dataType) throws java.io.IOException
BasicClientHandler
DataMode
for the ClientHandler
Note: When mode is DataMode.OBJECT and type is DataType.IN
this call will block until the client ObjectOutputStream has
written and flushes the header.
setDataMode
in interface ClientHandler
setDataMode
in class BasicClientHandler
dataMode
- mode of data exchange - String or Object.dataType
- type of data for which mode has to be set.
java.io.IOException
- if mode could not be changed.protected byte[] readInputStream() throws java.io.IOException
BasicClientHandler
readInputStream
in class BasicClientHandler
java.io.IOException
public void updateInputOutputStreams() throws java.io.IOException
BasicClientHandler
updateInputOutputStreams
in interface ClientHandler
updateInputOutputStreams
in class BasicClientHandler
java.io.IOException
BasicClientHandler.setSocket(java.net.Socket)
public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
BasicClientHandler
setSocketChannel
in interface ClientHandler
setSocketChannel
in class BasicClientHandler
public java.nio.channels.SocketChannel getSocketChannel()
BasicClientHandler
getSocketChannel
in interface ClientHandler
getSocketChannel
in class BasicClientHandler
public void setSelectionKey(java.nio.channels.SelectionKey selectionKey)
BasicClientHandler
setSelectionKey
in interface ClientHandler
setSelectionKey
in class BasicClientHandler
public java.nio.channels.SelectionKey getSelectionKey()
BasicClientHandler
getSelectionKey
in interface ClientHandler
getSelectionKey
in class BasicClientHandler
public void registerForRead() throws java.io.IOException, java.nio.channels.ClosedChannelException
BasicClientHandler
registerForRead
in interface ClientHandler
registerForRead
in class BasicClientHandler
java.io.IOException
java.nio.channels.ClosedChannelException
public void registerForWrite() throws java.io.IOException, java.nio.channels.ClosedChannelException
BasicClientHandler
registerForWrite
in interface ClientHandler
registerForWrite
in class BasicClientHandler
java.io.IOException
java.nio.channels.ClosedChannelException
protected void setClientWriteHandler(ClientWriteHandler handler)
BasicClientHandler
setClientWriteHandler
in class BasicClientHandler
handler
- fully qualified name of the class that
implements ClientWriteHandler
|
QuickServer v1.4.6 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |