use of org.apache.catalina.Valve in project tomcat70 by apache.
the class StandardPipeline method getValveObjectNames.
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]);
}
use of org.apache.catalina.Valve in project tomcat70 by apache.
the class StandardPipeline method stopInternal.
/**
* Stop {@link Valve}s) in this pipeline and implement the requirements
* of {@link LifecycleBase#stopInternal()}.
*
* @exception LifecycleException if this component detects a fatal error
* that prevents this component from being used
*/
@Override
protected synchronized void stopInternal() throws LifecycleException {
setState(LifecycleState.STOPPING);
// Stop the Valves in our pipeline (including the basic), if any
Valve current = first;
if (current == null) {
current = basic;
}
while (current != null) {
if (current instanceof Lifecycle)
((Lifecycle) current).stop();
current = current.getNext();
}
}
use of org.apache.catalina.Valve in project tomcat70 by apache.
the class ContainerBase method getAccessLog.
@Override
public AccessLog getAccessLog() {
if (accessLogScanComplete) {
return accessLog;
}
AccessLogAdapter adapter = null;
Valve[] valves = getPipeline().getValves();
for (Valve valve : valves) {
if (valve instanceof AccessLog) {
if (adapter == null) {
adapter = new AccessLogAdapter((AccessLog) valve);
} else {
adapter.add((AccessLog) valve);
}
}
}
if (adapter != null) {
accessLog = adapter;
}
accessLogScanComplete = true;
return accessLog;
}
use of org.apache.catalina.Valve in project tomcat70 by apache.
the class StandardContext method getAuthenticator.
@Override
public Authenticator getAuthenticator() {
if (this instanceof Authenticator)
return (Authenticator) this;
Pipeline pipeline = getPipeline();
if (pipeline != null) {
Valve basic = pipeline.getBasic();
if ((basic != null) && (basic instanceof Authenticator))
return (Authenticator) basic;
Valve[] valves = pipeline.getValves();
for (int i = 0; i < valves.length; i++) {
if (valves[i] instanceof Authenticator)
return (Authenticator) valves[i];
}
}
return null;
}
use of org.apache.catalina.Valve in project tomcat70 by apache.
the class StandardHost method startInternal.
/**
* 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 {
// Set error report valve
String errorValve = getErrorReportValveClass();
if ((errorValve != null) && (!errorValve.equals(""))) {
try {
boolean found = false;
Valve[] valves = getPipeline().getValves();
for (Valve valve : valves) {
if (errorValve.equals(valve.getClass().getName())) {
found = true;
break;
}
}
if (!found) {
Valve valve = (Valve) Class.forName(errorValve).getDeclaredConstructor().newInstance();
getPipeline().addValve(valve);
}
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.error(sm.getString("standardHost.invalidErrorReportValveClass", errorValve), t);
}
}
super.startInternal();
}
Aggregations