本文整理匯總了Java中org.apache.catalina.Container.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.getParent方法的具體用法?Java Container.getParent怎麽用?Java Container.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.catalina.Container
的用法示例。
在下文中一共展示了Container.getParent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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;
}
示例3: getServer
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Return the Server object that is the ultimate parent for the container
* with which this Realm is associated. If the server cannot be found (eg
* because the container hierarchy is not complete), <code>null</code> is
* returned.
*/
protected Server getServer() {
Container c = container;
if (c instanceof Context) {
c = c.getParent();
}
if (c instanceof Host) {
c = c.getParent();
}
if (c instanceof Engine) {
Service s = ((Engine)c).getService();
if (s != null) {
return s.getServer();
}
}
return null;
}
示例4: 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;
}
示例5: startInternal
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Start this component and implement the requirements
* of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
*/
@Override
protected synchronized void startInternal() throws LifecycleException {
// Look up the SingleSignOn implementation in our request processing
// path, if there is one
Container parent = context.getParent();
while ((sso == null) && (parent != null)) {
Valve valves[] = parent.getPipeline().getValves();
for (int i = 0; i < valves.length; i++) {
if (valves[i] instanceof SingleSignOn) {
sso = (SingleSignOn) valves[i];
break;
}
}
if (sso == null)
parent = parent.getParent();
}
if (log.isDebugEnabled()) {
if (sso != null)
log.debug("Found SingleSignOn Valve at " + sso);
else
log.debug("No SingleSignOn Valve is present");
}
sessionIdGenerator = new StandardSessionIdGenerator();
sessionIdGenerator.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
sessionIdGenerator.setSecureRandomClass(getSecureRandomClass());
sessionIdGenerator.setSecureRandomProvider(getSecureRandomProvider());
super.startInternal();
}
示例6: getHostConfigPath
import org.apache.catalina.Container; //導入方法依賴的package包/類
protected String getHostConfigPath(String resourceName) {
StringBuffer result = new StringBuffer();
Container container = context;
Container host = null;
Container engine = null;
while (container != null) {
if (container instanceof Host)
host = container;
if (container instanceof Engine)
engine = container;
container = container.getParent();
}
if (engine != null) {
result.append(engine.getName()).append('/');
}
if (host != null) {
result.append(host.getName()).append('/');
}
result.append(resourceName);
return result.toString();
}
示例7: getNamingContextName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Get naming context full name.
*/
private String getNamingContextName() {
if (namingContextName == null) {
Container parent = getParent();
if (parent == null) {
namingContextName = getName();
} else {
Stack<String> stk = new Stack<String>();
StringBuilder buff = new StringBuilder();
while (parent != null) {
stk.push(parent.getName());
parent = parent.getParent();
}
while (!stk.empty()) {
buff.append("/" + stk.pop());
}
buff.append(getName());
namingContextName = buff.toString();
}
}
return namingContextName;
}
示例8: getNamingContextName
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Get naming context full name.
*/
private String getNamingContextName() {
if (namingContextName == null) {
Container parent = getParent();
if (parent == null) {
namingContextName = getName();
} else {
Stack stk = new Stack();
StringBuffer buff = new StringBuffer();
while (parent != null) {
stk.push(parent.getName());
parent = parent.getParent();
}
while (!stk.empty()) {
buff.append("/" + stk.pop());
}
buff.append(getName());
namingContextName = buff.toString();
}
}
return namingContextName;
}
示例9: 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;
}
示例10: getContainerKeyProperties
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Calculate the key properties string to be added to an object's
* {@link ObjectName} to indicate that it is associated with that container.
*
* @param container
* The container the object is associated with
* @return A string suitable for appending to the ObjectName
* @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 getContainerKeyProperties(Container container) {
Container c = container;
StringBuilder keyProperties = new StringBuilder();
int containerCount = 0;
// Work up container hierarchy, add a component to the name for
// each container
while (!(c instanceof Engine)) {
if (c instanceof Wrapper) {
keyProperties.append(",servlet=");
keyProperties.append(c.getName());
} else if (c instanceof Context) {
keyProperties.append(",context=");
ContextName cn = new ContextName(c.getName(), false);
keyProperties.append(cn.getDisplayName());
} else if (c instanceof Host) {
keyProperties.append(",host=");
keyProperties.append(c.getName());
} else if (c == null) {
// May happen in unit testing and/or some embedding scenarios
keyProperties.append(",container");
keyProperties.append(containerCount++);
keyProperties.append("=null");
break;
} else {
// Should never happen...
keyProperties.append(",container");
keyProperties.append(containerCount++);
keyProperties.append('=');
keyProperties.append(c.getName());
}
c = c.getParent();
}
return keyProperties.toString();
}
示例11: getContainerKeyProperties
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Calculate the key properties string to be added to an object's
* {@link ObjectName} to indicate that it is associated with that container.
*
* @param container The container the object is associated with
* @return A string suitable for appending to the ObjectName
* @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 getContainerKeyProperties(Container container) {
Container c = container;
StringBuilder keyProperties = new StringBuilder();
int containerCount = 0;
// Work up container hierarchy, add a component to the name for
// each container
while (!(c instanceof Engine)) {
if (c instanceof Wrapper) {
keyProperties.append(",servlet=");
keyProperties.append(c.getName());
} else if (c instanceof Context) {
keyProperties.append(",context=");
ContextName cn = new ContextName(c.getName(), false);
keyProperties.append(cn.getDisplayName());
} else if (c instanceof Host) {
keyProperties.append(",host=");
keyProperties.append(c.getName());
} else if (c == null) {
// May happen in unit testing and/or some embedding scenarios
keyProperties.append(",container");
keyProperties.append(containerCount++);
keyProperties.append("=null");
break;
} else {
// Should never happen...
keyProperties.append(",container");
keyProperties.append(containerCount++);
keyProperties.append('=');
keyProperties.append(c.getName());
}
c = c.getParent();
}
return keyProperties.toString();
}
示例12: startInternal
import org.apache.catalina.Container; //導入方法依賴的package包/類
@Override
protected synchronized void startInternal() throws LifecycleException {
Container c = getContainer();
while (c != null && !(c instanceof Engine)) {
c = c.getParent();
}
if (c instanceof Engine) {
engine = (Engine) c;
}
super.startInternal();
}
示例13: startInternal
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Start this component and implement the requirements of
* {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
*
* @exception LifecycleException
* if this component detects a fatal error that prevents this
* component from being used
*/
@Override
protected synchronized void startInternal() throws LifecycleException {
// Look up the SingleSignOn implementation in our request processing
// path, if there is one
Container parent = context.getParent();
while ((sso == null) && (parent != null)) {
Valve valves[] = parent.getPipeline().getValves();
for (int i = 0; i < valves.length; i++) {
if (valves[i] instanceof SingleSignOn) {
sso = (SingleSignOn) valves[i];
break;
}
}
if (sso == null)
parent = parent.getParent();
}
if (log.isDebugEnabled()) {
if (sso != null)
log.debug("Found SingleSignOn Valve at " + sso);
else
log.debug("No SingleSignOn Valve is present");
}
sessionIdGenerator = new StandardSessionIdGenerator();
sessionIdGenerator.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
sessionIdGenerator.setSecureRandomClass(getSecureRandomClass());
sessionIdGenerator.setSecureRandomProvider(getSecureRandomProvider());
super.startInternal();
}
示例14: getAppBase
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Get app base.
*/
protected String getAppBase() {
String appBase = null;
Container container = this;
while (container != null) {
if (container instanceof Host)
break;
container = container.getParent();
}
if (container != null) {
appBase = ((Host) container).getAppBase();
}
return appBase;
}
示例15: start
import org.apache.catalina.Container; //導入方法依賴的package包/類
/**
* Prepare for the beginning of active use of the public methods of this
* component. This method should be called after <code>configure()</code>,
* and before any of the public methods of the component are utilized.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
*/
public void start() throws LifecycleException {
// Validate and update our current component state
if (started)
throw new LifecycleException
(sm.getString("authenticator.alreadyStarted"));
lifecycle.fireLifecycleEvent(START_EVENT, null);
started = true;
// Look up the SingleSignOn implementation in our request processing
// path, if there is one
Container parent = context.getParent();
while ((sso == null) && (parent != null)) {
if (!(parent instanceof Pipeline)) {
parent = parent.getParent();
continue;
}
Valve valves[] = ((Pipeline) parent).getValves();
for (int i = 0; i < valves.length; i++) {
if (valves[i] instanceof SingleSignOn) {
sso = (SingleSignOn) valves[i];
break;
}
}
if (sso == null)
parent = parent.getParent();
}
if (log.isDebugEnabled()) {
if (sso != null)
log.debug("Found SingleSignOn Valve at " + sso);
else
log.debug("No SingleSignOn Valve is present");
}
}