| java.lang.Object org.enhydra.server.EnhydraServer
EnhydraServer | public class EnhydraServer (Code) | | Description:
Class EnhydraServer use singleton pattern to provide
all necessary data about registered (started) Enhydra applications.
All application register itself on startup and unregister when shutdown.
Admin application use this class to display applications info.
Admin application should get instance of this class first, then calls
public methods. Example:
EnhydraServer enhydraServer = EnhydraServer.getInstance();
SessionsInfo sessInfo = enhydraServer.getSessionsInfo();
String activeSessions = sessInfo.getActiveSessions();
...
Copyright: Copyright (c) 2002
Company: www.together.at
author: Damir Milovic, damir@uns.ns.ac.yu version: 1.0 See Also: SessionsInfo |
Method Summary | |
public boolean | addApplication(String appName, String contextPath, String urlFilePath, String description) Adds new application to Enhydra server
Parameters: appName - application name. Parameters: contextPath - context path ( e.g. | public boolean | addConnection(String type, String port) Add (create) connection to application server.
Admin Presentation should first check available types, before call this method.
Parameters: type - Connection type ("http","ajp",..) depends on Application Server. Parameters: port - Port nubber. | public boolean | addConnection(String type, String port, String password, String pathToKeyStoreFile) Add (create) connection to application server. | public boolean | disableConnection(String appName, String portNumber) Disable connection to the application on port number.
Parameters: appName - application name. Parameters: portNumber - port number of corresponding connection. | public boolean | enableConnection(String appName, String portNumber) Enable connection to the application on port number.
Parameters: appName - application name. Parameters: portNumber - port number of corresponding connection. | public Config | getAppConfig(String appName) This method should be call for editing application config file. | public AppInfo | getAppInfo(String appName) See Also: AppInfo Parameters: appName - application name. | public String[] | getAppNames() | public ApplicationServer | getApplicationServer() | public String | getAppsDir() Get path to default Applications context root path. | public EnhydraServerXML | getConfig() | public DatabaseEdit | getDatabaseEdit(String appName) Gets instasnce of DatabaseEdit class which is used in edditing of database
parameters in configuration file of the application.
Parameters: appName - the applicatin name. | public DatabaseInfo | getDatabaseInfo(String appName) See Also: SessionsInfo Parameters: appName - - application name. | public String[] | getEnabledConnections(String appName) Method used by EnhydraPortFilter, provides list of enabled ports
for given application name.
Parameters: appName - Application name. | public static EnhydraServer | getInstance() Enhydra applications (HttpPresentationServlet) call this method to obtain
EnhydraServer instance. | public PresentationInfo | getPresentationInfo(String appName) | public SessionEdit | getSessionEdit(String appName) | public SessionsInfo | getSessionsInfo(String appName) | public boolean | isStarted() | public void | register(Servlet servlet) Enhydra Application (HttpPresentationServlet) register itself on startup. | public boolean | removeApplication(String appName) Remove application from Enhydra Server.
Parameters: appName - application name. | public boolean | removeConnection(String port) | public boolean | saveState() | public void | setApplicationServer(ApplicationServer appServ) Implementation of ApplicationServer interface are responsible
to set reference on himself. | public static void | setAppsfDir(String dir) Set path to default Applications context root path. | public synchronized void | shutdown() Shutdown EnhydraServer, including all applications and connections. | public boolean | startApplication(String appName) Start application.
Parameters: appName - application name. | public synchronized void | startup() This method is responsible starting applications
defined in EnhydraServer.conf file. | public boolean | stopApplication(String appName) Shutdown application.
Parameters: appName - application name. | public void | stopApplicationServer() | public void | unRegister(Servlet servlet) Enhydra Application unregister itself when stop. |
APPS_DIR | final public static String APPS_DIR(Code) | | Public static variables
|
APP_CONNECTIONS | final protected static String APP_CONNECTIONS(Code) | | |
APP_CONTEXTPATH | final protected static String APP_CONTEXTPATH(Code) | | |
APP_DESCRIPTION | final protected static String APP_DESCRIPTION(Code) | | |
APP_URLPATH | final protected static String APP_URLPATH(Code) | | attributes in tag in EnhydraServer.xml configuration file.
|
CONF_FILE_CLASS | final public static String CONF_FILE_CLASS(Code) | | |
DEFAULT_CONF_FILE | final public static String DEFAULT_CONF_FILE(Code) | | |
DEFAULT_CONF_FILE_CLASS | final public static String DEFAULT_CONF_FILE_CLASS(Code) | | |
DEFAULT_LOG_CLASS | final public static String DEFAULT_LOG_CLASS(Code) | | |
PRESENTATION_PREFIX | final public static String PRESENTATION_PREFIX(Code) | | |
SESSION_MANAGER | final public static String SESSION_MANAGER(Code) | | |
SESSION_MANAGER_KEY | final public static String SESSION_MANAGER_KEY(Code) | | |
addApplication | public boolean addApplication(String appName, String contextPath, String urlFilePath, String description)(Code) | | Adds new application to Enhydra server
Parameters: appName - application name. Parameters: contextPath - context path ( e.g. '/myapp') Parameters: urlPath - url path file (application root directory or path to war file).If path is relative it is resolved against %ENHYDRA_HOME/apps directory. Parameters: description - application description not required. true if application added successfuly, else false . |
addConnection | public boolean addConnection(String type, String port)(Code) | | Add (create) connection to application server.
Admin Presentation should first check available types, before call this method.
Parameters: type - Connection type ("http","ajp",..) depends on Application Server. Parameters: port - Port nubber. TRUE if connection added successfuly. |
addConnection | public boolean addConnection(String type, String port, String password, String pathToKeyStoreFile)(Code) | | Add (create) connection to application server.
Parameters: type - Connection type ("http","ajp","https"..) depends on Application Server. Parameters: port - Port nubber. Parameters: password - for "https" required. Parameters: pathToKeyStoreFile - absolute path to KeyStore file for "https" required. |
disableConnection | public boolean disableConnection(String appName, String portNumber)(Code) | | Disable connection to the application on port number.
Parameters: appName - application name. Parameters: portNumber - port number of corresponding connection. TRUE if connection successfuly disabled, else FALSE. |
enableConnection | public boolean enableConnection(String appName, String portNumber)(Code) | | Enable connection to the application on port number.
Parameters: appName - application name. Parameters: portNumber - port number of corresponding connection. TRUE if connection successfuly enabled, else FALSE. |
getAppConfig | public Config getAppConfig(String appName)(Code) | | This method should be call for editing application config file.
Parameters: appName - application name application Config object. See Also: com.lutris.util.Config |
getAppInfo | public AppInfo getAppInfo(String appName)(Code) | | See Also: AppInfo Parameters: appName - application name. AppInfo contains all necessary application data. |
getAppNames | public String[] getAppNames()(Code) | | names of all available applications |
getApplicationServer | public ApplicationServer getApplicationServer()(Code) | | instance of class that implements ApplicationServer |
getAppsDir | public String getAppsDir()(Code) | | Get path to default Applications context root path.
absolute path to directory, where are application context reside. |
getDatabaseEdit | public DatabaseEdit getDatabaseEdit(String appName)(Code) | | Gets instasnce of DatabaseEdit class which is used in edditing of database
parameters in configuration file of the application.
Parameters: appName - the applicatin name. instasnce of DatabaseEdit class. |
getDatabaseInfo | public DatabaseInfo getDatabaseInfo(String appName)(Code) | | See Also: SessionsInfo Parameters: appName - - application name. DatabaseInfo - JavaBean with getter methods. |
getEnabledConnections | public String[] getEnabledConnections(String appName)(Code) | | Method used by EnhydraPortFilter, provides list of enabled ports
for given application name.
Parameters: appName - Application name. Array of enabled port numbers . |
getInstance | public static EnhydraServer getInstance()(Code) | | Enhydra applications (HttpPresentationServlet) call this method to obtain
EnhydraServer instance.
One and only instance (singleton pattern) of this class. |
getSessionEdit | public SessionEdit getSessionEdit(String appName)(Code) | | See Also: SessionEdit Parameters: appName - applicatin name SessionEdit class for editing SessionManager parameters in conf file. |
isStarted | public boolean isStarted()(Code) | | AdminGui should call this method to check is EnhydraServer started
true if EnhydraServer started |
register | public void register(Servlet servlet)(Code) | | Enhydra Application (HttpPresentationServlet) register itself on startup.
Parameters: servlet - only HttpPresentationServlet is currently supported. |
removeApplication | public boolean removeApplication(String appName)(Code) | | Remove application from Enhydra Server.
Parameters: appName - application name. true if application removing was successful. |
removeConnection | public boolean removeConnection(String port)(Code) | | |
saveState | public boolean saveState()(Code) | | Save state of EnhydraServer into xml config file
TRUE if OK, else FALSE. |
setApplicationServer | public void setApplicationServer(ApplicationServer appServ)(Code) | | Implementation of ApplicationServer interface are responsible
to set reference on himself.
Parameters: appServ - Implementation of ApplicationServer. |
setAppsfDir | public static void setAppsfDir(String dir)(Code) | | Set path to default Applications context root path.
Application context url can be relative against this path.
Parameters: dir - absolute path to directory, where are application context reside. |
shutdown | public synchronized void shutdown()(Code) | | Shutdown EnhydraServer, including all applications and connections.
|
startApplication | public boolean startApplication(String appName)(Code) | | Start application.
Parameters: appName - application name. OK if application successfuly started, else FALSE. |
startup | public synchronized void startup()(Code) | | This method is responsible starting applications
defined in EnhydraServer.conf file.
ApplicationServer call this method when all necessary application server
initialization are done and ApplicationServer reference is setted.
|
stopApplication | public boolean stopApplication(String appName)(Code) | | Shutdown application.
Parameters: appName - application name. OK if application successfuly stopped, else FALSE. |
stopApplicationServer | public void stopApplicationServer()(Code) | | Shutdown application server
|
unRegister | public void unRegister(Servlet servlet)(Code) | | Enhydra Application unregister itself when stop.
Parameters: servlet - usualy HttpPresentationServlet. |
|
|