org.apache.catalina.startup
public class Embedded extends StandardService implements Lifecycle
createEngine()
to create an Engine object, and then
call its property setters as desired.createHost()
to create at least one virtual Host
associated with the newly created Engine, and then call its property
setters as desired. After you customize this Host, add it to the
corresponding Engine with engine.addChild(host)
.createContext()
to create at least one Context
associated with each newly created Host, and then call its property
setters as desired. You SHOULD create a Context with
a pathname equal to a zero-length string, which will be used to process
all requests not mapped to some other Context. After you customize
this Context, add it to the corresponding Host with
host.addChild(context)
.addEngine()
to attach this Engine to the set of
defined Engines for this object.createConnector()
to create at least one TCP/IP
connector, and then call its property setters as desired.addConnector()
to attach this Connector to the set
of defined Connectors for this object. The added Connector will use
the most recently added Engine to process its received requests.start()
to initiate normal operations of all the
attached components.
To initiate a normal shutdown, call the stop()
method of
this object.
Version: $Revision: 586738 $ $Date: 2007-10-20 16:57:18 +0200 (Sat, 20 Oct 2007) $
See Also: For a complete example
of how Tomcat is set up and launched as an Embedded application.
Field Summary | |
---|---|
protected HashMap | authenticators
Custom mappings of login methods to authenticators |
protected boolean | await
Use await. |
protected Engine[] | engines
The set of Engines that have been deployed in this server. |
protected static String | info
Descriptive information about this server implementation. |
protected LifecycleSupport | lifecycle
The lifecycle event support for this component. |
protected Realm | realm
The default realm to be used by all containers associated with
this compoennt. |
protected boolean | redirectStreams
Is standard streams redirection enabled ? |
protected static StringManager | sm
The string manager for this package. |
protected boolean | started
Has this component been started yet? |
protected boolean | useNaming
Is naming enabled ? |
Constructor Summary | |
---|---|
Embedded()
Construct a new instance of this class with default properties. | |
Embedded(Realm realm)
Construct a new instance of this class with specified properties.
|
Method Summary | |
---|---|
void | addAuthenticator(Authenticator authenticator, String loginMethod) |
void | addConnector(Connector connector)
Add a new Connector to the set of defined Connectors. |
void | addEngine(Engine engine)
Add a new Engine to the set of defined Engines.
|
void | addLifecycleListener(LifecycleListener listener)
Add a lifecycle event listener to this component.
|
Connector | createConnector(InetAddress address, int port, boolean secure)
Create, configure, and return a new TCP/IP socket connector
based on the specified properties.
|
Connector | createConnector(String address, int port, boolean secure) |
Connector | createConnector(InetAddress address, int port, String protocol) |
Connector | createConnector(String address, int port, String protocol) |
Context | createContext(String path, String docBase)
Create, configure, and return a Context that will process all
HTTP requests received from one of the associated Connectors,
and directed to the specified context path on the virtual host
to which this Context is connected.
|
Engine | createEngine()
Create, configure, and return an Engine that will process all
HTTP requests received from one of the associated Connectors,
based on the specified properties. |
Host | createHost(String name, String appBase)
Create, configure, and return a Host that will process all
HTTP requests received from one of the associated Connectors,
and directed to the specified virtual host.
|
Loader | createLoader(ClassLoader parent)
Create and return a class loader manager that can be customized, and
then attached to a Context, before it is started.
|
LifecycleListener[] | findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
String | getCatalinaBase() |
String | getCatalinaHome() |
String | getInfo()
Return descriptive information about this Server implementation and
the corresponding version number, in the format
<description>/<version> . |
Realm | getRealm()
Return the default Realm for our Containers. |
protected void | initDirs() |
protected void | initNaming() Initialize naming - this should only enable java:env and root naming.
|
protected void | initStreams() |
boolean | isAwait() |
boolean | isRedirectStreams()
Return true if redirction of standard streams is enabled. |
boolean | isUseNaming()
Return true if naming is enabled. |
void | removeContext(Context context)
Remove the specified Context from the set of defined Contexts for its
associated Host. |
void | removeEngine(Engine engine)
Remove the specified Engine from the set of defined Engines, along with
all of its related Hosts and Contexts. |
void | removeHost(Host host)
Remove the specified Host, along with all of its related Contexts,
from the set of defined Hosts for its associated Engine. |
void | removeLifecycleListener(LifecycleListener listener)
Remove a lifecycle event listener from this component.
|
void | setAwait(boolean b) |
void | setCatalinaBase(String s) |
void | setCatalinaHome(String s) |
void | setRealm(Realm realm)
Set the default Realm for our Containers.
|
void | setRedirectStreams(boolean redirectStreams)
Enables or disables naming support.
|
protected void | setSecurityProtection()
Set the security package access/protection. |
void | setUseNaming(boolean useNaming)
Enables or disables naming support.
|
void | start()
Prepare for the beginning of active use of the public methods of this
component. |
void | stop()
Gracefully terminate the active use of the public methods of this
component. |
Parameters: realm Realm implementation to be inherited by all components (unless overridden further down the container hierarchy)
Parameters: connector The connector to be added
Throws: IllegalStateException if no engines have been added yet
Parameters: engine The engine to be added
Parameters: listener The listener to add
Parameters: address InetAddress to bind to, or null
if the
connector is supposed to bind to all addresses on this server port Port number to listen to secure true if the generated connector is supposed to be
SSL-enabled, and false otherwise
After you have customized the properties, listeners, and Valves for this Context, you must attach it to the corresponding Host by calling:
host.addChild(context);which will also cause the Context to be started if the Host has already been started.
Parameters: path Context path of this application ("" for the default application for this host, must start with a slash otherwise) docBase Absolute pathname to the document base directory for this web application
Throws: IllegalArgumentException if an invalid parameter is specified
After you have customized the properties, listeners, and Valves for this Host, you must attach it to the corresponding Engine by calling:
engine.addChild(host);which will also cause the Host to be started if the Engine has already been started. If this is the default (or only) Host you will be defining, you may also tell the Engine to pass all requests not assigned to another virtual host to this one:
engine.setDefaultHost(host.getName());
Parameters: name Canonical name of this virtual host appBase Absolute pathname to the application base directory for this virtual host
Throws: IllegalArgumentException if an invalid parameter is specified
Parameters: parent ClassLoader that will be the parent of the one created by this Loader
<description>/<version>
.Parameters: context The Context to be removed
Parameters: engine The Engine to be removed
Parameters: host The Host to be removed
Parameters: listener The listener to remove
Parameters: realm The new default realm
Parameters: useNaming The new use naming value
Parameters: useNaming The new use naming value
configure()
,
and before any of the public methods of the component are utilized.
Throws: LifecycleException if this component detects a fatal error that prevents this component from being used
Throws: LifecycleException if this component detects a fatal error that needs to be reported