Package org.apache.catalina

Examples of org.apache.catalina.Server


        File server1 = resolveFile(SERVER_1);
        FileReader in = new FileReader(server1);
        try {
            ServerType serverType = TomcatServerGBean.loadServerType(in);
            assertEquals(3, serverType.getListener().size());
            Server server = serverType.build(getClass().getClassLoader(), null);
            try {
                ((Lifecycle) server).start();
            } finally {
                ((Lifecycle) server).stop();
            }
View Full Code Here


            String name = entry.getKey().getLocalPart();
            properties.put(name, entry.getValue());
        }
        ObjectRecipe recipe = new ObjectRecipe(className, properties);
        recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
        Server instance = (Server) recipe.create(cl);
        instance.setPort(port);
        instance.setShutdown(shutdown);

        for (ListenerType listenerType : getListener()) {
            LifecycleListener listener = listenerType.getLifecycleListener(cl);
            instance.addLifecycleListener(listener);
        }

        NamingResources globalNamingResources = new NamingResources();
        if(getGlobalNamingResources().size() > 0) {
            logger.warn("All the resource settings in the server.xml are ignored, please use Geronimo deployment plan to define those configurations");
        }
        /*
        for (NamingResourcesType naming: getGlobalNamingResources()) {
            naming.merge(globalNamingResources, cl);
        }
        */
        instance.setGlobalNamingResources(globalNamingResources);

        for (ServiceType serviceType: getService()) {
            Service service = serviceType.getService(cl, kernel);
            instance.addService(service);
        }

        return instance;
    }
View Full Code Here

    }

    public void doStart() throws Exception {
        //Find all the access log valves and add them to the list
        //Valve could be added on Engine/Host/Context
        Server server = tomcatServer.getServer();
        accessLogValves = new LinkedList<AccessLogValve>();
        for(Service service : server.findServices()) {
            Container container = service.getContainer();
            searchAccessLogValves(container);
        }
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug(sm.getString("contextConfig.destroy"));
        }

        // Skip clearing the work directory if Tomcat is being shutdown
        Server s = getServer();
        if (s != null && !s.getState().isAvailable()) {
            return;
        }

        // Changed to getWorkPath per Bugzilla 35819.
        if (context instanceof StandardContext) {
View Full Code Here

        } catch (Throwable t) {
            ;
        }

        // Acquire global JNDI resources if available
        Server server = ServerFactory.getServer();
        if ((server != null) && (server instanceof StandardServer)) {
            global = ((StandardServer) server).getGlobalNamingContext();
        }

        // Calculate the directory into which we will be deploying applications
View Full Code Here

     *
     * @param path Optional context path to save
     */
    protected synchronized void save(PrintWriter writer, String path) {

        Server server = ServerFactory.getServer();

        if (!(server instanceof StandardServer)) {
            writer.println(sm.getString("managerServlet.saveFail", server));
            return;
        }
View Full Code Here

      Lifecycle lifecycle = event.getLifecycle();

      //
      if (lifecycle instanceof Server)
      {
         Server server = (Server)lifecycle;

         //
         Engine engine = getEngine(server);

         //
View Full Code Here

     *  by the persistence mechanism
     */
    public synchronized void store() throws InstanceNotFoundException,
        MBeanException, RuntimeOperationsException {

        Server server = ServerFactory.getServer();
        if (server instanceof StandardServer) {
            try {
                ((StandardServer) server).storeConfig();
            } catch (Exception e) {
                throw new MBeanException(e, "Error updating conf/server.xml");
View Full Code Here

        } catch (Throwable t) {
            ;
        }

        // Acquire global JNDI resources if available
        Server server = ServerFactory.getServer();
        if ((server != null) && (server instanceof StandardServer)) {
            global = ((StandardServer) server).getGlobalNamingContext();
        }

        // Calculate the directory into which we will be deploying applications
View Full Code Here

     *
     * @param path Optional context path to save
     */
    protected synchronized void save(PrintWriter writer, String path) {

        Server server = ServerFactory.getServer();

        if (!(server instanceof StandardServer)) {
            writer.println(sm.getString("managerServlet.saveFail", server));
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.catalina.Server

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.