Fields Summary |
---|
private static org.apache.juli.logging.Log | log |
protected org.apache.catalina.Container | containerThe Container whose pipeline this Valve is a component of. |
protected org.apache.juli.logging.Log | containerLogContainer log |
protected static String | infoDescriptive information about this Valve implementation. This value
should be overridden by subclasses. |
protected org.apache.catalina.Valve | nextThe next Valve in the pipeline this Valve is a component of. |
protected static final org.apache.catalina.util.StringManager | smThe string manager for this package. |
protected String | domain |
protected ObjectName | oname |
protected MBeanServer | mserver |
protected ObjectName | controller |
Methods Summary |
---|
public void | backgroundProcess()Execute a periodic task, such as reloading, etc. This method will be
invoked inside the classloading context of this container. Unexpected
throwables will be caught and logged.
|
public javax.management.ObjectName | createObjectName(java.lang.String domain, javax.management.ObjectName parent)
Container container=this.getContainer();
if( container == null || ! (container instanceof ContainerBase) )
return null;
this.containerLog = container.getLogger();
ContainerBase containerBase=(ContainerBase)container;
Pipeline pipe=containerBase.getPipeline();
Valve valves[]=pipe.getValves();
/* Compute the "parent name" part */
String parentName="";
if (container instanceof Engine) {
} else if (container instanceof Host) {
parentName=",host=" +container.getName();
} else if (container instanceof Context) {
String path = ((Context)container).getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) container.getParent();
parentName=",path=" + path + ",host=" +
host.getName();
} else if (container instanceof Wrapper) {
Context ctx = (Context) container.getParent();
String path = ctx.getPath();
if (path.length() < 1) {
path = "/";
}
Host host = (Host) ctx.getParent();
parentName=",servlet=" + container.getName() +
",path=" + path + ",host=" + host.getName();
}
log.debug("valve parent=" + parentName + " " + parent);
String className=this.getClass().getName();
int period = className.lastIndexOf('.");
if (period >= 0)
className = className.substring(period + 1);
int seq=0;
for( int i=0; i<valves.length; i++ ) {
// Find other valves with the same name
if (valves[i] == this) {
break;
}
if( valves[i]!=null &&
valves[i].getClass() == this.getClass() ) {
log.debug("Duplicate " + valves[i] + " " + this + " " + container);
seq++;
}
}
String ext="";
if( seq > 0 ) {
ext=",seq=" + seq;
}
ObjectName objectName =
new ObjectName( domain + ":type=Valve,name=" + className + ext + parentName);
log.debug("valve objectname = "+objectName);
return objectName;
|
public void | event(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response, org.apache.catalina.CometEvent event)Process a Comet event. This method will rarely need to be provided by
a subclass, unless it needs to reassociate a particular object with
the thread that is processing the request.
// Perform the request
getNext().event(request, response, event);
|
public org.apache.catalina.Container | getContainer()Return the Container with which this Valve is associated, if any.
//-------------------------------------------------------------- Properties
return (container);
|
public javax.management.ObjectName | getContainerName()
if( container== null) return null;
return ((ContainerBase)container).getJmxName();
|
public javax.management.ObjectName | getController()
return controller;
|
public java.lang.String | getDomain()
return domain;
|
public java.lang.String | getInfo()Return descriptive information about this Valve implementation.
return (info);
|
public org.apache.catalina.Valve | getNext()Return the next Valve in this pipeline, or null if this
is the last Valve in the pipeline.
return (next);
|
public javax.management.ObjectName | getObjectName()
return oname;
|
public javax.management.ObjectName | getParentName(javax.management.ObjectName valveName)From the name, extract the parent object name
return null;
|
public abstract void | invoke(org.apache.catalina.connector.Request request, org.apache.catalina.connector.Response response)The implementation-specific logic represented by this Valve. See the
Valve description for the normal design patterns for this method.
This method MUST be provided by a subclass.
|
public void | postDeregister()
|
public void | postRegister(java.lang.Boolean registrationDone)
|
public void | preDeregister()
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
oname=name;
mserver=server;
domain=name.getDomain();
return name;
|
public void | setContainer(org.apache.catalina.Container container)Set the Container with which this Valve is associated, if any.
this.container = container;
|
public void | setController(javax.management.ObjectName controller)
this.controller = controller;
|
public void | setNext(org.apache.catalina.Valve valve)Set the Valve that follows this one in the pipeline it is part of.
this.next = valve;
|
public void | setObjectName(javax.management.ObjectName oname)
this.oname = oname;
|
public java.lang.String | toString()Return a String rendering of this object.
StringBuffer sb = new StringBuffer(this.getClass().getName());
sb.append("[");
if (container != null)
sb.append(container.getName());
sb.append("]");
return (sb.toString());
|