|
|||||||||
| Home >> All >> org >> enhydra >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.enhydra.servlet
Class ServletContainer

java.lang.Objectorg.enhydra.servlet.ServletContainer
- All Implemented Interfaces:
- com.lutris.multiServer.Service
- public class ServletContainer
- extends java.lang.Object
- implements com.lutris.multiServer.Service
- extends java.lang.Object
Handles requests for Servlets. Multiple connection methods may be routed to one Servlet, or one connection method may direct requests to multiple Servlets (based on URL).
Servlets or Enhydra applications (which are a special kind of servlet) or Servlet 2.2 Web applications may be served.
This class uses a ServletManager to hold a set of Servlets, a ConnectionMethodManager to hold a set of ConnectionMethods, and a FilterManager to hold a set of Filters. These are available to other classes (for example the admin application).
At startup time a configuration file is read, and it describes what ConnectionMethods to create, what Servlets to register, and the connections to make from the ConnectionMethods to the Servlets. It also describes the filters to create and what channels to install them in. These filters are all descendants of the MultServerFilter class.
After this config file is read, and the servlet container is set up, no further action is taken. The thread that ran through start() exits. The ConnectionMethods must create threads, and they are responsible for receiving requests from the outside world and passing them on to the handleRequest() methods of the ServletContainer.
Normally one of the Servlets will be an administration application. This admin app knows about this class, and so it knows how to talk to the current ConnectionMethods and Servlets. It may change the server setup on the fly. For example, it can create and add a new ConnectionMethod. Or it could add a new channel to an already existing ConnectionMethod. Or register a new Servlet. Or add a logging filter to a channel. Or monitor performance.
| Constructor Summary | |
ServletContainer()
Default constructor. |
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
connectionMethodManager
private org.enhydra.servlet.connectionMethods.ConnectionMethodManager connectionMethodManager
- The manager for all the ConnectionMethods in use by the server.
servletManager
private org.enhydra.servlet.servletManager.ServletManager servletManager
- The manager for all the Servlets in use by the server.
filterManager
private org.enhydra.servlet.filter.FilterManager filterManager
- The manager for all the Filters (which will all be
descendants of MultiServerFilter) in use by the server.
started
private boolean started
- Has the servlet container been initialized and started?
configDirectory
private java.lang.String configDirectory
- The directory where Enhydra application config files
are expected to reside. Only the admin application is expected to need
to use this.
defaultConfigFileName
private static final java.lang.String defaultConfigFileName
- See Also:
- Constant Field Values
configFileName
private java.lang.String configFileName
configFile
private com.lutris.util.ConfigFile configFile
config
public com.lutris.util.Config config
logChannel
private com.lutris.logging.LogChannel logChannel
CONF_DIR
public static final java.lang.String CONF_DIR
- See Also:
- Constant Field Values
SERVER
public static final java.lang.String SERVER
- See Also:
- Constant Field Values
APPLICATION
public static final java.lang.String APPLICATION
- See Also:
- Constant Field Values
CONF_FILE
public static final java.lang.String CONF_FILE
- See Also:
- Constant Field Values
SERVLET
public static final java.lang.String SERVLET
- See Also:
- Constant Field Values
CLASS_NAME
public static final java.lang.String CLASS_NAME
- See Also:
- Constant Field Values
DOC_ROOT
public static final java.lang.String DOC_ROOT
- See Also:
- Constant Field Values
DESCRIPTION
public static final java.lang.String DESCRIPTION
- See Also:
- Constant Field Values
RUNNING
public static final java.lang.String RUNNING
- See Also:
- Constant Field Values
CLASS_PATH
public static final java.lang.String CLASS_PATH
- See Also:
- Constant Field Values
INIT_ARGS
public static final java.lang.String INIT_ARGS
- See Also:
- Constant Field Values
URL
public static final java.lang.String URL
- See Also:
- Constant Field Values
CONNECTION
public static final java.lang.String CONNECTION
- See Also:
- Constant Field Values
FILTERS
public static final java.lang.String FILTERS
- See Also:
- Constant Field Values
CHANNEL
public static final java.lang.String CHANNEL
- See Also:
- Constant Field Values
FILTER
public static final java.lang.String FILTER
- See Also:
- Constant Field Values
ENABLED
public static final java.lang.String ENABLED
- See Also:
- Constant Field Values
APP_CLASS
public static final java.lang.String APP_CLASS
- See Also:
- Constant Field Values
PRESENTATION_PREFIX
public static final java.lang.String PRESENTATION_PREFIX
- See Also:
- Constant Field Values
AUTO_RELOAD
public static final java.lang.String AUTO_RELOAD
- See Also:
- Constant Field Values
SESSION_MANAGER
public static final java.lang.String SESSION_MANAGER
- See Also:
- Constant Field Values
DEFAULT_SESSION_TIMEOUT
public static final java.lang.String DEFAULT_SESSION_TIMEOUT
- See Also:
- Constant Field Values
IS_WAR_EXPANDED
public static final java.lang.String IS_WAR_EXPANDED
- See Also:
- Constant Field Values
IS_WAR_VALIDATED
public static final java.lang.String IS_WAR_VALIDATED
- See Also:
- Constant Field Values
IS_INVOKER_ENABLED
public static final java.lang.String IS_INVOKER_ENABLED
- See Also:
- Constant Field Values
IS_WORKDIR_PERSISTENT
public static final java.lang.String IS_WORKDIR_PERSISTENT
- See Also:
- Constant Field Values
SSL
public static final java.lang.String SSL
- See Also:
- Constant Field Values
SERVER_CERTIFICATE
public static final java.lang.String SERVER_CERTIFICATE
- See Also:
- Constant Field Values
SECURE_RANDOM_ALGORITHM
public static final java.lang.String SECURE_RANDOM_ALGORITHM
- See Also:
- Constant Field Values
SECURE_RANDOM_PROVIDER
public static final java.lang.String SECURE_RANDOM_PROVIDER
- See Also:
- Constant Field Values
SSL_CONTEXT_PROVIDER
public static final java.lang.String SSL_CONTEXT_PROVIDER
- See Also:
- Constant Field Values
SSL_CONTEXT_PROTOCOL
public static final java.lang.String SSL_CONTEXT_PROTOCOL
- See Also:
- Constant Field Values
KEY_STORE_LOCATION
public static final java.lang.String KEY_STORE_LOCATION
- See Also:
- Constant Field Values
KEY_STORE_PROVIDER
public static final java.lang.String KEY_STORE_PROVIDER
- See Also:
- Constant Field Values
KEY_MANAGER_ALGORITHM
public static final java.lang.String KEY_MANAGER_ALGORITHM
- See Also:
- Constant Field Values
KEY_MANAGER_PROVIDER
public static final java.lang.String KEY_MANAGER_PROVIDER
- See Also:
- Constant Field Values
TRUST_MANAGER
public static final java.lang.String TRUST_MANAGER
- See Also:
- Constant Field Values
PASSWORD
public static final java.lang.String PASSWORD
- See Also:
- Constant Field Values
CLIENT_AUTHENTICATION
public static final java.lang.String CLIENT_AUTHENTICATION
- See Also:
- Constant Field Values
HTTP
public static final java.lang.String HTTP
- See Also:
- Constant Field Values
HTTPS
public static final java.lang.String HTTPS
- See Also:
- Constant Field Values
CGI
public static final java.lang.String CGI
- See Also:
- Constant Field Values
RMI
public static final java.lang.String RMI
- See Also:
- Constant Field Values
WAI
public static final java.lang.String WAI
- See Also:
- Constant Field Values
APACHE
public static final java.lang.String APACHE
- See Also:
- Constant Field Values
FULL
public static final java.lang.String FULL
- See Also:
- Constant Field Values
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
YES
public static final java.lang.String YES
- See Also:
- Constant Field Values
NO
public static final java.lang.String NO
- See Also:
- Constant Field Values
ENYHDRA_APP_CLASSNAME
public static final java.lang.String ENYHDRA_APP_CLASSNAME
- See Also:
- Constant Field Values
standardSessionManager
private com.lutris.appserver.server.session.StandardSessionManager standardSessionManager
yesOrNo
private java.lang.String yesOrNo
rez
private org.enhydra.i18n.ResManager rez
| Constructor Detail |
ServletContainer
public ServletContainer()
- Default constructor.
| Method Detail |
init
public void init()
- Default initialization. Uses the existing config file if previously
set, otherwise uses the default config file.
init
public void init(java.lang.String configFileName)
- Initialization uses the passed in config file.
- Specified by:
initin interfacecom.lutris.multiServer.Service
start
public void start()
- Start the servlet container.
- Specified by:
startin interfacecom.lutris.multiServer.Service
initialize
private void initialize()
- Get the server ready to read it's config file. All the
manager objects start off empty. There are no "built in"
servlets, connection methods, channels, or filters.
They must all be specified in the config file. This
gives more control to the administrator.
stop
public void stop()
- Stop the servlet container.
This fucnction disables all the channels in all the
connection methods, then destroys all the connection
methods. This causes them to kill all their threads.
When the last thread exits, the java application will
exit.
- Specified by:
stopin interfacecom.lutris.multiServer.Service
getConnectionMethodManager
public org.enhydra.servlet.connectionMethods.ConnectionMethodManager getConnectionMethodManager()
- Get the connection manager for the ServletContainer.
getServletManager
public org.enhydra.servlet.servletManager.ServletManager getServletManager()
- Get the servlet manager for the ServletContainer.
getSessionManager
public com.lutris.appserver.server.session.SessionManager getSessionManager()
- Get the servlet manager for the ServletContainer.
getFilterManager
public org.enhydra.servlet.filter.FilterManager getFilterManager()
- Get the filter manager for the ServletContainer.
getConfigDirectory
public java.lang.String getConfigDirectory()
- Get the config directory used by this ServletContainer to find apps.
X22 This seems like it should be in the MultiServer Admin rather
X22 than here.
readConfigFile
private void readConfigFile(java.lang.String configFileName)
- Read the given config file.
parseServerSection
private void parseServerSection(com.lutris.util.Config server)
- Retrieve the server parameters from the config file and
establish the logging facility.
addApplication
private void addApplication(com.lutris.util.Config info, java.lang.String id)
addEnhydraApplication
private void addEnhydraApplication(com.lutris.util.Config info, java.lang.String id, boolean runOnInit, java.lang.String conf)
addWarApplication
private void addWarApplication(com.lutris.util.Config info, java.lang.String id, boolean runOnInit)
addServlet
private void addServlet(com.lutris.util.Config info, java.lang.String id)
addChannels
private void addChannels(com.lutris.util.Config info, java.lang.String cmID)
addFilter
private void addFilter(com.lutris.util.Config info, java.lang.String id)
myGetString
private java.lang.String myGetString(com.lutris.util.Config cfg, java.lang.String key)
myGetString
private java.lang.String myGetString(com.lutris.util.Config cfg, java.lang.String key, java.lang.String prefix)
myGetStrings
private java.lang.String[] myGetStrings(com.lutris.util.Config t, java.lang.String key, java.lang.String prefix)
myGetString
private java.lang.String myGetString(com.lutris.util.Config cfg, java.lang.String key, java.lang.String prefix, boolean required)
myGetStrings
private java.lang.String[] myGetStrings(com.lutris.util.Config t, java.lang.String key, java.lang.String prefix, boolean required)
myGetSection
private com.lutris.util.Config myGetSection(com.lutris.util.Config cfg, java.lang.String key)
myGetSection
private com.lutris.util.Config myGetSection(com.lutris.util.Config cfg, java.lang.String key, boolean required)
trim
private java.lang.String trim(java.lang.String s)
writeConfigFile
public java.lang.String writeConfigFile(java.lang.String filename)
- This function examines the current state of the server and
writes it out to the given config file.
createApplicationSection
private void createApplicationSection()
throws com.lutris.util.ConfigException,
com.lutris.util.KeywordValueException
createServletSection
private void createServletSection()
throws com.lutris.util.ConfigException,
com.lutris.util.KeywordValueException
createChannelSection
private void createChannelSection()
throws com.lutris.util.ConfigException,
com.lutris.util.KeywordValueException
fatalErr
private void fatalErr(java.lang.String msg, java.lang.Throwable t)
fatalErr
private void fatalErr(java.lang.String msg)
fatalErr
private void fatalErr(java.lang.String msg, boolean useLogger, java.lang.Throwable t)
|
|||||||||
| Home >> All >> org >> enhydra >> [ servlet overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.enhydra.servlet.ServletContainer