|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.jogre.common.AbstractConnectionThread | +--org.jogre.client.ClientConnectionThread
Client connection which is spawned from the client machine and receives/ sends communication to/from the server. This class also holds a mirrored copy of the TableList and UserList objects which are stored on the JogreServer.
The communication between this connection thread and the GUI (e.g. an implementation of the JogreClientFrame) must goes through an interface IClient to ensure maximum abstraction.
Field Summary | |
protected IClient |
clientInterface
Interface betweem this thread and the Frame |
protected TableList |
tableList
TableList object which should mirror that on the JogreServer. |
protected UserList |
userList
UserList object which should mirror that on the JogreServer. |
Fields inherited from class org.jogre.common.AbstractConnectionThread |
in, loop, out, socket, username |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
protected |
ClientConnectionThread(Socket connection,
String username,
IClient clientInterface)
Default constructor which takes a Socket connection to the server, a username and an IClient which sits between this class and the GUI. |
Method Summary | |
void |
cleanup()
Client has exitted so clean everything up. |
protected void |
disconnect()
Stop the thread. |
TableList |
getTableList()
Return the table list object (should be the same as the server table list). |
UserList |
getUserList()
Return the user list (should be the same as the server user list object). |
void |
parse(String messageType,
String inString)
Parse method which reads the first token of the message and calls the appropriate method. |
protected void |
receiveTableMessage(String inString)
Receive table message. |
protected void |
recieveConnect(String inString)
Inform client about the connection. |
protected void |
recieveGameOver(String inString)
|
protected void |
recieveInvite(String inString)
Receive invite from the user. |
protected void |
recieveMessageBroadcast(String inString)
Receive message broad from the server. |
protected void |
recieveMessageBroadCastRoom(String inString)
Recieve a message broadcast to room. |
protected void |
recieveMessagePrivate(String inString)
Receive a private message. |
protected void |
recieveTable(String inString)
Recieve a single table from the server. |
protected void |
recieveTableList(String inString)
Receive table list from the server. |
protected void |
recieveUserList(String inString)
|
void |
setTableList(TableList tableList)
Update the table list. |
void |
setUserList(UserList userList)
Update the user list. |
Methods inherited from class org.jogre.common.AbstractConnectionThread |
getReader, getSocket, getUsername, run, send, send |
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, 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 IClient clientInterface
protected UserList userList
protected TableList tableList
Constructor Detail |
protected ClientConnectionThread(Socket connection, String username, IClient clientInterface)
connection
- Socket connection to server.username
- UsernameclientInterface
- Interface between this class and GUI.Method Detail |
public void parse(String messageType, String inString)
parse
in class AbstractConnectionThread
AbstractConnectionThread.parse(java.lang.String, java.lang.String)
public UserList getUserList()
public void setUserList(UserList userList)
userList
- public TableList getTableList()
public void setTableList(TableList tableList)
tableList
- protected void disconnect()
public void cleanup()
cleanup
in class AbstractConnectionThread
AbstractConnectionThread.cleanup()
protected void recieveConnect(String inString) throws TransmissionException
inString
- Unparsed String.TransmissionException
- Thrown if there is a transmission error.protected void recieveInvite(String inString) throws TransmissionException
inString
- Unparsed String.TransmissionException
- Thrown if there is a transmission error.protected void recieveGameOver(String inString) throws TransmissionException
protected void recieveUserList(String inString) throws TransmissionException
inString
- TransmissionException
- protected void recieveTableList(String inString) throws TransmissionException
inString
- TransmissionException
- protected void recieveTable(String inString) throws TransmissionException
inString
- TransmissionException
- protected void recieveMessageBroadcast(String inString) throws TransmissionException
inString
- TransmissionException
- protected void recieveMessagePrivate(String inString) throws TransmissionException
inString
- TransmissionException
- protected void receiveTableMessage(String inString) throws TransmissionException
inString
- TransmissionException
- Thrown if there is a transmission error.protected void recieveMessageBroadCastRoom(String inString) throws TransmissionException
inString
- TransmissionException
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |