Package org.apache.catalina.core

Examples of org.apache.catalina.core.StandardServer


        ejbServerProps.putAll(props);
        ejbServerProps.setProperty("openejb.ejbd.uri", "http://127.0.0.1:8080/openejb/ejb");
        ejbServer.init(ejbServerProps);

        // Add our naming context listener to the server which registers all Tomcat resources with OpenEJB
        StandardServer standardServer = (StandardServer) ServerFactory.getServer();
        OpenEJBNamingContextListener namingContextListener = new OpenEJBNamingContextListener(standardServer);
        // Standard server has no state property, so we check global naming context to determine if server is started yet
        if (standardServer.getGlobalNamingContext() != null) {
            namingContextListener.start();
        }
        standardServer.addLifecycleListener(namingContextListener);

        // Process all applications already started.  This deploys EJBs, PersistenceUnits
        // and modifies JNDI ENC references to OpenEJB managed objects such as EJBs.
        processRunningApplications(tomcatWebAppBuilder, standardServer);

        if (Boolean.getBoolean("openejb.servicemanager.enabled")) {
            manager = ServiceManager.getManager();
            manager.init();
            manager.start(false);
        } else {
            try {
                ServerService serverService = (ServerService) Class.forName("org.apache.openejb.server.cxf.CxfService").newInstance();
                serverService.start();
            } catch (Exception ignored) {
            }
        }

        standardServer.addLifecycleListener(new LifecycleListener() {
            public void lifecycleEvent(LifecycleEvent event) {
                String type = event.getType();
                if (Lifecycle.AFTER_STOP_EVENT.equals(type)) {
                    TomcatLoader.this.destroy();
                }
View Full Code Here


   
    return null;
  }

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

        tomcat.getService().addConnector(connector);
        tomcat.setConnector(connector);

        // Add AprLifecycleListener if we are using the Apr connector
        if (protocol.contains("Apr")) {
            StandardServer server = (StandardServer) tomcat.getServer();
            AprLifecycleListener listener = new AprLifecycleListener();
            server.addLifecycleListener(listener);
            connector.setAttribute("pollerThreadCount", Integer.valueOf(1));
        }
       
        tomcat.setBaseDir(tempDir.getAbsolutePath());
        tomcat.getHost().setAppBase(appBase.getAbsolutePath());
View Full Code Here

       
        initBaseDir();
       
        System.setProperty("catalina.useNaming", "false");
       
        server = new StandardServer();
        server.setPort( -1 );
       
        service = new StandardService();
        service.setName("Tomcat");
        server.addService( service );
View Full Code Here

    public static void setStopping(final boolean stopping) {
        TomcatHelper.stopping = stopping;
    }

    public static StandardServer getServer() {
        StandardServer server = null;
        try {
            final Class<?> systemInstanceClass = Thread.currentThread().getContextClassLoader().loadClass("org.apache.openejb.loader.SystemInstance");
            final Object instance = systemInstanceClass.getDeclaredMethod("get").invoke(null);
            server = (StandardServer) systemInstanceClass.getDeclaredMethod("getComponent", Class.class).invoke(instance, StandardServer.class);
        } catch (final Exception classNotFoundException) {
View Full Code Here

        }

        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 (exploded != null) {
                        extract(webappDir, exploded);
View Full Code Here

            host.addChild(context);
            host.fireContainerEvent(INSTALL_EVENT, context);

            // save context info into configFile
            Engine engine = (Engine)host.getParent();
            StandardServer server = (StandardServer) engine.getService().getServer();
            //server.storeContext(context);
        } catch (Exception e) {
            log.error(sm.getString("standardHost.installError", contextPath),
                      e);
            throw new IOException(e.toString());
View Full Code Here

        tomcat.getService().addConnector(connector);
        tomcat.setConnector(connector);

        // Add AprLifecycleListener if we are using the Apr connector
        if (protocol.contains("Apr")) {
            StandardServer server = (StandardServer) tomcat.getServer();
            AprLifecycleListener listener = new AprLifecycleListener();
            server.addLifecycleListener(listener);
            connector.setAttribute("pollerThreadCount", Integer.valueOf(1));
        }
       
        tomcat.setBaseDir(tempDir.getAbsolutePath());
        tomcat.getHost().setAppBase(appBase.getAbsolutePath());
View Full Code Here

       
        initBaseDir();
       
        System.setProperty("catalina.useNaming", "false");
       
        server = new StandardServer();
        server.setPort( -1 );
       
        service = new StandardService();
        service.setName("Tomcat");
        server.addService( service );
View Full Code Here

       
        initBaseDir();
       
        System.setProperty("catalina.useNaming", "false");
       
        server = new StandardServer();
        server.setPort( -1 );
       
        service = new StandardService();
        service.setName("Tomcat");
        server.addService( service );
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.