本文整理汇总了Java中org.apache.catalina.Contained类的典型用法代码示例。如果您正苦于以下问题:Java Contained类的具体用法?Java Contained怎么用?Java Contained使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Contained类属于org.apache.catalina包,在下文中一共展示了Contained类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: destroyMBean
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Deregister the MBean for this
* <code>Valve</code> object.
*
* @param valve The Valve to be managed
*
* @exception Exception if an MBean cannot be deregistered
* @deprecated Unused. Will be removed in Tomcat 8.0.x
*/
@Deprecated
static void destroyMBean(Valve valve, Container container)
throws Exception {
((Contained)valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained)valve).setContainer(null);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
if( mserver.isRegistered(oname) ) {
mserver.unregisterMBean(oname);
}
}
示例2: destroyMBean
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Deregister the MBean for this
* <code>Valve</code> object.
*
* @param valve The Valve to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
static void destroyMBean(Valve valve, Container container)
throws Exception {
((Contained)valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained)valve).setContainer(null);
} catch (Throwable t) {
;
}
if( mserver.isRegistered(oname) ) {
mserver.unregisterMBean(oname);
}
}
示例3: destroyMBean
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Deregister the MBean for this
* <code>Valve</code> object.
*
* @param valve The Valve to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
public static void destroyMBean(Valve valve, Container container)
throws Exception {
((Contained)valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained)valve).setContainer(null);
} catch (Throwable t) {
;
}
mserver.unregisterMBean(oname);
}
示例4: addValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* <p>Add a new Valve to the end of the pipeline associated with this
* Container. Prior to adding the Valve, the Valve's
* <code>setContainer()</code> method will be called, if it implements
* <code>Contained</code>, with the owning Container as an argument.
* The method may throw an
* <code>IllegalArgumentException</code> if this Valve chooses not to
* be associated with this Container, or <code>IllegalStateException</code>
* if it is already associated with a different Container.</p>
*
* @param valve Valve to be added
*
* @exception IllegalArgumentException if this Container refused to
* accept the specified Valve
* @exception IllegalArgumentException if the specifie Valve refuses to be
* associated with this Container
* @exception IllegalStateException if the specified Valve is already
* associated with a different Container
*/
public void addValve(Valve valve) {
// Validate that we can add this Valve
if (valve instanceof Contained)
((Contained) valve).setContainer(this.container);
// Start the new component if necessary
if (started && (valve instanceof Lifecycle)) {
try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log("StandardPipeline.addValve: start: ", e);
}
}
// Add this Valve to the set associated with this Pipeline
synchronized (valves) {
Valve results[] = new Valve[valves.length +1];
System.arraycopy(valves, 0, results, 0, valves.length);
results[valves.length] = valve;
valves = results;
}
}
示例5: destroyMBean
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Deregister the MBean for this <code>Valve</code> object.
*
* @param valve
* The Valve to be managed
*
* @exception Exception
* if an MBean cannot be deregistered
* @deprecated Unused. Will be removed in Tomcat 8.0.x
*/
@Deprecated
static void destroyMBean(Valve valve, Container container) throws Exception {
((Contained) valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained) valve).setContainer(null);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
if (mserver.isRegistered(oname)) {
mserver.unregisterMBean(oname);
}
}
示例6: destroyMBean
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Deregister the MBean for this
* <code>Valve</code> object.
*
* @param valve The Valve to be managed
*
* @exception Exception if an MBean cannot be deregistered
*/
static void destroyMBean(Valve valve, Container container)
throws Exception {
((Contained)valve).setContainer(container);
String mname = createManagedName(valve);
ManagedBean managed = registry.findManagedBean(mname);
if (managed == null) {
return;
}
String domain = managed.getDomain();
if (domain == null)
domain = mserver.getDefaultDomain();
ObjectName oname = createObjectName(domain, valve);
try {
((Contained)valve).setContainer(null);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
if( mserver.isRegistered(oname) ) {
mserver.unregisterMBean(oname);
}
}
示例7: addValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* <p>Add a new Valve to the end of the pipeline associated with this
* Container. Prior to adding the Valve, the Valve's
* <code>setContainer()</code> method will be called, if it implements
* <code>Contained</code>, with the owning Container as an argument.
* The method may throw an
* <code>IllegalArgumentException</code> if this Valve chooses not to
* be associated with this Container, or <code>IllegalStateException</code>
* if it is already associated with a different Container.</p>
*
* @param valve Valve to be added
*
* @exception IllegalArgumentException if this Container refused to
* accept the specified Valve
* @exception IllegalArgumentException if the specified Valve refuses to be
* associated with this Container
* @exception IllegalStateException if the specified Valve is already
* associated with a different Container
*/
@Override
public void addValve(Valve valve) {
// Validate that we can add this Valve
if (valve instanceof Contained)
((Contained) valve).setContainer(this.container);
// Start the new component if necessary
if (getState().isAvailable()) {
if (valve instanceof Lifecycle) {
try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log.error("StandardPipeline.addValve: start: ", e);
}
}
}
// Add this Valve to the set associated with this Pipeline
if (first == null) {
first = valve;
valve.setNext(basic);
} else {
Valve current = first;
while (current != null) {
if (current.getNext() == basic) {
current.setNext(valve);
valve.setNext(basic);
break;
}
current = current.getNext();
}
}
container.fireContainerEvent(Container.ADD_VALVE_EVENT, valve);
}
示例8: addValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* <p>Add a new Valve to the end of the pipeline associated with this
* Container. Prior to adding the Valve, the Valve's
* <code>setContainer()</code> method will be called, if it implements
* <code>Contained</code>, with the owning Container as an argument.
* The method may throw an
* <code>IllegalArgumentException</code> if this Valve chooses not to
* be associated with this Container, or <code>IllegalStateException</code>
* if it is already associated with a different Container.</p>
*
* @param valve Valve to be added
*
* @exception IllegalArgumentException if this Container refused to
* accept the specified Valve
* @exception IllegalArgumentException if the specifie Valve refuses to be
* associated with this Container
* @exception IllegalStateException if the specified Valve is already
* associated with a different Container
*/
public void addValve(Valve valve) {
// Validate that we can add this Valve
if (valve instanceof Contained)
((Contained) valve).setContainer(this.container);
// Start the new component if necessary
if (started) {
if (valve instanceof Lifecycle) {
try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log.error("StandardPipeline.addValve: start: ", e);
}
}
// Register the newly added valve
registerValve(valve);
}
// Add this Valve to the set associated with this Pipeline
if (first == null) {
first = valve;
valve.setNext(basic);
} else {
Valve current = first;
while (current != null) {
if (current.getNext() == basic) {
current.setNext(valve);
valve.setNext(basic);
break;
}
current = current.getNext();
}
}
}
示例9: removeValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Remove the specified Valve from the pipeline associated with this
* Container, if it is found; otherwise, do nothing. If the Valve is
* found and removed, the Valve's <code>setContainer(null)</code> method
* will be called if it implements <code>Contained</code>.
*
* @param valve Valve to be removed
*/
public void removeValve(Valve valve) {
Valve current;
if(first == valve) {
first = first.getNext();
current = null;
} else {
current = first;
}
while (current != null) {
if (current.getNext() == valve) {
current.setNext(valve.getNext());
break;
}
current = current.getNext();
}
if (first == basic) first = null;
if (valve instanceof Contained)
((Contained) valve).setContainer(null);
// Stop this valve if necessary
if (started) {
if (valve instanceof Lifecycle) {
try {
((Lifecycle) valve).stop();
} catch (LifecycleException e) {
log.error("StandardPipeline.removeValve: stop: ", e);
}
}
// Unregister the removed valave
unregisterValve(valve);
}
}
示例10: addValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* <p>
* Add a new Valve to the end of the pipeline associated with this
* Container. Prior to adding the Valve, the Valve's
* <code>setContainer()</code> method will be called, if it implements
* <code>Contained</code>, with the owning Container as an argument. The
* method may throw an <code>IllegalArgumentException</code> if this Valve
* chooses not to be associated with this Container, or
* <code>IllegalStateException</code> if it is already associated with a
* different Container.
* </p>
*
* @param valve
* Valve to be added
*
* @exception IllegalArgumentException
* if this Container refused to accept the specified Valve
* @exception IllegalArgumentException
* if the specified Valve refuses to be associated with this
* Container
* @exception IllegalStateException
* if the specified Valve is already associated with a
* different Container
*/
@Override
public void addValve(Valve valve) {
// Validate that we can add this Valve
if (valve instanceof Contained)
((Contained) valve).setContainer(this.container);
// Start the new component if necessary
if (getState().isAvailable()) {
if (valve instanceof Lifecycle) {
try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log.error("StandardPipeline.addValve: start: ", e);
}
}
}
// Add this Valve to the set associated with this Pipeline
if (first == null) {
first = valve;
valve.setNext(basic);
} else {
Valve current = first;
while (current != null) {
if (current.getNext() == basic) {
current.setNext(valve);
valve.setNext(basic);
break;
}
current = current.getNext();
}
}
container.fireContainerEvent(Container.ADD_VALVE_EVENT, valve);
}
示例11: addValve
import org.apache.catalina.Contained; //导入依赖的package包/类
public void addValve(Valve valve) {
if (valve instanceof Contained)
((Contained) valve).setContainer(this.container);
synchronized (valves) {
Valve results[] = new Valve[valves.length +1];
System.arraycopy(valves, 0, results, 0, valves.length);
results[valves.length] = valve;
valves = results;
}
}
示例12: setContainer
import org.apache.catalina.Contained; //导入依赖的package包/类
@Override
public void setContainer(final Container container) {
this.container = container;
if (delegate != null && Contained.class.isInstance(delegate)) {
Contained.class.cast(delegate).setContainer(container);
}
}
示例13: removeValve
import org.apache.catalina.Contained; //导入依赖的package包/类
/**
* Remove the specified Valve from the pipeline associated with this
* Container, if it is found; otherwise, do nothing. If the Valve is
* found and removed, the Valve's <code>setContainer(null)</code> method
* will be called if it implements <code>Contained</code>.
*
* @param valve Valve to be removed
*/
public void removeValve(Valve valve) {
synchronized (valves) {
// Locate this Valve in our list
int j = -1;
for (int i = 0; i < valves.length; i++) {
if (valve == valves[i]) {
j = i;
break;
}
}
if (j < 0)
return;
// Remove this valve from our list
Valve results[] = new Valve[valves.length - 1];
int n = 0;
for (int i = 0; i < valves.length; i++) {
if (i == j)
continue;
results[n++] = valves[i];
}
valves = results;
try {
if (valve instanceof Contained)
((Contained) valve).setContainer(null);
} catch (Throwable t) {
;
}
}
// Stop this valve if necessary
if (started && (valve instanceof Lifecycle)) {
try {
((Lifecycle) valve).stop();
} catch (LifecycleException e) {
log("StandardPipeline.removeValve: stop: ", e);
}
}
}
示例14: setBasic
import org.apache.catalina.Contained; //导入依赖的package包/类
public void setBasic(Valve valve) {
this.basic = valve;
((Contained) valve).setContainer(container);
}