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


Java Host.getName方法代碼示例

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


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

示例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, 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

示例4: unregisterHost

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

    String hostname = host.getName();

    mapper.removeHost(hostname);

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.unregisterHost", hostname,
                domain, connector));
    }
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:15,代碼來源:MapperListener.java

示例5: unregisterHost

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

	String hostname = host.getName();

	mapper.removeHost(hostname);

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("mapperListener.unregisterHost", hostname, domain, connector));
	}
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:14,代碼來源:MapperListener.java

示例6: start

import org.apache.catalina.Host; //導入方法依賴的package包/類
@Override
public void start() throws Exception {
    if (started)
        return;
    Container hcontainer = getCluster().getContainer();
    if(!(hcontainer instanceof Host)) {
        log.error(sm.getString("farmWarDeployer.hostOnly"));
        return ;
    }
    host = (Host) hcontainer;

    // Check to correct engine and host setup
    Container econtainer = host.getParent();
    if(!(econtainer instanceof Engine)) {
        log.error(sm.getString("farmWarDeployer.hostParentEngine",
                host.getName())); 
        return ;
    }
    Engine engine = (Engine) econtainer;
    String hostname = null;
    hostname = host.getName();
    try {
        oname = new ObjectName(engine.getName() + ":type=Deployer,host="
                + hostname);
    } catch (Exception e) {
        log.error(sm.getString("farmWarDeployer.mbeanNameFail",
                engine.getName(), hostname),e);
        return;
    }
    if (watchEnabled) {
        watcher = new WarWatcher(this, getWatchDirFile());
        if (log.isInfoEnabled()) {
            log.info(sm.getString(
                    "farmWarDeployer.watchDir", getWatchDir()));
        }
    }

    if (host.getXmlBase()!=null) {
        configBase = getAbsolutePath(host.getXmlBase());
    } else {
        StringBuilder xmlDir = new StringBuilder("conf");
        xmlDir.append('/');
        xmlDir.append(engine.getName());
        xmlDir.append('/');
        xmlDir.append(host.getName());
        configBase = getAbsolutePath(xmlDir.toString());
    }

    // Retrieve the MBean server
    mBeanServer = Registry.getRegistry(null, null).getMBeanServer();

    started = true;
    count = 0;

    getCluster().addClusterListener(this);

    if (log.isInfoEnabled())
        log.info(sm.getString("farmWarDeployer.started"));
}
 
開發者ID:liaokailin,項目名稱:tomcat7,代碼行數:60,代碼來源:FarmWarDeployer.java

示例7: start

import org.apache.catalina.Host; //導入方法依賴的package包/類
@Override
public void start() throws Exception {
	if (started)
		return;
	Container hcontainer = getCluster().getContainer();
	if (!(hcontainer instanceof Host)) {
		log.error(sm.getString("farmWarDeployer.hostOnly"));
		return;
	}
	host = (Host) hcontainer;

	// Check to correct engine and host setup
	Container econtainer = host.getParent();
	if (!(econtainer instanceof Engine)) {
		log.error(sm.getString("farmWarDeployer.hostParentEngine", host.getName()));
		return;
	}
	Engine engine = (Engine) econtainer;
	String hostname = null;
	hostname = host.getName();
	try {
		oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + hostname);
	} catch (Exception e) {
		log.error(sm.getString("farmWarDeployer.mbeanNameFail", engine.getName(), hostname), e);
		return;
	}
	if (watchEnabled) {
		watcher = new WarWatcher(this, getWatchDirFile());
		if (log.isInfoEnabled()) {
			log.info(sm.getString("farmWarDeployer.watchDir", getWatchDir()));
		}
	}

	if (host.getXmlBase() != null) {
		configBase = getAbsolutePath(host.getXmlBase());
	} else {
		StringBuilder xmlDir = new StringBuilder("conf");
		xmlDir.append('/');
		xmlDir.append(engine.getName());
		xmlDir.append('/');
		xmlDir.append(host.getName());
		configBase = getAbsolutePath(xmlDir.toString());
	}

	// Retrieve the MBean server
	mBeanServer = Registry.getRegistry(null, null).getMBeanServer();

	started = true;
	count = 0;

	getCluster().addClusterListener(this);

	if (log.isInfoEnabled())
		log.info(sm.getString("farmWarDeployer.started"));
}
 
開發者ID:how2j,項目名稱:lazycat,代碼行數:56,代碼來源:FarmWarDeployer.java


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