Package org.apache.catalina

Examples of org.apache.catalina.Service


        ObjectName name = null;
        Container container = realm.getContainer();

        if (container instanceof Engine) {
            Service service = ((Engine)container).getService();
            name = new ObjectName(domain + ":type=Realm,service=" +
                              service.getName());
        } else if (container instanceof Host) {
            Engine engine = (Engine) container.getParent();
            Service service = engine.getService();
            name = new ObjectName(domain + ":type=Realm,host=" +
                              container.getName() + ",service=" +
                              service.getName());
        } else if (container instanceof Context) {
            String path = ((Context)container).getPath();
            if (path.length() < 1) {
                path = "/";
            }
            Host host = (Host) container.getParent();
            Engine engine = (Engine) host.getParent();
            Service service = engine.getService();
            name = new ObjectName(domain + ":type=Realm,path=" + path +
                              ",host=" + host.getName() + ",service=" +
                              service.getName());
        }

        return (name);

    }
View Full Code Here


                               "Cannot create mbean for non-contained valve " +
                               valve);
        }

        if (container instanceof Engine) {
            Service service = ((Engine)container).getService();
            name = new ObjectName(domain + ":type=Valve,sequence=" +
                                  valve.hashCode() + ",service=" +
                                  service.getName());
        } else if (container instanceof Host) {
            Service service = ((Engine)container.getParent()).getService();
            name = new ObjectName(domain + ":type=Valve,sequence=" +
                                  valve.hashCode() + ",host=" +
                                  container.getName() + ",service=" +
                                  service.getName() );
        } else if (container instanceof Context) {
            String path = ((Context)container).getPath();
            if (path.length() < 1) {
                path = "/";
            }
            Host host = (Host) container.getParent();
            Service service = ((Engine) host.getParent()).getService();
            name = new ObjectName(domain + ":type=Valve,sequence=" +
                                  valve.hashCode() + ",path=" +
                                  path + ",host=" +
                                  host.getName() + ",service=" +
                                  service.getName());
        }

        return (name);

    }
View Full Code Here

        // 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);
            ((StandardContext)context).addValve(accessLogger);
View Full Code Here

        }

        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Server server = ServerFactory.getServer();
        Service service = server.findService(pname.getKeyProperty("name"));
        service.addConnector((Connector)retobj);

        // Return the corresponding MBean name
        ManagedBean managed = registry.findManagedBean("CoyoteConnector");
        ObjectName oname =
            MBeanUtils.createObjectName(managed.getDomain(), (Connector)retobj);
View Full Code Here

        Server server = ServerFactory.getServer();
        String serviceName = pname.getKeyProperty("service");
        if (serviceName == null) {
            serviceName = pname.getKeyProperty("name");
        }
        Service service = server.findService(serviceName);
        Engine engine = (Engine) service.getContainer();
        String hostName = pname.getKeyProperty("host");
        if (hostName == null) { //if DefaultContext is nested in Engine
            context.setParent(engine);
            engine.addDefaultContext(context);
        } else {                // if DefaultContext is nested in Host
View Full Code Here

        // 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.setLogger(fileLogger);
View Full Code Here

        }

        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Server server = ServerFactory.getServer();
        Service service = server.findService(pname.getKeyProperty("name"));
        service.addConnector((Connector)retobj);

        // Return the corresponding MBean name
        ManagedBean managed = registry.findManagedBean("CoyoteConnector");
        ObjectName oname =
            MBeanUtils.createObjectName(managed.getDomain(), (Connector)retobj);
View Full Code Here

        try {
            // Add the new instance to its parent component
            ObjectName pname = new ObjectName(parent);
            Server server = ServerFactory.getServer();
            Service service = server.findService(pname.getKeyProperty("name"));
            service.addConnector((Connector)retobj);
        } catch (Exception e) {
            // FIXME
            // disply error message
            // the user needs to use keytool to configure SSL first
            // addConnector will fail otherwise
View Full Code Here

        // 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);
View Full Code Here

        // 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);
View Full Code Here

TOP

Related Classes of org.apache.catalina.Service

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.