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