本文整理匯總了Java中org.apache.catalina.Container.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.getName方法的具體用法?Java Container.getName怎麽用?Java Container.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.catalina.Container
的用法示例。
在下文中一共展示了Container.getName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: logName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Return the abbreviated name of this container for logging messages
*/
protected String logName() {
if (logName != null) {
return logName;
}
String loggerName = null;
Container current = this;
while (current != null) {
String name = current.getName();
if ((name == null) || (name.equals(""))) {
name = "/";
} else if (name.startsWith("##")) {
name = "/" + name;
}
loggerName = "[" + name + "]" + ((loggerName != null) ? ("." + loggerName) : "");
current = current.getParent();
}
logName = ContainerBase.class.getName() + "." + loggerName;
return logName;
}
示例2: getDomain
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Determine the name of the domain to register MBeans for from a given
* Service.
*
* @param service
*
* @deprecated To be removed since to creates a circular dependency. Will
* be replaced in Tomcat 8 by a new method on {@link
* Service}.
*/
@Deprecated
public static String getDomain(Service service) {
// Null service -> return null
if (service == null) {
return null;
}
String domain = null;
Container engine = service.getContainer();
// Use the engine name first
if (engine != null) {
domain = engine.getName();
}
// No engine or no engine name, use the service name
if (domain == null) {
domain = service.getName();
}
// No service name, use null
return domain;
}
示例3: getDomain
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Determine the name of the domain to register MBeans for from a given
* Container.
*
* @param container
*
* @deprecated To be removed since to creates a circular dependency. Will be
* replaced in Tomcat 8 by a new method on {@link Container}.
*/
@Deprecated
public static String getDomain(Container container) {
String domain = null;
Container c = container;
while (!(c instanceof Engine) && c != null) {
c = c.getParent();
}
if (c != null) {
domain = c.getName();
}
return domain;
}
示例4: setContainer
import org.apache.catalina.Container; //導入方法依賴的package包/類
@Override
public void setContainer(Container container) {
super.setContainer(container);
if( appName==null ) {
String name = container.getName();
if (!name.startsWith("/")) {
name = "/" + name;
}
name = makeLegalForJAAS(name);
appName=name;
log.info("Set JAAS app name " + appName);
}
}
示例5: logName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Return the abbreviated name of this container for logging messages
*/
protected String logName() {
if (logName != null) {
return logName;
}
String loggerName = null;
Container current = this;
while (current != null) {
String name = current.getName();
if ((name == null) || (name.equals(""))) {
name = "/";
} else if (name.startsWith("##")) {
name = "/" + name;
}
loggerName = "[" + name + "]"
+ ((loggerName != null) ? ("." + loggerName) : "");
current = current.getParent();
}
logName = ContainerBase.class.getName() + "." + loggerName;
return logName;
}
示例6: getName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Return the name for this instance (built from container name)
*/
public String getName() {
if (name == null) {
Container container = manager.getContainer();
String contextName = container.getName();
String hostName = "";
String engineName = "";
if (container.getParent() != null) {
Container host = container.getParent();
hostName = host.getName();
if (host.getParent() != null) {
engineName = host.getParent().getName();
}
}
name = "/" + engineName + "/" + hostName + contextName;
}
return name;
}
示例7: logName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Return the abbreviated name of this container for logging messsages
*/
protected String logName() {
if (logName != null) {
return logName;
}
String loggerName = null;
Container current = this;
while (current != null) {
String name = current.getName();
if ((name == null) || (name.equals(""))) {
name = "/";
}
loggerName = "[" + name + "]"
+ ((loggerName != null) ? ("." + loggerName) : "");
current = current.getParent();
}
logName = ContainerBase.class.getName() + "." + loggerName;
return logName;
}
示例8: setContainer
import org.apache.catalina.Container; //導入方法依賴的package包/類
@Override
public void setContainer(Container container) {
super.setContainer(container);
if (appName == null) {
String name = container.getName();
if (!name.startsWith("/")) {
name = "/" + name;
}
name = makeLegalForJAAS(name);
appName = name;
log.info("Set JAAS app name " + appName);
}
}
示例9: log
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Log a message on the Logger associated with our Container (if any).
*
* @param message Message to be logged
*/
protected void log(String message) {
Logger logger = null;
Container container = manager.getContainer();
if (container != null)
logger = container.getLogger();
if (logger != null) {
logger.log(getStoreName()+"[" + container.getName() + "]: "
+ message);
} else {
String containerName = null;
if (container != null)
containerName = container.getName();
System.out.println(getStoreName()+"[" + containerName
+ "]: " + message);
}
}
示例10: addChildInternal
import org.apache.catalina.Container; //導入方法依賴的package包/類
private void addChildInternal(Container child) {
synchronized(children) {
if (children.get(child.getName()) != null)
throw new IllegalArgumentException("addChild: Child name '" +
child.getName() +
"' is not unique");
child.setParent((Container) this); // May throw IAE
if (started && (child instanceof Lifecycle)) {
try {
((Lifecycle) child).start();
} catch (LifecycleException e) {
log("ContainerBase.addChild: start: ", e);
throw new IllegalStateException
("ContainerBase.addChild: start: " + e);
}
}
children.put(child.getName(), child);
fireContainerEvent(ADD_CHILD_EVENT, child);
}
}
示例11: getDomain
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Determine the name of the domain to register MBeans for from a given
* Container.
*
* @param container
*
* @deprecated To be removed since to creates a circular dependency. Will
* be replaced in Tomcat 8 by a new method on {@link
* Container}.
*/
@Deprecated
public static String getDomain(Container container) {
String domain = null;
Container c = container;
while (!(c instanceof Engine) && c != null) {
c = c.getParent();
}
if (c != null) {
domain = c.getName();
}
return domain;
}
示例12: getName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* @return the name for this instance (built from container name)
*/
public String getName() {
if (name == null) {
Container container = manager.getContainer();
String contextName = container.getName();
if (!contextName.startsWith("/")) {
contextName = "/" + contextName;
}
String hostName = "";
String engineName = "";
if (container.getParent() != null) {
Container host = container.getParent();
hostName = host.getName();
if (host.getParent() != null) {
engineName = host.getParent().getName();
}
}
name = "/" + engineName + "/" + hostName + contextName;
}
return name;
}
示例13: getManagerName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* @param name
* @param manager
* @return TODO
*/
@Override
public String getManagerName(String name, Manager manager) {
String clusterName = name ;
if (clusterName == null) clusterName = manager.getContainer().getName();
if (getContainer() instanceof Engine) {
Context context = (Context) manager.getContainer() ;
Container host = context.getParent();
if (host instanceof Host && clusterName != null &&
!(clusterName.startsWith(host.getName() +"#"))) {
clusterName = host.getName() +"#" + clusterName ;
}
}
return clusterName;
}
示例14: getHostname
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* @deprecated Unused. Will be removed in Tomcat 8.0.x.
*/
@Deprecated
public String getHostname() {
Container parentHost = getParent();
if (parentHost != null) {
hostName = parentHost.getName();
}
if ((hostName == null) || (hostName.length() < 1))
hostName = "_";
return hostName;
}
示例15: addChildInternal
import org.apache.catalina.Container; //導入方法依賴的package包/類
private void addChildInternal(Container child) {
if( log.isDebugEnabled() )
log.debug("Add child " + child + " " + this);
synchronized(children) {
if (children.get(child.getName()) != null)
throw new IllegalArgumentException("addChild: Child name '" +
child.getName() +
"' is not unique");
child.setParent(this); // May throw IAE
children.put(child.getName(), child);
}
// Start child
// Don't do this inside sync block - start can be a slow process and
// locking the children object can cause problems elsewhere
try {
if ((getState().isAvailable() ||
LifecycleState.STARTING_PREP.equals(getState())) &&
startChildren) {
child.start();
}
} catch (LifecycleException e) {
log.error("ContainerBase.addChild: start: ", e);
throw new IllegalStateException("ContainerBase.addChild: start: " + e);
} finally {
fireContainerEvent(ADD_CHILD_EVENT, child);
}
}