Package org.apache.catalina.core

Examples of org.apache.catalina.core.StandardServer


    }

    public void lifecycleEvent(LifecycleEvent event) {
        if (event.getSource() instanceof StandardServer &&
                "before_start".equals(event.getType())) {
            StandardServer server = (StandardServer) event.getSource();
            Service[] service = server.findServices();
            StandardEngine engine = (StandardEngine) service[0].getContainer();
            Container[] container = engine.findChildren();
            host = (StandardHost) container[0];

            LifecycleListener[] listener = host.findLifecycleListeners();
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

       
        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

        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();
            listener.setSSLRandomSeed("/dev/urandom");
            server.addLifecycleListener(listener);
            connector.setAttribute("pollerThreadCount", Integer.valueOf(1));
        }
       
        tomcat.setBaseDir(tempDir.getAbsolutePath());
        tomcat.getHost().setAppBase(appBase.getAbsolutePath());
View Full Code Here

                    } catch (IOException e) {
                        // Ignore
                    }
                }
                log.info("Using Tuscany webapp: " + webappDir.getAbsolutePath());
                StandardServer server = (StandardServer)event.getSource();
                StandardService catalina = (StandardService)server.findService("Catalina");
                for (Connector connector : catalina.findConnectors()) {
                    for (Container container : connector.getContainer().findChildren()) {
                        if (container instanceof StandardHost) {
                            for (LifecycleListener listener : ((StandardHost)container).findLifecycleListeners()) {
                                if (listener instanceof HostConfig) {
View Full Code Here

        // set catalina_home
        System.setProperty("catalina.home", System.getProperty("ofbiz.home") + "/" + this.catalinaRuntimeHome);

        // configure JNDI in the StandardServer
        StandardServer server = (StandardServer) ServerFactory.getServer();
        try {
            server.setGlobalNamingContext(new InitialContext());
        } catch (NamingException e) {
            throw new ContainerException(e);
        }

        // create the instance of Embedded
View Full Code Here

    private Engine engine;
    private List<Connector> connectors;

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

    private Engine engine;
    private List<Connector> connectors;

    public TomcatHessianRegistry() {
        final StandardServer standardServer = TomcatHelper.getServer();
        for (final Service service : standardServer.findServices()) {
            if (Engine.class.isInstance(service.getContainer())) {
                connectors = Arrays.asList(service.findConnectors());
                engine = Engine.class.cast(service.getContainer());
                break;
            }
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

            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.AFTER_STOP_EVENT.equals(type)) {
                contextListener.afterStop(standardServer);
            }
        }
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.