當前位置: 首頁>>代碼示例>>Java>>正文


Java Host.findAliases方法代碼示例

本文整理匯總了Java中org.apache.catalina.Host.findAliases方法的典型用法代碼示例。如果您正苦於以下問題:Java Host.findAliases方法的具體用法?Java Host.findAliases怎麽用?Java Host.findAliases使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.catalina.Host的用法示例。


在下文中一共展示了Host.findAliases方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: list

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer Writer to render to
 */
protected void list(PrintWriter writer, StringManager smClient) {

    if (debug >= 1) {
        log(sm.getString("hostManagerServlet.list", engine.getName()));
    }

    writer.println(smClient.getString("hostManagerServlet.listed",
            engine.getName()));
    Container[] hosts = engine.findChildren();
    for (int i = 0; i < hosts.length; i++) {
        Host host = (Host) hosts[i];
        String name = host.getName();
        String[] aliases = host.findAliases();
        StringBuilder buf = new StringBuilder();
        if (aliases.length > 0) {
            buf.append(aliases[0]);
            for (int j = 1; j < aliases.length; j++) {
                buf.append(',').append(aliases[j]);
            }
        }
        writer.println(smClient.getString("hostManagerServlet.listitem",
                                    name, buf.toString()));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:30,代碼來源:HostManagerServlet.java

示例2: registerHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Register host.
 */
private void registerHost(Host host) {

    String[] aliases = host.findAliases();
    mapper.addHost(host.getName(), aliases, host);

    for (Container container : host.findChildren()) {
        if (container.getState().isAvailable()) {
            registerContext((Context) container);
        }
    }
    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerHost",
                host.getName(), domain, connector));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:19,代碼來源:MapperListener.java

示例3: list

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer Writer to render to
 */
protected void list(PrintWriter writer) {

    if (debug >= 1)
        log("list: Listing hosts for engine '" 
            + engine.getName() + "'");

    writer.println(sm.getString("hostManagerServlet.listed",
                                engine.getName()));
    Container[] hosts = engine.findChildren();
    for (int i = 0; i < hosts.length; i++) {
        Host host = (Host) hosts[i];
        String name = host.getName();
        String[] aliases = host.findAliases();
        StringBuffer buf = new StringBuffer();
        if (aliases.length > 0) {
            buf.append(aliases[0]);
            for (int j = 1; j < aliases.length; j++) {
                buf.append(',').append(aliases[j]);
            }
        }
        writer.println(sm.getString("hostManagerServlet.listitem",
                                    name, buf.toString()));
    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:30,代碼來源:HostManagerServlet.java

示例4: registerHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Register host.
 */
private void registerHost(ObjectName objectName)
    throws Exception {
    String name=objectName.getKeyProperty("host");
    if( name != null ) {        
        Host host = (Host) ServerFactory.getServer().findService(
                domain).getContainer().findChild(name);
        String[] aliases = host.findAliases();
        mapper.addHost(name, aliases, objectName);
        host.addContainerListener(this);
        if(log.isDebugEnabled())
            log.debug(sm.getString
                 ("mapperListener.registerHost", name, domain));

    }
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:19,代碼來源:MapperListener.java

示例5: addHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Add a new child Host to our associated Engine.
 *
 * @param host Child host to add
 */
private void addHost(Host host) {

    if (debug >= 3)
        engine.log("Adding host '" + host.getName() + "'");

    host.addContainerListener(this);

    // Register the host name
    addAlias(host.getName(), host);

    // Register all associated aliases
    String aliases[] = host.findAliases();
    for (int i = 0; i < aliases.length; i++)
        addAlias(aliases[i], host);

}
 
開發者ID:c-rainstorm,項目名稱:jerrydog,代碼行數:22,代碼來源:FastEngineMapper.java

示例6: list

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Render a list of the currently active Contexts in our virtual host.
 *
 * @param writer
 *            Writer to render to
 */
protected void list(PrintWriter writer, StringManager smClient) {

	if (debug >= 1) {
		log(sm.getString("hostManagerServlet.list", engine.getName()));
	}

	writer.println(smClient.getString("hostManagerServlet.listed", engine.getName()));
	Container[] hosts = engine.findChildren();
	for (int i = 0; i < hosts.length; i++) {
		Host host = (Host) hosts[i];
		String name = host.getName();
		String[] aliases = host.findAliases();
		StringBuilder buf = new StringBuilder();
		if (aliases.length > 0) {
			buf.append(aliases[0]);
			for (int j = 1; j < aliases.length; j++) {
				buf.append(',').append(aliases[j]);
			}
		}
		writer.println(smClient.getString("hostManagerServlet.listitem", name, buf.toString()));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:29,代碼來源:HostManagerServlet.java

示例7: findDefaultHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
private void findDefaultHost() {

        Engine engine = (Engine) connector.getService().getContainer();
        String defaultHost = engine.getDefaultHost();

        boolean found = false;

        if (defaultHost != null && defaultHost.length() >0) {
            Container[] containers = engine.findChildren();

            for (Container container : containers) {
                Host host = (Host) container;
                if (defaultHost.equalsIgnoreCase(host.getName())) {
                    found = true;
                    break;
                }

                String[] aliases = host.findAliases();
                for (String alias : aliases) {
                    if (defaultHost.equalsIgnoreCase(alias)) {
                        found = true;
                        break;
                    }
                }
            }
        }

        if(found) {
            mapper.setDefaultHostName(defaultHost);
        } else {
            log.warn(sm.getString("mapperListener.unknownDefaultHost",
                    defaultHost, connector));
        }
    }
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:35,代碼來源:MapperListener.java

示例8: getHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Return the host and its alias list with which the context is associated.
 * 
 * @param context
 * @return
 */
protected String getHost(Context context) {
    StringBuffer result = new StringBuffer();
    Host host = (Host) context.getParent();
    result.append(host.getName());
    String[] aliases = host.findAliases();
    for (int i = 0; i < aliases.length; i++) {
        result.append(',');
        result.append(aliases[i]);
    }
    return result.toString();
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:18,代碼來源:ClusterListener.java

示例9: findDefaultHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
private void findDefaultHost() {

        Engine engine = (Engine) connector.getService().getContainer();
        String defaultHost = engine.getDefaultHost();

        boolean found = false;

        if (defaultHost != null && defaultHost.length() >0) {
            Container[] containers = engine.findChildren();

            for (Container container : containers) {
                Host host = (Host) container;
                if (defaultHost.equalsIgnoreCase(host.getName())) {
                    found = true;
                    break;
                }

                String[] aliases = host.findAliases();
                for (String alias : aliases) {
                    if (defaultHost.equalsIgnoreCase(alias)) {
                        found = true;
                        break;
                    }
                }
            }
        }

        if(found) {
            // localhost
            mapper.setDefaultHostName(defaultHost);
        } else {
            log.warn(sm.getString("mapperListener.unknownDefaultHost",
                    defaultHost, connector));
        }
    }
 
開發者ID:sunmingshuai,項目名稱:apache-tomcat-7.0.73-with-comment,代碼行數:36,代碼來源:MapperListener.java

示例10: findDefaultHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
private void findDefaultHost() {

		Engine engine = (Engine) connector.getService().getContainer();
		String defaultHost = engine.getDefaultHost();

		boolean found = false;

		if (defaultHost != null && defaultHost.length() > 0) {
			Container[] containers = engine.findChildren();

			for (Container container : containers) {
				Host host = (Host) container;
				if (defaultHost.equalsIgnoreCase(host.getName())) {
					found = true;
					break;
				}

				String[] aliases = host.findAliases();
				for (String alias : aliases) {
					if (defaultHost.equalsIgnoreCase(alias)) {
						found = true;
						break;
					}
				}
			}
		}

		if (found) {
			mapper.setDefaultHostName(defaultHost);
		} else {
			log.warn(sm.getString("mapperListener.unknownDefaultHost", defaultHost, connector));
		}
	}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:34,代碼來源:MapperListener.java

示例11: registerHost

import org.apache.catalina.Host; //導入方法依賴的package包/類
/**
 * Register host.
 */
private void registerHost(Host host) {

	String[] aliases = host.findAliases();
	mapper.addHost(host.getName(), aliases, host);

	for (Container container : host.findChildren()) {
		if (container.getState().isAvailable()) {
			registerContext((Context) container);
		}
	}
	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.registerHost", host.getName(), domain, connector));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:18,代碼來源:MapperListener.java


注:本文中的org.apache.catalina.Host.findAliases方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。