Java Code Examples for org.apache.catalina.LifecycleState#DESTROYED

The following examples show how to use org.apache.catalina.LifecycleState#DESTROYED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractWebServiceTest.java    From openmeetings with Apache License 2.0 5 votes vote down vote up
@AfterAll
public static void destroy() throws Exception {
	if (tomcat.getServer() != null && tomcat.getServer().getState() != LifecycleState.DESTROYED) {
		if (tomcat.getServer().getState() != LifecycleState.STOPPED) {
			tomcat.stop();
		}
		tomcat.destroy();
	}
}
 
Example 2
Source File: IdpTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 3
Source File: AbstractOIDCTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) throws LifecycleException {
    if (server != null && server.getServer() != null
        && server.getServer().getState() != LifecycleState.DESTROYED) {
        if (server.getServer().getState() != LifecycleState.STOPPED) {
            server.stop();
        }
        server.destroy();
    }
}
 
Example 4
Source File: TokenExpiryTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 5
Source File: SpringTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 6
Source File: WSFedTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 7
Source File: LDAPTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 8
Source File: AbstractWebAppIntegrationTest.java    From jbrotli with Apache License 2.0 5 votes vote down vote up
@AfterClass
public final void shutdownTomcatServer() throws Throwable {
  if (tomcat.getServer() != null && tomcat.getServer().getState() != LifecycleState.DESTROYED) {
    if (tomcat.getServer().getState() != LifecycleState.STOPPED) {
      tomcat.stop();
    }
    tomcat.destroy();
  }
}
 
Example 9
Source File: KerberosTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 10
Source File: TokenExpiryTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 11
Source File: WebappClassLoaderBase.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public void destroy() {
    state = LifecycleState.DESTROYING;

    try {
        super.close();
    } catch (IOException ioe) {
        log.warn(sm.getString("webappClassLoader.superCloseFail"), ioe);
    }
    state = LifecycleState.DESTROYED;
}
 
Example 12
Source File: CXFTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 13
Source File: LazyValve.java    From tomee with Apache License 2.0 5 votes vote down vote up
@Override
public void destroy() throws LifecycleException {
    if (instance() != null && Lifecycle.class.isInstance(delegate)) {
        Lifecycle.class.cast(delegate).destroy();
    }
    state = LifecycleState.DESTROYED;
}
 
Example 14
Source File: FederationTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 15
Source File: AbstractStoreRestTest.java    From TeaStore with Apache License 2.0 5 votes vote down vote up
/**
 * Dismantles the embedded Tomcat.
 * 
 * @throws Throwable
 *           Throws uncaught throwables for test to fail.
 */
@After
public void dismantle() throws Throwable {
  if (storeTomcat.getServer() != null
      && storeTomcat.getServer().getState() != LifecycleState.DESTROYED) {
    if (storeTomcat.getServer().getState() != LifecycleState.STOPPED) {
      storeTomcat.stop();
    }
    storeTomcat.destroy();
  }
}
 
Example 16
Source File: TomcatTestHandler.java    From TeaStore with Apache License 2.0 5 votes vote down vote up
/**
 * Dismantle Tomcat with index.
 * @param index The tomcat index.
 */
public void dismantle(int index) {
	try {
		if (tomcats[index].getServer() != null
				&& tomcats[index].getServer().getState() != LifecycleState.DESTROYED) {
	        if (tomcats[index].getServer().getState() != LifecycleState.STOPPED) {
	        	tomcats[index].stop();
	        }
	        tomcats[index].destroy();
	    }
	} catch (LifecycleException e) {
		System.out.println("Exception shutting down Testing Tomcat (this may happen a lot): " + e.getMessage());
	}
}
 
Example 17
Source File: WSFedTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
private static void shutdownServer(Tomcat server) {
    try {
        if (server != null && server.getServer() != null
            && server.getServer().getState() != LifecycleState.DESTROYED) {
            if (server.getServer().getState() != LifecycleState.STOPPED) {
                server.stop();
            }
            server.destroy();
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 18
Source File: AbstractTomcatMetricsTest.java    From tomcat_exporter with Apache License 2.0 5 votes vote down vote up
public static void shutDownTomcat() throws LifecycleException {
    if (tomcat.getServer() != null
            && tomcat.getServer().getState() != LifecycleState.DESTROYED) {
        if (tomcat.getServer().getState() != LifecycleState.STOPPED) {
            tomcat.stop();
        }
        tomcat.destroy();
    }
}
 
Example 19
Source File: TomcatUtils.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
public static void stopIdpServer() throws Exception {
    if (idpServer != null && idpServer.getServer() != null
        && idpServer.getServer().getState() != LifecycleState.DESTROYED) {
        if (idpServer.getServer().getState() != LifecycleState.STOPPED) {
            idpServer.stop();
        }
        idpServer.destroy();
    }
}
 
Example 20
Source File: JettyTest.java    From cxf-fediz with Apache License 2.0 5 votes vote down vote up
@AfterClass
public static void cleanup() throws Exception {
    if (idpServer != null && idpServer.getServer() != null
        && idpServer.getServer().getState() != LifecycleState.DESTROYED) {
        if (idpServer.getServer().getState() != LifecycleState.STOPPED) {
            idpServer.stop();
        }
        idpServer.destroy();
    }

    JettyUtils.stopRpServer();
}