|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--amber.server.manager.connection.ConnectionManager
Management class which looks after the requirements of incoming connections. Connections come into the listener threads and are assigned to the respective managers for processing.
Core| Field Summary | |
protected AmberInputStream |
dataDecoder
The data decoding data stream that is used by all components to send information. |
protected AmberOutputStream |
dataEncoder
|
protected java.io.ByteArrayOutputStream |
encoderBytes
The data encoding data stream that is used by all components to send information. |
| Constructor Summary | |
ConnectionManager(Core parentServer,
int port,
DatabaseManager manager,
ConnectionPool connectionPool,
PropertiesHandler properties,
Log logFile)
Initialising constructor for this manager. |
|
| Method Summary | |
protected AmberInputStream |
createDataInput(Packet packet)
This function creates a data input stream from the data in the packet. |
protected void |
createListenerThreads()
This function starts the socket listener threads. |
ConnectionPool |
getConnectionPool()
Returns the current connection pool for the amber server. |
DatabaseManager |
getDatabaseManager()
Returns the current database manager. |
protected AmberInputStream |
getDataInput()
This function returns the current data input stream. |
Log |
getLogger()
This function returns the logging object. |
Core |
getParentServer()
Returns the parent server object for this manager. |
PropertiesHandler |
getProperties()
This function returns the properties handler. |
void |
handleNewConnection(java.net.Socket socket,
Packet initPacket,
int type)
This function matches the incomimg packet to the corresponding page handler in the pendingPages variable. |
boolean |
isDatabaseAvailable()
This function returns whether the database is available for use. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected AmberInputStream dataDecoder
protected java.io.ByteArrayOutputStream encoderBytes
protected AmberOutputStream dataEncoder
| Constructor Detail |
public ConnectionManager(Core parentServer,
int port,
DatabaseManager manager,
ConnectionPool connectionPool,
PropertiesHandler properties,
Log logFile)
| Method Detail |
public void handleNewConnection(java.net.Socket socket,
Packet initPacket,
int type)
throws java.io.IOException,
ApplicationException
socket - Socket of the incoming connection.initPacket - The Packet which is first sent by the page when the connection is opened.type - The type of connection that is attempting to match the packet.
This matches the constants in ListenerThread.java.io.IOException - containing decoding errors.ApplicationException - containing application errors.public boolean isDatabaseAvailable()
public DatabaseManager getDatabaseManager()
public ConnectionPool getConnectionPool()
public Core getParentServer()
public Log getLogger()
public PropertiesHandler getProperties()
protected AmberInputStream createDataInput(Packet packet)
packet - Packet containing the data to decode.protected AmberInputStream getDataInput()
protected void createListenerThreads()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||