You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2010/05/02 20:01:58 UTC
svn commit: r940281 -
/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
Author: markt
Date: Sun May 2 18:01:58 2010
New Revision: 940281
URL: http://svn.apache.org/viewvc?rev=940281&view=rev
Log:
Add init() and destroy() support
Modified:
tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
Modified: tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java?rev=940281&r1=940280&r2=940281&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Tomcat.java Sun May 2 18:01:58 2010
@@ -278,11 +278,22 @@ public class Tomcat {
return sw;
}
+
+ /**
+ * Initialise the server.
+ *
+ * @throws LifecycleException
+ */
+ public void init() throws LifecycleException {
+ getServer();
+ getConnector();
+ server.init();
+ }
+
/**
- * Initialize and start the server, assuming that the Server implementation
- * implements {@link Lifecycle} (the standard implementation does). If it
- * does not, the {@link Server} must be started directly.
+ * Start the server.
+ *
* @throws LifecycleException
*/
public void start() throws LifecycleException {
@@ -292,9 +303,8 @@ public class Tomcat {
}
/**
- * Stop the server, assuming that the Server implementation implements
- * {@link Lifecycle} (the standard implementation does). If it does not, the
- * {@link Server} must be stopped directly.
+ * Stop the server.
+ *
* @throws LifecycleException
*/
public void stop() throws LifecycleException {
@@ -303,6 +313,16 @@ public class Tomcat {
}
+ /**
+ * Destroy the server. This object cannot be used once this method has been
+ * called.
+ */
+ public void destroy() throws LifecycleException {
+ getServer();
+ server.destroy();
+ // Could null out obejcts here
+ }
+
/**
* Add a user for the in-memory realm. All created apps use this
* by default, can be replaced using setRealm().
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org