Package org.apache.catalina

Examples of org.apache.catalina.Host


      Container[] childrenContainers = engine.findChildren();
      for (Container childContainer : childrenContainers)
      {
         if (childContainer instanceof Host)
         {
            Host host = (Host)childContainer;
            registerHost(host);
         }
      }

      //
View Full Code Here


      Container[] childrenContainers = engine.findChildren();
      for (Container childContainer : childrenContainers)
      {
         if (childContainer instanceof Host)
         {
            Host host = (Host)childContainer;
            unregisterHost(host);
         }
      }

      //
View Full Code Here

                context.setPath("");
                context.addLifecycleListener(new ContextConfig());
                context.setDocBase(pathInjector.getValue() + File.separatorChar + "welcome-content");

                final Loader loader = new WebCtxLoader(this.getClass().getClassLoader());
                Host host = hostInjector.getValue().getHost();
                loader.setContainer(host);
                context.setLoader(loader);
                context.setInstanceManager(new LocalInstanceManager(httpManagement));

                context.setReplaceWelcomeFiles(true);
                if (httpManagement != null) {
                    context.addWelcomeFile("index.html");
                } else {
                    context.addWelcomeFile("index_noconsole.html");
                }

                Wrapper wrapper = context.createWrapper();
                wrapper.setName("default");
                wrapper.setServletClass("org.apache.catalina.servlets.DefaultServlet");
                context.addChild(wrapper);

                context.addServletMapping("/", "default");
                context.addMimeMapping("html", "text/html");
                context.addMimeMapping("jpg", "image/jpeg");

                // Add the WelcomeContextConsoleServlet
                WelcomeContextConsoleServlet wccs = new WelcomeContextConsoleServlet(httpManagement);
                Wrapper wccsWrapper = context.createWrapper();
                wccsWrapper.setName("WelcomeContextConsoleServlet");
                wccsWrapper.setServlet(wccs);
                wccsWrapper.setServletClass(wccs.getClass().getName());
                context.addChild(wccsWrapper);

                context.addServletMapping("/console", "WelcomeContextConsoleServlet");

                host.addChild(context);
                context.create();
            } catch (Exception e) {
                throw new StartException(MESSAGES.createWelcomeContextFailed(), e);
            }
            try {
View Full Code Here

     */
    @Test
    public void testNewSessionIsOutdated() throws Exception {
        Engine engine = new MockEngine();
        engine.setName("jboss.web");
        Host host = new MockHost();
        host.setName("localhost");
        engine.addChild(host);
        StandardContext context = new StandardContext();
        context.setName("test");
        host.addChild(context);
       
        DistributableSessionManager<?> mgr = new DistributableSessionManager<OutgoingDistributableSessionData>(new MockDistributedCacheManagerFactory(), context, SessionTestUtil.createWebMetaData(10), new ContextClassResolver());
        context.setManager(mgr);
        mgr.start();

View Full Code Here

        factory.getLockManagerInjector().inject(((ExtendedCacheManager) cacheContainer).getLockManager());
       
        Engine engine = new MockEngine();
        engine.setName("jboss.web");
        engine.setJvmRoute(jvmRoute);
        Host host = new MockHost();
        host.setName("localhost");
        engine.addChild(host);
        StandardContext context = new StandardContext();
        context.setName(warName);
        context.setDomain(jvmRoute);
        host.addChild(context);

        try {
            DistributableSessionManager<OutgoingDistributableSessionData> manager = new DistributableSessionManager<OutgoingDistributableSessionData>(factory, context, metaData, new ContextClassResolver()) {
                @Override
                public void start() throws LifecycleException {
View Full Code Here

    public static ObjectName createObjectName(String domain,
                                              Context context)
        throws MalformedObjectNameException {

        ObjectName name = null;
        Host host = (Host)context.getParent();
        Service service = ((Engine)host.getParent()).getService();
        String path = context.getPath();
        if (path.length() < 1)
            path = "/";
        name = new ObjectName(domain + ":type=Context,path=" +
                              path + ",host=" +
                              host.getName() + ",service=" +
                              service.getName());
        return (name);

    }
View Full Code Here

    public static ObjectName createObjectName77(String domain,
                                                Context context)
        throws MalformedObjectNameException {

        ObjectName name = null;
        Host host = (Host)context.getParent();
        String path = context.getPath();
        if (path.length() < 1)
            path = "/";
        String localName= "//" +
                ((host.getName()==null)? "DEFAULT" : host.getName()) + path;
        name = new ObjectName(domain + ":j2eeType=WebModule,name=" +
                              localName + ",J2EEApplication=none,J2EEServer=none");
        return (name);
    }
View Full Code Here

                                              Wrapper wrapper)
            throws MalformedObjectNameException {

        ObjectName name = null;
        Context context=(Context)wrapper.getParent();
        Host host = (Host)context.getParent();
        String sname=wrapper.getJspFile();
        if( sname==null ) {
            sname=wrapper.getName();
        }
        String path = context.getPath();
        if (path.length() < 1)
            path = "/";
        String hostName=host.getName();
        String webMod="//" + ((hostName==null)? "DEFAULT" :hostName ) + path;
        name = new ObjectName(domain + ":j2eeType=Servlet,name=" +
                sname + ",WebModule=" +
                webMod + ",J2EEApplication=none,J2EEServer=none");
View Full Code Here

                        ",resourcetype=Global,name=" + environment.getName());
        } else if (container instanceof Context) {       
            String path = ((Context)container).getPath();
            if (path.length() < 1)
                path = "/";
            Host host = (Host) ((Context)container).getParent();
            Engine engine = (Engine) host.getParent();
            Service service = engine.getService();
            name = new ObjectName(domain + ":type=Environment" +
                        ",resourcetype=Context,path=" + path +
                        ",host=" + host.getName() +
                        ",service=" + service.getName() +
                        ",name=" + environment.getName());
        } else if (container instanceof DefaultContext) {
            container = ((DefaultContext)container).getParent();
            if (container instanceof Host) {
                Host host = (Host) container;
                Service service = ((Engine)host.getParent()).getService();
                name = new ObjectName(domain + ":type=Environment" +
                        ",resourcetype=HostDefaultContext,host=" + host.getName() +
                        ",service=" + service.getName() +
                        ",name=" + environment.getName());
            } else if (container instanceof Engine) {
                Engine engine = (Engine) container;
                Service service = engine.getService();
View Full Code Here

                        ",name=" + encodedResourceName);
        } else if (container instanceof Context) {                   
            String path = ((Context)container).getPath();
            if (path.length() < 1)
                path = "/";
            Host host = (Host) ((Context)container).getParent();
            Engine engine = (Engine) host.getParent();
            Service service = engine.getService();
            name = new ObjectName(domain + ":type=Resource" +
                        ",resourcetype=Context,path=" + path +
                        ",host=" + host.getName() +
                        ",service=" + service.getName() +
                        ",class=" + resource.getType() +
                        ",name=" + encodedResourceName);
        } else if (container instanceof DefaultContext) {           
            container = ((DefaultContext)container).getParent();
            if (container instanceof Host) {
                Host host = (Host) container;
                Service service = ((Engine)host.getParent()).getService();
                name = new ObjectName(domain + ":type=Resource" +
                        ",resourcetype=HostDefaultContext,host=" + host.getName() +
                        ",service=" + service.getName() +
                        ",class=" + resource.getType() +
                        ",name=" + encodedResourceName);
            } else if (container instanceof Engine) {
                Engine engine = (Engine) container;
View Full Code Here

TOP

Related Classes of org.apache.catalina.Host

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.