|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--amber.server.manager.Core
Central controlling class which handles the complete requirements for the server system. It initiates and controls the various server components required to make the server function.
CoreInterface| Field Summary | |
protected AmberInputStream |
dataDecoder
The data decoding data stream that is used by all components to send information. |
protected AmberOutputStream |
dataEncoder
|
static int |
DefaultExpirationTime
The default expiration time is infinity (sec) |
static java.lang.String |
DefaultLoggingFilename
The logging file name |
protected java.io.ByteArrayOutputStream |
encoderBytes
The data encoding data stream that is used by all components to send information. |
protected amber.server.manager.FlatFileApplicationDatabase |
normalPreCache
Precache items for the connection server. |
static int |
ServerPort
The port the server listens on. |
static int |
VersionNumber
The absolute version number for the server. |
| Constructor Summary | |
Core(java.lang.String name,
DatabaseManager manager,
java.lang.String connectionPoolName,
java.lang.String logFilename,
int logLevel,
int port,
amber.utility.AmberLicenseKey licenseKey,
PropertiesHandler properties)
The complete constuctor for the Amber Server Implementation. |
|
| Method Summary | |
protected java.lang.String |
convertRelativeToAbsoluteDirectory(java.lang.String directory)
This function converts a relative directory into a corresponding absolute form. |
protected AmberInputStream |
createDataInput(Packet packet)
This function creates a data input stream from the data in the packet. |
java.lang.String |
getAmberRoot()
Returns the directory where the Amber server is currently running. |
ApplicationManager |
getApplicationManager()
This function returns the application manager object responsible for handling the requirements of managing applications and their associated handlers. |
ConnectionManager |
getConnectionManager()
This function returns the connection manager object responsible for handling incoming connections. |
ConnectionPool |
getConnectionPool()
Returns the current connection pool for the amber server. |
static Core |
getCore()
This function returns the global instance of the core object. |
DatabaseManager |
getDatabaseManager()
This function returns the database manager object responsible for handling incoming database connections. |
protected AmberInputStream |
getDataInput()
This function returns the current data input stream. |
java.lang.String |
getDocumentRoot()
Returns the directory of the web server's document root. |
amber.utility.AmberLicenseKey |
getLicenseKey()
Returns the license key object. |
static int |
getLicenseVersion()
Returns the licence version of the server. |
Log |
getLogger()
This function returns the logging object. |
ConnectionHandler |
getManager(int type)
This function returns the manager object responsible for handling the requirements of the specified remote object type |
java.lang.String |
getNewSessionIdentifier()
This function returns a unique session identifier. |
PropertiesHandler |
getProperties()
Returns the system wide properties for this server. |
void |
handleNewConnection(java.net.Socket socket,
Packet initPacket,
int systemType,
int type)
This function matches the incomimg packet to the corresponding page handler in the pendingPages variable. |
boolean |
isDatabaseAvailable()
This function returns whether the AmberPages database is active for this server. |
protected amber.server.manager.FlatFileApplicationDatabase |
loadCache(java.lang.String filename)
Loads the specified connection cache file. |
protected boolean |
loadPreCacheConnections()
Looks in the configuration to see if there are any precache files to load. |
protected HandlerManager |
processManagerString(java.lang.String managerString)
This function creates all the additional managers specified in the properties file. |
void |
sendEmail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String body,
java.lang.String smtpServer)
This function sends a mail message to the specified user. |
void |
setLoggingLevel(int level)
This function sets the level of logging in the server. |
protected void |
startManagers()
This function starts the various managers required by the server to make the system function. |
void |
stopServer()
This function stops the server remotely. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int VersionNumber
public static final int ServerPort
public static final int DefaultExpirationTime
public static final java.lang.String DefaultLoggingFilename
protected AmberInputStream dataDecoder
protected java.io.ByteArrayOutputStream encoderBytes
protected AmberOutputStream dataEncoder
protected amber.server.manager.FlatFileApplicationDatabase normalPreCache
| Constructor Detail |
public Core(java.lang.String name,
DatabaseManager manager,
java.lang.String connectionPoolName,
java.lang.String logFilename,
int logLevel,
int port,
amber.utility.AmberLicenseKey licenseKey,
PropertiesHandler properties)
throws ManagerException
name - String containing the name of the server when RMI registering this object.manager - DatabaseManager which handles the database connections.connectionPoolName - String containing the name of the database connection pool
to use.logFilename - String containing the name of the log file.logLevel - int containing the log level to log.port - int containing the port number to listen to for unsecure connections.securePort - int containing the port number to listen to for unsecure connections.adminPort - int containing the port number to listen to for administration connections.properties - PropertiesHandler containing the system configuration properties.ManagerException - with other types of errors.| Method Detail |
protected boolean loadPreCacheConnections()
throws ManagerException
ManagerException - should the loading fail.
protected amber.server.manager.FlatFileApplicationDatabase loadCache(java.lang.String filename)
throws AmberException
filename - String name of the file to load.AmberException - should the loading fail.
protected void startManagers()
throws ManagerException
ManagerException - with other types of errors.
protected HandlerManager processManagerString(java.lang.String managerString)
throws java.lang.ClassNotFoundException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
ManagerException
ManagerException - with other types of errors.
public void handleNewConnection(java.net.Socket socket,
Packet initPacket,
int systemType,
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.systemType - The type of remote system which is attempting to connect.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 void stopServer()
stopServer in interface CoreInterface
public void setLoggingLevel(int level)
throws ManagerException
setLoggingLevel in interface CoreInterfacelevel - int level to set the debugging to.
This corresponds to values in the Log object.ManagerException - with any errors.public Log getLogger()
public boolean isDatabaseAvailable()
public void sendEmail(java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String body,
java.lang.String smtpServer)
sendEmail in interface CoreInterfaceto - String name of the recipient.from - String name of the sender.subject - String containing the subject of the e-mail.body - String containing the body of the text mail message.smtpServer - String containing the SMTP mail server address.protected AmberInputStream createDataInput(Packet packet)
packet - Packet containing the data to decode.protected AmberInputStream getDataInput()
public DatabaseManager getDatabaseManager()
getDatabaseManager in interface CoreInterfacepublic ConnectionPool getConnectionPool()
public ConnectionHandler getManager(int type)
getManager in interface CoreInterfacepublic ApplicationManager getApplicationManager()
getApplicationManager in interface CoreInterfacepublic ConnectionManager getConnectionManager()
getConnectionManager in interface CoreInterfacepublic static Core getCore()
public java.lang.String getNewSessionIdentifier()
getNewSessionIdentifier in interface CoreInterfacepublic PropertiesHandler getProperties()
public amber.utility.AmberLicenseKey getLicenseKey()
getLicenseKey in interface CoreInterfacepublic java.lang.String getAmberRoot()
getAmberRoot in interface CoreInterfacepublic java.lang.String getDocumentRoot()
getDocumentRoot in interface CoreInterfaceprotected java.lang.String convertRelativeToAbsoluteDirectory(java.lang.String directory)
directory - String containing the directory to convert.public static int getLicenseVersion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||