|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--amber.server.Listener
Thread to deal with the incoming connections of login packets. This thread waits for incomimg connections and adds them to the receiver for processing.
ConnectionManager,
LoginThread| Field Summary | |
static int |
AdministrationConnection
|
static java.lang.String[] |
connectionNames
String array containing strings which match the connection values. |
static int |
DefaultNumberPendingConnections
The default number of pending connections the listener will accept. |
protected java.net.ServerSocket |
listener
Primary Server Socket which waits for incoming connections. |
protected Log |
loggingFile
The logging system to use for error messages. |
static int |
NormalConnection
This constant defines one category of incoming connections. |
protected int |
numberPendingConnections
This contains the number of pending connections that the listener will accept. |
protected boolean |
operating
Internal flag which indicates whether the thread is operating. |
protected int |
portNumber
The port number to listen on. |
protected ConnectionReceiver |
receiver
The thread concerned with handling incoming socket connections. |
static int |
SecureConnection
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
Listener(ConnectionReceiver receiver,
int portNumber,
Log loggingFile,
java.lang.String threadName,
int type)
Construct the thread, with it's parent class so it may pass back messages. |
|
Listener(ConnectionReceiver receiver,
int portNumber,
Log loggingFile,
java.lang.String threadName,
int type,
int pendingAllowed)
Construct the thread, with it's parent class so it may pass back messages. |
|
| Method Summary | |
int |
getType()
Returns the type of listener this is. |
static java.lang.String |
getTypeString(int type)
Returns a string corresponding to the type value. |
void |
run()
|
void |
setType(int type)
Sets the type of listener this is. |
void |
terminate()
This function causes the flag to be set terminating this thread. |
| 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 |
public static final int NormalConnection
public static final int SecureConnection
public static final int AdministrationConnection
public static final int DefaultNumberPendingConnections
public static final java.lang.String[] connectionNames
protected boolean operating
protected ConnectionReceiver receiver
protected int portNumber
protected Log loggingFile
protected java.net.ServerSocket listener
protected int numberPendingConnections
| Constructor Detail |
public Listener(ConnectionReceiver receiver,
int portNumber,
Log loggingFile,
java.lang.String threadName,
int type)
throws ManagerException
receiver - ConnectionReceiver which will get the new connection.portNumber - int containing the port number to listen on.loggingFile - Log object to log messages on.threadName - String containing the name of this thread.type - int containing the type of listener this is. This matches
the constants in this class.certificate - RSAKey containing the encryption certificate. This
is required for secure connections.ManagerException - should there be an
error initialising the thread.
public Listener(ConnectionReceiver receiver,
int portNumber,
Log loggingFile,
java.lang.String threadName,
int type,
int pendingAllowed)
throws ManagerException
receiver - ConnectionReceiver which will get the new connection.portNumber - int containing the port number to listen on.loggingFile - Log object to log messages on.threadName - String containing the name of this thread.type - int containing the type of listener this is. This matches
the constants in this class.certificate - RSAKey containing the encryption certificate. This
is required for secure connections.pendingAllowed - int number of pending connections the listener will allow before
refusing connections.ManagerException - should there be an
error initialising the thread.| Method Detail |
public void terminate()
public void run()
run in class java.lang.Threadpublic void setType(int type)
type - int type of listener. This must match the type constants
specified in this class.public int getType()
public static java.lang.String getTypeString(int type)
type - int type of listener. This must match the type constants
specified in this class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||