Package org.apache.catalina

Examples of org.apache.catalina.Service


        // Acquire a reference to the component to be removed
        ObjectName oname = new ObjectName(name);
        String serviceName = oname.getKeyProperty("serviceName");
        Server server = ServerFactory.getServer();
        Service service = server.findService(serviceName);

        // Remove this component from its parent component
        server.removeService(service);

    }
View Full Code Here


    private DefaultContext getDefaultContext(ObjectName pname)
        throws Exception {
       
        String type = pname.getKeyProperty("type");
        if (type.equals("DefaultContext")) {
            Service service = getService(pname);
            StandardEngine engine = (StandardEngine) service.getContainer();
            String hostName = pname.getKeyProperty("host");
            if (hostName!=null) {
                StandardHost host =
                    (StandardHost) engine.findChild(hostName);
                return host.getDefaultContext();
View Full Code Here

    private ContainerBase getParentContainerFromParent(ObjectName pname)
        throws Exception {
       
        String type = pname.getKeyProperty("type");
        String j2eeType = pname.getKeyProperty("j2eeType");
        Service service = getService(pname);
        StandardEngine engine = (StandardEngine) service.getContainer();
        if ((j2eeType!=null) && (j2eeType.equals("WebModule"))) {
            String name = pname.getKeyProperty("name");
            name = name.substring(2);
            int i = name.indexOf("/");
            String hostName = name.substring(0,i);
View Full Code Here

    private ContainerBase getParentContainerFromChild(ObjectName oname)
        throws Exception {
       
        String hostName = oname.getKeyProperty("host");
        String path = oname.getKeyProperty("path");
        Service service = getService(oname);
        StandardEngine engine = (StandardEngine) service.getContainer();
        if (hostName == null) {            
            // child's container is Engine
            return engine;
        } else if (path == null) {     
            // child's container is Host
View Full Code Here

            arglist3[0] = new String("org.apache.jk.server.JkCoyoteHandler");
            meth3.invoke(retobj, arglist3);

            // Add the new instance to its parent component
            ObjectName pname = new ObjectName(parent);
            Service service = getService(pname);
            service.addConnector((Connector)retobj);
            Method getObjectName = cls.getMethod("getObjectName", null);
           
            // Return the corresponding MBean name
            //ObjectName coname = (ObjectName)getObjectName.invoke(retobj, null);
            ObjectName coname =
View Full Code Here

        // Create a new StandardDefaultContext instance
        StandardDefaultContext context = new StandardDefaultContext();

        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Service service = getService(pname);      
        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

            Object arglist2[] = new Object[1];
            arglist2[0] = new Integer(port);
            meth2.invoke(retobj, arglist2);
            // Add the new instance to its parent component
            ObjectName pname = new ObjectName(parent);
            Service service = getService(pname);
            service.addConnector((Connector)retobj);
            Method getObjectName = cls.getMethod("getObjectName", null);
           
            // Return the corresponding MBean name
            //ObjectName coname = (ObjectName)getObjectName.invoke(retobj, null);
            ObjectName coname =
View Full Code Here

        }

        try {
            // Add the new instance to its parent component
            ObjectName pname = new ObjectName(parent);
            Service service = getService(pname);
            service.addConnector((Connector)retobj);
            Method getObjectName = cls.getMethod("getObjectName", null);
           
            // Return the corresponding MBean name
            //ObjectName coname = (ObjectName)getObjectName.invoke(retobj, null);
            ObjectName coname =
View Full Code Here

        ContextConfig contextConfig = new ContextConfig();
        context.addLifecycleListener(contextConfig);

        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Service service = getService(pname);
        Engine engine = (Engine) service.getContainer();
        Host host = (Host) engine.findChild(pname.getKeyProperty("host"));
        host.addChild(context);

        // Return the corresponding MBean name
        ObjectName oname =
View Full Code Here

        host.setXmlNamespaceAware(xmlNamespaceAware);
        host.setXmlValidation(xmlValidation);

        // Add the new instance to its parent component
        ObjectName pname = new ObjectName(parent);
        Service service = getService(pname);
        Engine engine = (Engine) service.getContainer();
        engine.addChild(host);

        // Return the corresponding MBean name
        return (host.getObjectName().toString());
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.