本文整理匯總了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()));
}
}
示例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()));
}
}
示例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()));
}
}
示例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));
}
}
示例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));
}
}
示例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"));
}
示例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"));
}