|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
common.AbstractThread
public abstract class AbstractThread
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected java.lang.String |
player
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AbstractThread(java.net.Socket connection,
int initNum)
This constructor initializes the server thread by setting up all Object I/O to be used to communicate back and forth with a client. |
|
| Method Summary | |
|---|---|
void |
destroyThread()
Kills this thread. |
abstract void |
disconnect()
An abstract disconnect method to be filled in by the concrete server or client thread. |
int |
getID()
Gets the ID of the client connected to this thread. |
java.lang.String |
getPlayerName()
Returns the String representation of the Player associated with this thread. |
boolean |
isConnected()
Returns whether or not this thread has an active connection. |
abstract void |
passData(NetworkObject incoming)
An abstract passData method to be filled in by the concrete server or client thread. |
void |
run()
Receives incoming NetworkObjects, determines if connection still exists. |
void |
send(NetworkObject outgoing)
Sends a NetworkObject message to the client connected to this thread. |
void |
setID(int id)
Sets the ID of the client connected by this thread to the specified ID. |
void |
setPlayerName(java.lang.String p)
Sets the String representation of the Player associated with this thread. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 java.lang.String player
| Constructor Detail |
|---|
public AbstractThread(java.net.Socket connection,
int initNum)
connection - - socket that is connected to a clientinitNum - - the player number of the client that will be communicated with by this thread| Method Detail |
|---|
public void send(NetworkObject outgoing)
outgoing - The Network Object to be written to the ObjectOutputStream.public void setID(int id)
id - The id number to set to this client.public int getID()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void destroyThread()
public void setPlayerName(java.lang.String p)
p - String representing the Player associated with this thread.public java.lang.String getPlayerName()
public boolean isConnected()
public abstract void disconnect()
public abstract void passData(NetworkObject incoming)
incoming - The NetworkObject received.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||