|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--amber.server.manager.handler.BaseHandler
This class is a base class extended by the other handler classes. It contains simple support components which are useful to the other handlers.
Core,
HandlerInterface| Field Summary | |
protected AmberInputStream |
dataDecoder
|
protected AmberOutputStream |
dataEncoder
|
protected java.io.ByteArrayOutputStream |
encoderBytes
The data encoding data stream that is used by all components to send information. |
protected Packet |
initPacket
|
protected Log |
loggingFile
Primary logging object. |
protected Core |
mainServer
Handle to the Core server. |
protected java.net.Socket |
socket
Internal data holders set up by the connectToClient function. |
protected int |
type
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
BaseHandler()
|
|
| Method Summary | |
void |
connectToClient(java.net.Socket socket,
Packet initPacket,
AmberInputStream dataDecoder,
int type)
This function handles the connection requirements for the specified incoming connection. |
void |
sendPacket(java.net.Socket socket,
Packet packet)
Sends the specified packet to the defined socket connection. |
void |
setCore(Core core)
This sets the parent Core object. |
void |
setLogger(Log logger)
This sets the primary logging object. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, 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 |
protected Core mainServer
protected java.net.Socket socket
protected Packet initPacket
protected AmberInputStream dataDecoder
protected int type
protected Log loggingFile
protected java.io.ByteArrayOutputStream encoderBytes
protected AmberOutputStream dataEncoder
| Constructor Detail |
public BaseHandler()
| Method Detail |
public void setCore(Core core)
setCore in interface HandlerInterfacecore - Core system.public void setLogger(Log logger)
setLogger in interface HandlerInterfacelogger - Log primary logger.
public void sendPacket(java.net.Socket socket,
Packet packet)
socket - Socket to send the packet to.packet - Packet containing the packet to send.
public void connectToClient(java.net.Socket socket,
Packet initPacket,
AmberInputStream dataDecoder,
int type)
throws java.io.IOException
connectToClient in interface HandlerInterfacesocket - Socket of the incoming connection.initPacket - The Packet which is first sent by the page when the connection is opened.dataDecoder - AmberInputStream with the packet parameters.type - The type of connection that is attempting to match the packet.
This matches the constants in ListenerThread.java.io.IOException - containing decoding errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||