Package org.apache.catalina

Examples of org.apache.catalina.Host


     
      if (manager instanceof AbstractJBossManager)
      {
         // TODO next 10+ lines just to create a 'name' that the AbstractJBossManager
         // impls don't even use
         Host host = null;
         Container container = context;
         while (host == null && container != null)
         {
            container = container.getParent();
            if (container instanceof Host)
            {
               host = (Host) container;
            }
         }
         String hostName = host.getName();
         String name = "//" + ((hostName == null) ? "localhost" : hostName) + webMetaData.getContextRoot();
        
         try
         {
            ((AbstractJBossManager) manager).init(name, webMetaData);
View Full Code Here


        embedded.setCatalinaHome(path);

        Engine engine = embedded.createEngine();
        engine.setDefaultHost("127.0.0.1");

        Host host = embedded.createHost("127.0.0.1", path);
        engine.addChild(host);

        Context c = embedded.createContext("/", path);
        c.setReloadable(false);
        Wrapper w = c.createWrapper();
        w.addMapping("/*");
        w.setServletClass(TomcatAtmosphereServlet.class.getName());
        w.setLoadOnStartup(0);

        c.addChild(w);
        host.addChild(c);

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
        embedded.addConnector(connector);
View Full Code Here

        embedded.setCatalinaHome(path);

        Engine engine = embedded.createEngine();
        engine.setDefaultHost("127.0.0.1");

        Host host = embedded.createHost("127.0.0.1", path);
        engine.addChild(host);

        Context c = embedded.createContext("/", path);
        c.setReloadable(false);
        Wrapper w = c.createWrapper();
        w.addMapping("/*");
        w.setServletClass(TomcatAtmosphereServlet.class.getName());
        w.setLoadOnStartup(0);
        //w.addInitParameter(CometSupport.MAX_INACTIVE, "20000");

        c.addChild(w);
        host.addChild(c);       

        Connector connector = embedded.createConnector("127.0.0.1",port,Http11NioProtocol.class.getName());
        connector.setContainer(host);
        embedded.addEngine(engine);
        embedded.addConnector(connector);
View Full Code Here

            engine.setCluster((Cluster)clusterGBean.getInternalObject());
        }
    }

    private void removeHost(ObjectRetriever objRetriever) {
        Host host = (Host)objRetriever.getInternalObject();
        engine.removeChild(host);
    }
View Full Code Here

        Host host = (Host)objRetriever.getInternalObject();
        engine.removeChild(host);
    }

    private void addHost(ObjectRetriever objRetriever) {
        Host host = (Host)objRetriever.getInternalObject();

        //If we didn't set a realm, then use the default
        if (host.getRealm() == null) {
            host.setRealm(engine.getRealm());
        }
        engine.addChild(host);
    }
View Full Code Here

public class WarpEngine extends StandardEngine {
    public Container map(Request request, boolean update) {
        if (Constants.DEBUG) this.log("Mapping request");
        if (request instanceof WarpRequest) {
            WarpRequest wreq = (WarpRequest)request;
            Host host = wreq.getHost();
            if (update) {
                if (request.getRequest().getServerName() == null) {
                    request.setServerName(host.getName());
                } else {
                    request.setServerName
                        (request.getRequest().getServerName());
                }
            }
View Full Code Here

        synchronized (connection.getConnector()) {

        Container container=connection.getConnector().getContainer();

        // the hostName should be in lowewr case (setName makes a toLowerCase).
        Host host=(Host)container.findChild(hostName.toLowerCase());
        if (host==null) {
            WarpHost whost=new WarpHost();
            whost.setName(hostName);
            whost.setParent(container);
            whost.setAppBase(connection.getConnector().getAppBase());
            whost.setDebug(connection.getConnector().getDebug());
            container.addChild(whost);
            host=whost;
            if (Constants.DEBUG)
                logger.debug("Created new host "+host.getName());
        } else if (Constants.DEBUG) {
            logger.debug("Reusing instance of Host \""+host.getName()+"\"");
        }

        // TODO: Set up mapping mechanism for performance

        if (applPath.endsWith("/"))
            applPath=applPath.substring(0,applPath.length()-1);

        Context appl=(Context)host.findChild(applPath);

        if (appl==null) {

            if (Constants.DEBUG)
                logger.debug("No application for \""+applPath+"\"");

            Deployer deployer=(Deployer)host;
            File file=new File(applName);
            if (!file.isAbsolute()) {
                file=new File(host.getAppBase()+File.separator+applName);
                if (!file.isAbsolute()) {
                     file=new File(System.getProperty("catalina.base"),
                                  host.getAppBase()+File.separator+applName);
                }
            }

            if (!file.exists()) {
                logger.log("Cannot find \""+file.getPath()+"\" for appl. \""+
                           applName+"\" host \""+host.getName()+"\"");
                return(null);
            }

            String path=file.getCanonicalPath();
            URL url=new URL("file",null,path);
View Full Code Here

        if ((uri == null) || (!uri.startsWith("/")))
            return (null);

        Context child = null;
        try {
            Host host = (Host) context.getParent();
            String mapuri = uri;
            while (true) {
                child = (Context) host.findChild(mapuri);
                if (child != null)
                    break;
                int slash = mapuri.lastIndexOf('/');
                if (slash < 0)
                    break;
View Full Code Here

                        ",name=" + quotedResourceName);
        } else if (container instanceof Context) {
            String contextName = ((Context)container).getName();
            if (!contextName.startsWith("/"))
                contextName = "/" + contextName;
            Host host = (Host) ((Context)container).getParent();
            name = new ObjectName(domain + ":type=DataSource" +
                    ",host=" + host.getName() +
                    ",context=" + contextName +
                    ",class=" + resource.getType() +
                    ",name=" + quotedResourceName);
        }
View Full Code Here

        if ((uri == null) || (!uri.startsWith("/")))
            return (null);

        Context child = null;
        try {
            Host host = (Host) context.getParent();
            String mapuri = uri;
            while (true) {
                child = (Context) host.findChild(mapuri);
                if (child != null)
                    break;
                int slash = mapuri.lastIndexOf('/');
                if (slash < 0)
                    break;
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.