|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--amber.server.manager.application.ApplicationController
This class is responsible for managing new application connections to the server. The class can have multiple different profiles of connections which reflect the type of connection ie. normal, secure, administration. The Core manager instantiates one controller for each type of connection and passes the connection information to the correct controller.
Core,
ApplicationManager| Field Summary | |
long |
MaxInactiveInterval
The amount of time which an application can be held inactive before final termination. |
long |
TimerInterval
The timer interval for this controller. |
| Constructor Summary | |
ApplicationController(ApplicationManager parentServer,
int type,
DatabaseManager manager,
ConnectionPool connectionPool,
java.lang.String tableName,
PropertiesHandler properties,
Log logFile)
Main constructor for the application controller. |
|
| Method Summary | |
void |
addActiveConnection(ServerConnectionInfo handler)
This function adds the input ServerConnectionInfo into the list of active connections. |
void |
addApplicationHandler(ServerConnectionInfo handler)
This function adds the specified ServerConnectionInfo to the manager. |
void |
addToCache(ServerConnectionInfo info)
This function adds the ServerConnection information to the cache. |
ServerConnectionInfo |
checkLicense(int pageId,
int pageSubId)
Checks license conditions. |
protected ServerConnectionInfo |
createConnectionFromCache(int pageId,
int pageSubId)
Checks the system available handlers to determine if there is a matching ApplicationHandler. |
protected void |
createHandler(ServerConnectionInfo info,
int pageId,
int pageSubId)
Actually creates a handler for the specified serverConnectionInfo. |
protected ServerConnectionInfo |
findDbHandler(int pageId,
int pageSubId)
Checks the database handlers to determine if there is a matching ApplicationHandler. |
ServerConnectionInfo |
findHandler(int pageId,
int pageSubId)
Checks the system available handlers to determine if there is a matching ApplicationHandler. |
ServerConnectionInfo |
findInactiveHandler(java.lang.String sessionId)
Checks the system available inactive handlers to determine if there is a matching ApplicationHandler. |
void |
flushCache()
This function flushes the cache of all values. |
void |
flushCacheEntry(int pageId,
int pageSubId)
Flushes the specified entry in the cache. |
java.util.Vector |
getActiveApplicationHandlers()
This returns a Vector of all active ApplicationHandlers in the manager. |
java.util.Vector |
getConnectionInfoCache()
This function returns the current cache of connection info objects. |
java.util.Vector |
getInactiveApplicationHandlers()
This returns a Vector of all inactive ApplicationHandlers in the manager. |
Log |
getLogger()
This function returns the logging object. |
java.util.Vector |
getPendingApplicationHandlers()
This returns a Vector of all pending ApplicationHandlers in the manager. |
ServerConnectionInfo |
locateInCache(int pageId,
int pageSubId)
Checks the system available handlers to determine if there is a matching ApplicationHandler. |
void |
reactivateConnection(ServerConnectionInfo handler)
This function takes the specified ServerConnectionInfo from the list of inactive connections and places it back on the list of active connections. |
void |
removeAllPendingApplicationHandlers()
This function removes all pending ApplicationHandlers in the manager. |
void |
removeApplicationHandler(ApplicationHandler pageHandler,
boolean callShutDown)
This function removes the specified ApplicationHandler from the manager. |
void |
removeApplicationHandler(int pageId,
int pageSubId)
This function removes the specified ApplicationHandler from the manager. |
protected void |
removeApplicationHandler(java.util.Vector pages,
ApplicationHandler handler,
boolean callShutDown)
This function removes the specified ApplicationHandler from the page vector. |
protected void |
removeApplicationHandler(java.util.Vector pages,
int pageId,
int pageSubId)
This function removes the specified ApplicationHandler from the manager. |
void |
removeCacheApplication(int pageId,
int pageSubId)
This function removes the specified entry in the cache. |
void |
setApplicationInactive(ApplicationHandler handler)
This function tells the controller to set the specified ApplicationHandler as inactive. |
void |
timeEventOccurred()
This function is called by the main timer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public final long TimerInterval
public final long MaxInactiveInterval
| Constructor Detail |
public ApplicationController(ApplicationManager parentServer,
int type,
DatabaseManager manager,
ConnectionPool connectionPool,
java.lang.String tableName,
PropertiesHandler properties,
Log logFile)
parentServer - ApplicationManager which is handling all types of applications.type - int type of connection that this application controller manages. These
connection values match the values in ListenerThread.manager - DatabaseManager which can be used to perform database queries.connectionPool - ConnectionPool pointing to the Amber database.tableName - String containing the table to query to match the application to.properties - PropertiesHandler which contains the properties for the main
Amber Server.logFile - Log object to log errors to.ListenerThread| Method Detail |
public ServerConnectionInfo checkLicense(int pageId,
int pageSubId)
throws java.io.IOException
public void addApplicationHandler(ServerConnectionInfo handler)
throws ManagerException
handler - ServerConnectionInfo handle of the page to add.ManagerException - with any errors.public void addActiveConnection(ServerConnectionInfo handler)
handler - ServerConnectionInfo containing the details on the new
connection to add.
int type. The type of connection to look for a corresponding application
for. The types must match the constants in ListenerThread.
connection.public void reactivateConnection(ServerConnectionInfo handler)
handler - ServerConnectionInfo containing the details on the
connection to reactivate.
int type. The type of connection to look for a corresponding application
for. The types must match the constants in ListenerThread.
connection.
public void removeApplicationHandler(ApplicationHandler pageHandler,
boolean callShutDown)
pageHandler - ApplicationHandler handle of the page to remove.callShutDown - boolean true if the shut down function on the ApplicationHandler
is to be called first.
public void removeApplicationHandler(int pageId,
int pageSubId)
pageId - int containing the Page identifier of the page to terminate.pageSubId - int containing the Page Sub identifier of the page to terminate.
protected void removeApplicationHandler(java.util.Vector pages,
int pageId,
int pageSubId)
pages - Vector containing the pages to search for the application.pageId - int containing the Page identifier of the page to terminate.pageSubId - int containing the Page Sub identifier of the page to terminate.
protected void removeApplicationHandler(java.util.Vector pages,
ApplicationHandler handler,
boolean callShutDown)
pages - Vector containing the pages to search for the application.pageHandler - ApplicationHandler handle of the page to remove.callShutDown - boolean true if the shut down function on the ApplicationHandler
is to be called first.public void setApplicationInactive(ApplicationHandler handler)
handler - ApplicationHandler handle of the page to set inactive.public java.util.Vector getActiveApplicationHandlers()
public java.util.Vector getInactiveApplicationHandlers()
public void removeAllPendingApplicationHandlers()
protected ServerConnectionInfo findDbHandler(int pageId,
int pageSubId)
protected void createHandler(ServerConnectionInfo info,
int pageId,
int pageSubId)
throws java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
info - The ServerConnectionInfo for this connection.pageId - int page ID for this connection.pageSubId - int page sub ID for this connection.java.lang.ClassNotFoundException - if the class does not exist.java.lang.IllegalAccessException - if the class cannot be accessed (scope).java.lang.ClassNotFoundException - if the class cannot be created.
public ServerConnectionInfo findHandler(int pageId,
int pageSubId)
protected ServerConnectionInfo createConnectionFromCache(int pageId,
int pageSubId)
public ServerConnectionInfo locateInCache(int pageId,
int pageSubId)
public void removeCacheApplication(int pageId,
int pageSubId)
public void addToCache(ServerConnectionInfo info)
info - ServerConnectionInfo to add to the cache.public java.util.Vector getConnectionInfoCache()
public void flushCache()
public void flushCacheEntry(int pageId,
int pageSubId)
public ServerConnectionInfo findInactiveHandler(java.lang.String sessionId)
public java.util.Vector getPendingApplicationHandlers()
public Log getLogger()
public void timeEventOccurred()
timeEventOccurred in interface TimerInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||