Package org.apache.catalina.core

Examples of org.apache.catalina.core.StandardServer


        if (listenerInstalled || !Lifecycle.AFTER_INIT_EVENT.equals(event.getType())) return;
       
        try {
          File webappDir = findOpenEjbWar();
            if (webappDir == null && event.getSource() instanceof StandardServer) {
                final StandardServer server = (StandardServer) event.getSource();
                webappDir = tryToFindAndExtractWar(server);
                if (webappDir != null) { // we are using webapp startup
                    final File exploded = extractDirectory(webappDir);
                    if (webappDir != null) {
                        extract(webappDir, exploded);
View Full Code Here


            String type = event.getType();
            if (Lifecycle.PERIODIC_EVENT.equals(type)) {
                contextListener.checkHost(standardHost);
            }
        } else if (source instanceof StandardServer) {
            StandardServer standardServer = (StandardServer) source;
            String type = event.getType();

            if (Lifecycle.BEFORE_STOP_EVENT.equals(type)) {
              TomcatHelper.setStopping(true);
            }
View Full Code Here

    private final Map<String, Context> webserviceContexts = new TreeMap<String, Context>();
    private Engine engine;
    private List<Connector> connectors;

    public TomcatWsRegistry() {
        StandardServer standardServer = TomcatHelper.getServer();
        for (Service service : standardServer.findServices()) {
            if (service.getContainer() instanceof Engine) {
                connectors = Arrays.asList(service.findConnectors());
                engine = (Engine) service.getContainer();
                break;
            }
View Full Code Here

    private List<Connector> connectors;
    private final Map<String, Context> contexts = new TreeMap<String, Context>();
    private final Map<String, HttpListener> listeners = new TreeMap<String, HttpListener>();

    public TomcatRsRegistry() {
        StandardServer standardServer = TomcatHelper.getServer();
        for (Service service : standardServer.findServices()) {
            if (service.getContainer() instanceof Engine) {
                connectors = Arrays.asList(service.findConnectors());
                engine = (Engine) service.getContainer();
                break;
            }
View Full Code Here

   
    return null;
  }

  private void check() {
    StandardServer server = TomcatHelper.getServer();
    for (Service service : server.findServices()) {
      if (service.getContainer() instanceof Engine) {
        Engine engine = (Engine) service.getContainer();
        for (Container engineChild : engine.findChildren()) {
          if (engineChild instanceof StandardHost) {
            StandardHost host = (StandardHost) engineChild;
View Full Code Here

    public void testStoreStandard() throws Exception {
        StoreDescription desc = new StoreDescription();
        desc.setStandard(true);
        PrintWriter writer = new PrintWriter(new StringWriter());
        StandardServer bean = new StandardServer();
        new StoreAppender().printAttributes(writer, 0, true, bean, desc);
    }
View Full Code Here

                Registry.getRegistry(null, null).setMBeanServer(mbeanServer);
            }
        }

        System.setProperty("catalina.home", pathInjector.getValue());
        final StandardServer server = new StandardServer();

        final StandardService service = new StandardService();
        service.setName(JBOSS_WEB);
        service.setServer(server);
        server.addService(service);

        final Engine engine = new StandardEngine();
        engine.setName(JBOSS_WEB);
        engine.setService(service);
        engine.setDefaultHost(defaultHost);
        if (instanceId != null) {
            engine.setJvmRoute(instanceId);
        }

        service.setContainer(engine);

        if (useNative) {
            final AprLifecycleListener apr = new AprLifecycleListener();
            apr.setSSLEngine("on");
            server.addLifecycleListener(apr);
        }
        server.addLifecycleListener(new JasperListener());

        try {
            server.init();
            server.start();
        } catch (Exception e) {
            throw new StartException(MESSAGES.errorStartingWeb(), e);
        }
        this.server = server;
        this.service = service;
View Full Code Here

            Context context = null;
            if (localDataSource) {
                context = ContextBindings.getClassLoader();
                context = (Context) context.lookup("comp/env");
            } else {
                StandardServer server =
                    (StandardServer) ServerFactory.getServer();
                context = server.getGlobalNamingContext();
            }
            DataSource dataSource = (DataSource)context.lookup(dataSourceName);
            return dataSource.getConnection();
        } catch (Exception e) {
            // Log the problem for posterity
View Full Code Here

     *  that prevents it from being started
     */
    public synchronized void start() throws LifecycleException {

        try {
            StandardServer server = (StandardServer) ServerFactory.getServer();
            Context context = server.getGlobalNamingContext();
            database = (UserDatabase) context.lookup(resourceName);
        } catch (Throwable e) {
            e.printStackTrace();
            log(sm.getString("userDatabaseRealm.lookup", resourceName), e);
            database = null;
View Full Code Here

            Context context = null;
            if (localDataSource) {
                context = ContextBindings.getClassLoader();
                context = (Context) context.lookup("comp/env");
            } else {
                StandardServer server =
                    (StandardServer) ServerFactory.getServer();
                context = server.getGlobalNamingContext();
            }
            DataSource dataSource = (DataSource)context.lookup(dataSourceName);
      return dataSource.getConnection();
        } catch (Exception e) {
            // Log the problem for posterity
View Full Code Here

TOP

Related Classes of org.apache.catalina.core.StandardServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.