Package org.apache.catalina

Examples of org.apache.catalina.Engine


        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        String type = pname.getKeyProperty("type");
        Server server = ServerFactory.getServer();
        Service service = server.findService(pname.getKeyProperty("service"));
        Engine engine = (Engine) service.getContainer();
        if (type.equals("Context")) {
            Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
            String pathStr = getPathStr(pname.getKeyProperty("path"));
            Context context = (Context) host.findChild(pathStr);
            context.setRealm(realm);
        } else if (type.equals("Engine")) {
            engine.setRealm(realm);
        } else if (type.equals("Host")) {
            Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
            host.setRealm(realm);
        }

        // Return the corresponding MBean name
        ManagedBean managed = registry.findManagedBean("UserDatabaseRealm");
View Full Code Here


        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Server server = ServerFactory.getServer();
        String type = pname.getKeyProperty("type");
        Service service = server.findService(pname.getKeyProperty("service"));
        Engine engine = (Engine) service.getContainer();
        if ((type != null) && (type.equals("Context"))) {
            Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
            String pathStr = getPathStr(pname.getKeyProperty("path"));
            Context context = (Context) host.findChild(pathStr);
            context.setLoader(loader);
        } else if ((type != null) && (type.equals("DefaultContext"))) {
            String hostName = pname.getKeyProperty("host");
            DefaultContext defaultContext = null;
            if (hostName == null) {
                defaultContext = engine.getDefaultContext();
            } else {
                Host host = (Host)engine.findChild(hostName);
                defaultContext = host.getDefaultContext();
            }
            if (defaultContext != null ){
                loader.setDefaultContext(defaultContext);
                defaultContext.setLoader(loader);
View Full Code Here

        String serviceName = oname.getKeyProperty("service");
        String hostName = oname.getKeyProperty("host");
        String contextName = getPathStr(oname.getKeyProperty("path"));
        Server server = ServerFactory.getServer();
        Service service = server.findService(serviceName);
        Engine engine = (Engine) service.getContainer();
        Host host = (Host) engine.findChild(hostName);
        Context context = (Context) host.findChild(contextName);

        // Remove this component from its parent component
        host.removeChild(context);
View Full Code Here

        ObjectName oname = new ObjectName(name);
        String serviceName = oname.getKeyProperty("service");
        String hostName = oname.getKeyProperty("host");
        Server server = ServerFactory.getServer();
        Service service = server.findService(serviceName);
        Engine engine = (Engine) service.getContainer();
        Host host = (Host) engine.findChild(hostName);

        // Remove this component from its parent component
        engine.removeChild(host);

    }
View Full Code Here

        ObjectName oname = new ObjectName(name);
        String type = oname.getKeyProperty("type");
        String serviceName = oname.getKeyProperty("service");
        Server server = ServerFactory.getServer();
        Service service = server.findService(serviceName);
        Engine engine = (Engine) service.getContainer()
        String hostName = oname.getKeyProperty("host");
        if ((type != null) && (type.equals("Loader"))) {     
            String contextName = getPathStr(oname.getKeyProperty("path"));
            Host host = (Host) engine.findChild(hostName);
            Context context = (Context) host.findChild(contextName);
            // Remove this component from its parent component
            context.setLoader(null);
        } else if ((type != null) && (type.equals("DefaultLoader"))) {
            DefaultContext defaultContext = null;
            if (hostName == null) {   
                defaultContext = engine.getDefaultContext();
            } else {
                Host host = (Host) engine.findChild(hostName);
                defaultContext = host.getDefaultContext();
            }
            if (defaultContext != null) {
                // Remove this component from its parent component
                defaultContext.setLoader(null);
View Full Code Here

        ObjectName oname = new ObjectName(name);
        String type = oname.getKeyProperty("type");
        String serviceName = oname.getKeyProperty("service");
        Server server = ServerFactory.getServer();
        Service service = server.findService(serviceName);
        Engine engine = (Engine) service.getContainer()
        String hostName = oname.getKeyProperty("host");
        if ((type != null) && (type.equals("Manager"))) {     
            String contextName = getPathStr(oname.getKeyProperty("path"));
            Host host = (Host) engine.findChild(hostName);
            Context context = (Context) host.findChild(contextName);
            // Remove this component from its parent component
            context.setManager(null);
        } else if ((type != null) && (type.equals("DefaultManager"))) {
            DefaultContext defaultContext = null;
            if (hostName == null) {   
                defaultContext = engine.getDefaultContext();
            } else {
                Host host = (Host) engine.findChild(hostName);
                defaultContext = host.getDefaultContext();
            }
            if (defaultContext != null) {
                // Remove this component from its parent component
                defaultContext.setManager(null);
View Full Code Here

        String fileSeparator = System.getProperty("file.separator");
        if (!tmpDir.endsWith(fileSeparator))
            tmpDir = tmpDir + fileSeparator;
        tomcatServer.setCatalinaHome(tmpDir + "tomcat");

        final Engine engine = tomcatServer.createEngine();
        engine.setDefaultHost("localhost");

        final Host host = tomcatServer.createHost("localhost", expandedPath);
        engine.addChild(host);

        final Context context = tomcatServer.createContext(contextPath, expandedPath);

        // Without a servlet the filter will not get run.
        final Wrapper wrapper = context.createWrapper();
View Full Code Here

        for (int j = 0; j < connectors.length; j++) {
            createMBeans(connectors[j]);
        }

        // Create the MBean for the associated Engine and friends
        Engine engine = (Engine) service.getContainer();
        if (engine != null) {
            createMBeans(engine);
        }

    }
View Full Code Here

     * @exception Exception if an exception is thrown during MBean destruction
     */
    protected void destroyMBeans(Service service) throws Exception {

        // Deregister the MBeans for the associated Engine
        Engine engine = (Engine) service.getContainer();
        if (engine != null) {
            destroyMBeans(engine);
        }

        // Deregister the MBeans for the corresponding Connectors
View Full Code Here

        // Find any components that have already been initialized since the
        // MBean listener won't be notified as those components will have
        // already registered their MBeans
        findDefaultHost();
       
        Engine engine = (Engine) connector.getService().getContainer();
        addListeners(engine);
       
        Container[] conHosts = engine.findChildren();
        for (Container conHost : conHosts) {
            Host host = (Host) conHost;
            if (!LifecycleState.NEW.equals(host.getState())) {
                // Registering the host will register the context and wrappers
                registerHost(host);
View Full Code Here

TOP

Related Classes of org.apache.catalina.Engine

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.