import org.apache.catalina.Container;
import org.apache.catalina.LifecycleException;
-import org.apache.catalina.LifecycleState;
import org.apache.catalina.Server;
import org.apache.catalina.core.StandardServer;
-import org.apache.catalina.util.LifecycleBase;
import org.apache.juli.ClassLoaderLogManager;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.digester.Digester;
* @version $Id$
*/
-public class Catalina extends LifecycleBase {
+public class Catalina {
/**
}
- @Override
- protected void initInternal() {
- // NOOP
- }
-
/**
* Start a new server instance.
*/
- @Override
- protected void startInternal() {
+ public void start() {
if (getServer() == null) {
load();
long t1 = System.nanoTime();
- setState(LifecycleState.STARTING);
-
// Start the new server
try {
getServer().start();
}
if (await) {
- setState(LifecycleState.STARTED);
- fireLifecycleEvent(AFTER_START_EVENT, null);
await();
- setState(LifecycleState.MUST_STOP);
+ stop();
}
}
/**
* Stop an existing server instance.
*/
- @Override
- protected void stopInternal() {
-
- fireLifecycleEvent(STOP_EVENT, null);
- setState(LifecycleState.STOPPING);
+ public void stop() {
try {
// Remove the ShutdownHook first so that server.stop()
}
- @Override
- protected void destroyInternal() {
- // NOOP
- }
-
/**
* Await and shutdown.
*/
if (getServer() != null) {
try {
Catalina.this.stop();
- } catch (LifecycleException e) {
+ } catch (Exception e) {
log.error(sm.getString("catalina.shutdownHookFail"), e);
}
}
if (logManager instanceof ClassLoaderLogManager) {
((ClassLoaderLogManager) logManager).shutdown();
}
-
}
-
}