Package org.apache.catalina.core

Examples of org.apache.catalina.core.StandardServer


        tomcat.setBaseDir("target");
        String appBase = "../src/main/webapp";
        tomcat.getHost().setAppBase(".");
        String contextPath = "/" + artifactId;

        StandardServer server = (StandardServer)tomcat.getServer();
        server.setParentClassLoader(getMainClassLoader());
        AprLifecycleListener listener = new AprLifecycleListener();
        server.addLifecycleListener(listener);

        tomcat.addWebapp(contextPath, appBase);
        tomcat.start();
        tomcat.getServer().await();
    }
View Full Code Here


        if (useNaming) {
            tomcat.enableNaming();
        }

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

        // create the engines
View Full Code Here

            if (webappDir == null) {
                log.severe("Tuscany disabled as Tuscany webapp not found");
            } else {
                System.setProperty(TUSCANY_WAR_PROP, webappDir.getAbsolutePath());
                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

       
        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

  
  }

  protected void deployBpmPlatform(LifecycleEvent event) {
   
    final StandardServer server = (StandardServer) event.getSource();  
   
    containerDelegate.getServiceContainer().createDeploymentOperation("deploy BPM platform")
      .addAttachment(TomcatAttachments.SERVER, server)
      .addStep(new TomcatParseBpmPlatformXmlStep())
      .addStep(new StartManagedThreadPoolStep())
      .addStep(new StartJobExecutorStep())
      .addStep(new PlatformXmlStartProcessEnginesStep())
      .execute();
   
    LOGGER.log(Level.INFO, "camunda BPM platform" + " sucessfully started on "+server.getServerInfo()+".");
   
  }
View Full Code Here

  }
 

  protected void undeployBpmPlatform(LifecycleEvent event) {
   
    final StandardServer server = (StandardServer) event.getSource();  
   
    containerDelegate.getServiceContainer().createUndeploymentOperation("undeploy BPM platform")
      .addAttachment(TomcatAttachments.SERVER, server)
      .addStep(new StopProcessApplicationsStep())
      .addStep(new StopProcessEnginesStep())
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

    public void lifecycleEvent(LifecycleEvent event) {
        Object source = event.getSource();
        if (source instanceof StandardServer) {
            installed = true;
            StandardServer standardServer = (StandardServer) source;
            init(standardServer);
        }
    }
View Full Code Here

        // Perform normal superclass initialization
        super.start();

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

    /**
     * Return the singleton <code>Server</code> instance for this JVM.
     */
    public static Server getServer() {
        if( server==null )
            server=new StandardServer();
        return (server);

    }
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.