本文整理汇总了Java中org.apache.catalina.valves.ValveBase类的典型用法代码示例。如果您正苦于以下问题:Java ValveBase类的具体用法?Java ValveBase怎么用?Java ValveBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ValveBase类属于org.apache.catalina.valves包,在下文中一共展示了ValveBase类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValveObjectNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
public ObjectName[] getValveObjectNames() {
ArrayList<ObjectName> valveList = new ArrayList<ObjectName>();
Valve current = first;
if (current == null) {
current = basic;
}
while (current != null) {
if (current instanceof ValveBase) {
valveList.add(((ValveBase) current).getObjectName());
}
current = current.getNext();
}
return valveList.toArray(new ObjectName[0]);
}
示例2: unregisterValve
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
private void unregisterValve(Valve valve) {
if( valve instanceof ValveBase ) {
try {
ValveBase vb=(ValveBase)valve;
if( vb.getController()!=null &&
vb.getController() ==
((ContainerBase)container).getJmxName() ) {
ObjectName vname=vb.getObjectName();
Registry.getRegistry(null, null).getMBeanServer()
.unregisterMBean(vname);
((ValveBase)valve).setObjectName(null);
}
} catch( Throwable t ) {
log.info( "Can't unregister valve " + valve , t );
}
}
}
示例3: getValveObjectNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
public ObjectName[] getValveObjectNames() {
ArrayList valveList = new ArrayList();
Valve current = first;
if (current == null) {
current = basic;
}
while (current != null) {
if (current instanceof ValveBase) {
valveList.add(((ValveBase) current).getObjectName());
}
current = current.getNext();
}
return ((ObjectName[]) valveList.toArray(new ObjectName[0]));
}
示例4: getValveObjectNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
public ObjectName[] getValveObjectNames() {
ArrayList<ObjectName> valveList = new ArrayList<ObjectName>();
Valve current = first;
if (current == null) {
current = basic;
}
while (current != null) {
if (current instanceof ValveBase) {
valveList.add(((ValveBase) current).getObjectName());
}
current = current.getNext();
}
return valveList.toArray(new ObjectName[0]);
}
示例5: removeValve
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Remove an existing Valve.
*
* @param name MBean Name of the component to remove
*
* @exception Exception if a component cannot be removed
*/
public void removeValve(String name) throws Exception {
// Acquire a reference to the component to be removed
ObjectName oname = new ObjectName(name);
ContainerBase container = getParentContainerFromChild(oname);
Valve[] valves = container.getPipeline().getValves();
for (int i = 0; i < valves.length; i++) {
ObjectName voname = ((ValveBase) valves[i]).getObjectName();
if (voname.equals(oname)) {
container.getPipeline().removeValve(valves[i]);
}
}
}
示例6: getValveNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Return the MBean Names of the Valves associated with this Host
*
* @exception Exception if an MBean cannot be created or registered
*/
public String [] getValveNames()
throws Exception
{
Valve [] valves = this.getPipeline().getValves();
String [] mbeanNames = new String[valves.length];
for (int i = 0; i < valves.length; i++) {
if( valves[i] == null ) continue;
if( ((ValveBase)valves[i]).getObjectName() == null ) continue;
mbeanNames[i] = ((ValveBase)valves[i]).getObjectName().toString();
}
return mbeanNames;
}
示例7: removeValve
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Remove an existing Valve.
*
* @param name MBean Name of the comonent to remove
*
* @exception Exception if a component cannot be removed
*/
public void removeValve(String name) throws Exception {
// Acquire a reference to the component to be removed
ObjectName oname = new ObjectName(name);
ContainerBase container = getParentContainerFromChild(oname);
String sequence = oname.getKeyProperty("seq");
Valve[] valves = (Valve[])container.getValves();
for (int i = 0; i < valves.length; i++) {
ObjectName voname = ((ValveBase) valves[i]).getObjectName();
if (voname.equals(oname)) {
container.removeValve(valves[i]);
}
}
}
示例8: registerValve
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
private void registerValve(Valve valve) {
if( valve instanceof ValveBase &&
((ValveBase)valve).getObjectName()==null ) {
try {
String domain=((ContainerBase)container).getDomain();
if( container instanceof StandardContext ) {
domain=((StandardContext)container).getEngineName();
}
if( container instanceof StandardWrapper) {
Container ctx=((StandardWrapper)container).getParent();
domain=((StandardContext)ctx).getEngineName();
}
ObjectName vname=((ValveBase)valve).createObjectName(
domain,
((ContainerBase)container).getJmxName());
if( vname != null ) {
((ValveBase)valve).setObjectName(vname);
Registry.getRegistry(null, null).registerComponent
(valve, vname, valve.getClass().getName());
((ValveBase)valve).setController
(((ContainerBase)container).getJmxName());
}
} catch( Throwable t ) {
log.info( "Can't register valve " + valve , t );
}
}
}
示例9: getValveNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Return the MBean Names of the Valves assoicated with this Host
*
* @exception Exception if an MBean cannot be created or registered
*/
public String [] getValveNames()
throws Exception
{
Valve [] valves = this.getValves();
String [] mbeanNames = new String[valves.length];
for (int i = 0; i < valves.length; i++) {
if( valves[i] == null ) continue;
if( ((ValveBase)valves[i]).getObjectName() == null ) continue;
mbeanNames[i] = ((ValveBase)valves[i]).getObjectName().toString();
}
return mbeanNames;
}
示例10: removeValve
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Remove an existing Valve.
*
* @param name
* MBean Name of the component to remove
*
* @exception Exception
* if a component cannot be removed
*/
public void removeValve(String name) throws Exception {
// Acquire a reference to the component to be removed
ObjectName oname = new ObjectName(name);
ContainerBase container = getParentContainerFromChild(oname);
Valve[] valves = container.getPipeline().getValves();
for (int i = 0; i < valves.length; i++) {
ObjectName voname = ((ValveBase) valves[i]).getObjectName();
if (voname.equals(oname)) {
container.getPipeline().removeValve(valves[i]);
}
}
}
示例11: getValveNames
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
/**
* Return the MBean Names of the Valves associated with this Host
*
* @exception Exception
* if an MBean cannot be created or registered
*/
public String[] getValveNames() throws Exception {
Valve[] valves = this.getPipeline().getValves();
String[] mbeanNames = new String[valves.length];
for (int i = 0; i < valves.length; i++) {
if (valves[i] == null)
continue;
if (((ValveBase) valves[i]).getObjectName() == null)
continue;
mbeanNames[i] = ((ValveBase) valves[i]).getObjectName().toString();
}
return mbeanNames;
}
示例12: TomcatLoginImpl
import org.apache.catalina.valves.ValveBase; //导入依赖的package包/类
TomcatLoginImpl(ValveBase valve, Request request)
{
this.valve = valve;
this.request = request;
}