| Method from org.apache.catalina.core.ApplicationFilterChain Detail: |
void addFilter(ApplicationFilterConfig filterConfig) {
if (n == filters.length) {
ApplicationFilterConfig[] newFilters =
new ApplicationFilterConfig[n + INCREMENT];
System.arraycopy(filters, 0, newFilters, 0, n);
filters = newFilters;
}
filters[n++] = filterConfig;
}
Add a filter to the set of filters that will be executed in this chain. |
public void doFilter(ServletRequest request,
ServletResponse response) throws IOException, ServletException {
if( Globals.IS_SECURITY_ENABLED ) {
final ServletRequest req = request;
final ServletResponse res = response;
try {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction() {
public Object run()
throws ServletException, IOException {
internalDoFilter(req,res);
return null;
}
}
);
} catch( PrivilegedActionException pe) {
Exception e = pe.getException();
if (e instanceof ServletException)
throw (ServletException) e;
else if (e instanceof IOException)
throw (IOException) e;
else if (e instanceof RuntimeException)
throw (RuntimeException) e;
else
throw new ServletException(e.getMessage(), e);
}
} else {
internalDoFilter(request,response);
}
}
Invoke the next filter in this chain, passing the specified request
and response. If there are no more filters in this chain, invoke
the service() method of the servlet itself. |
public void doFilterEvent(CometEvent event) throws IOException, ServletException {
if( Globals.IS_SECURITY_ENABLED ) {
final CometEvent ev = event;
try {
java.security.AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction() {
public Object run()
throws ServletException, IOException {
internalDoFilterEvent(ev);
return null;
}
}
);
} catch( PrivilegedActionException pe) {
Exception e = pe.getException();
if (e instanceof ServletException)
throw (ServletException) e;
else if (e instanceof IOException)
throw (IOException) e;
else if (e instanceof RuntimeException)
throw (RuntimeException) e;
else
throw new ServletException(e.getMessage(), e);
}
} else {
internalDoFilterEvent(event);
}
}
Invoke the next filter in this chain, passing the specified request
and response. If there are no more filters in this chain, invoke
the service() method of the servlet itself. |
public static ServletRequest getLastServicedRequest() {
return (ServletRequest) lastServicedRequest.get();
}
The last request passed to a servlet for servicing from the current
thread. |
public static ServletResponse getLastServicedResponse() {
return (ServletResponse) lastServicedResponse.get();
}
The last response passed to a servlet for servicing from the current
thread. |
void release() {
for (int i = 0; i < n; i++) {
filters[i] = null;
}
n = 0;
pos = 0;
servlet = null;
support = null;
}
Release references to the filters and wrapper executed by this chain. |
void reuse() {
pos = 0;
}
Prepare for reuse of the filters and wrapper executed by this chain. |
void setServlet(Servlet servlet) {
this.servlet = servlet;
}
Set the servlet that will be executed at the end of this chain. |
void setSupport(InstanceSupport support) {
this.support = support;
}
Set the InstanceSupport object used for event notifications
for this filter chain. |