|
||||||||||
| 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.connection.LoginManager
Thread to deal with the initial reception of login packets. This object instantiates N Login threads to handle incoming connection requests. This thread reads added connection requests and passes them to the Login thread which is least loaded. The number of threads instantiated is specified by the primary server in the LoginThreadNumber property.
ConnectionManager,
ListenerThread,
LoginThread,
PropertyTags| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
LoginManager(ConnectionManager parent,
int type)
Construct the thread, with it's parent class so it may pass back messages. |
|
| Method Summary | |
void |
addConnection(java.net.Socket socket,
int type)
This function adds a new socket connection to the thread for processing. |
protected void |
createLoginThreads()
This function creates the number of login threads as specified in the properties handler. |
protected LoginThread |
getLightestLogin()
This function returns the lightest loaded login thread. |
int |
getType()
Returns the type of listener this is. |
void |
run()
Main implementation function. |
protected void |
sendToLogin(java.net.Socket socket)
This function checks the login threads to determine the lightest loaded and adds the incoming connection to the thread. |
void |
setType(int type)
Sets the type of listener this is. |
| 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 |
| Constructor Detail |
public LoginManager(ConnectionManager parent,
int type)
parent - ConnectionManager parent object.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.| Method Detail |
protected void createLoginThreads()
public void addConnection(java.net.Socket socket,
int type)
addConnection in interface ConnectionReceiversocket - Socket which is the incoming connection.type - int defining the type of connection received. This value
corresponds to the constants defined in Listener.Listenerpublic void run()
run in class java.lang.Threadprotected void sendToLogin(java.net.Socket socket)
socket - the incoming connection to pass on.protected LoginThread getLightestLogin()
public void setType(int type)
type - int type of listener. This must match the type constants
specified in the ListenerThread class.public int getType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||