server
Class ServerThread

java.lang.Object
  extended by java.lang.Thread
      extended by common.AbstractThread
          extended by server.ServerThread
All Implemented Interfaces:
java.lang.Runnable

public class ServerThread
extends AbstractThread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int IDLE
          ServerThread is in the idle list.
 
Fields inherited from class common.AbstractThread
player
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ServerThread(java.net.Socket s, int i)
          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 disconnect()
          In the event of a disconnected player, takes appropriate action.
 int getPlayerNum()
          Returns the player's number at the table.
 void passData(NetworkObject n)
          Sends an incoming NetworkObject from the ServerThread to the Server.
 void setPlayerNum(int p)
          Set's the player's number at the table.
 
Methods inherited from class common.AbstractThread
destroyThread, getID, getPlayerName, isConnected, run, send, setID, setPlayerName
 
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

IDLE

public static final int IDLE
ServerThread is in the idle list.

See Also:
Constant Field Values
Constructor Detail

ServerThread

public ServerThread(java.net.Socket s,
                    int i)
Initializes the server thread by setting up all Object I/O to be used to communicate back and forth with a client.

Parameters:
s - socket that is connected to a client
i - the player number of the client that will be communicated with by this thread
Method Detail

setPlayerNum

public void setPlayerNum(int p)
Set's the player's number at the table.

Parameters:
p - int

getPlayerNum

public int getPlayerNum()
Returns the player's number at the table.

Returns:
int

disconnect

public void disconnect()
In the event of a disconnected player, takes appropriate action.

Specified by:
disconnect in class AbstractThread

passData

public void passData(NetworkObject n)
Sends an incoming NetworkObject from the ServerThread to the Server.

Specified by:
passData in class AbstractThread
Parameters:
n - NetworkObject that needs to be passed to the appropriate method in the Server.