*
* @return false to indicate an error, expected or not
*/
+ @Override
public boolean event(org.apache.coyote.Request req,
org.apache.coyote.Response res, SocketStatus status) {
}
}
- public boolean asyncDispatch(org.apache.coyote.Request req,org.apache.coyote.Response res, SocketStatus status) throws Exception {
+ @Override
+ public boolean asyncDispatch(org.apache.coyote.Request req,
+ org.apache.coyote.Response res, SocketStatus status) throws Exception {
Request request = (Request) req.getNote(ADAPTER_NOTES);
Response response = (Response) res.getNote(ADAPTER_NOTES);
if (request == null) {
- throw new IllegalStateException("Dispatch may only happen on an existing request.");
+ throw new IllegalStateException(
+ "Dispatch may only happen on an existing request.");
}
boolean comet = false;
boolean async = false;
/**
* Service method.
*/
+ @Override
public void service(org.apache.coyote.Request req,
org.apache.coyote.Response res)
throws Exception {
}
+ @Override
public void log(org.apache.coyote.Request req,
org.apache.coyote.Response res, long time) {
*
* @param name Name of the request attribute to return
*/
+ @Override
public Object getAttribute(String name) {
if (name.equals(Globals.DISPATCHER_TYPE_ATTR)) {
* Connector implementations may return some, all or none of these
* attributes and may also support additional attributes.
*/
+ @Override
public Enumeration<String> getAttributeNames() {
if (isSecure() && !sslAttributesParsed) {
getAttribute(Globals.CERTIFICATES_ATTR);
/**
* Return the character encoding for this Request.
*/
+ @Override
public String getCharacterEncoding() {
return coyoteRequest.getCharacterEncoding();
}
/**
* Return the content length for this Request.
*/
+ @Override
public int getContentLength() {
return coyoteRequest.getContentLength();
}
/**
* Return the content type for this Request.
*/
+ @Override
public String getContentType() {
return coyoteRequest.getContentType();
}
* already been called for this request
* @exception IOException if an input/output error occurs
*/
+ @Override
public ServletInputStream getInputStream() throws IOException {
if (usingReader)
* that was encountered. If the request did not specify a preferred
* language, the server's default Locale is returned.
*/
+ @Override
public Locale getLocale() {
if (!localesParsed)
* headers that were encountered. If the request did not specify a
* preferred language, the server's default Locale is returned.
*/
+ @Override
public Enumeration<Locale> getLocales() {
if (!localesParsed)
*
* @param name Name of the desired request parameter
*/
+ @Override
public String getParameter(String name) {
if (!parametersParsed)
* @return A <code>Map</code> containing parameter names as keys
* and parameter values as map values.
*/
+ @Override
public Map<String, String[]> getParameterMap() {
if (parameterMap.isLocked())
/**
* Return the names of all defined request parameters for this request.
*/
+ @Override
public Enumeration<String> getParameterNames() {
if (!parametersParsed)
*
* @param name Name of the desired request parameter
*/
+ @Override
public String[] getParameterValues(String name) {
if (!parametersParsed)
/**
* Return the protocol and version used to make this Request.
*/
+ @Override
public String getProtocol() {
return coyoteRequest.protocol().toString();
}
* has already been called for this request
* @exception IOException if an input/output error occurs
*/
+ @Override
public BufferedReader getReader() throws IOException {
if (usingInputStream)
* @deprecated As of version 2.1 of the Java Servlet API, use
* <code>ServletContext.getRealPath()</code>.
*/
+ @Override
@Deprecated
public String getRealPath(String path) {
/**
* Return the remote IP address making this Request.
*/
+ @Override
public String getRemoteAddr() {
if (remoteAddr == null) {
coyoteRequest.action
/**
* Return the remote host name making this Request.
*/
+ @Override
public String getRemoteHost() {
if (remoteHost == null) {
if (!connector.getEnableLookups()) {
* Returns the Internet Protocol (IP) source port of the client
* or last proxy that sent the request.
*/
+ @Override
public int getRemotePort(){
if (remotePort == -1) {
coyoteRequest.action
* Returns the host name of the Internet Protocol (IP) interface on
* which the request was received.
*/
+ @Override
public String getLocalName(){
if (localName == null) {
coyoteRequest.action
* Returns the Internet Protocol (IP) address of the interface on
* which the request was received.
*/
+ @Override
public String getLocalAddr(){
if (localAddr == null) {
coyoteRequest.action
* Returns the Internet Protocol (IP) port number of the interface
* on which the request was received.
*/
+ @Override
public int getLocalPort(){
if (localPort == -1){
coyoteRequest.action
*
* @param path Path of the resource to be wrapped
*/
+ @Override
public RequestDispatcher getRequestDispatcher(String path) {
if (context == null)
/**
* Return the scheme used to make this Request.
*/
+ @Override
public String getScheme() {
return coyoteRequest.scheme().toString();
}
/**
* Return the server name responding to this Request.
*/
+ @Override
public String getServerName() {
return coyoteRequest.serverName().toString();
}
/**
* Return the server port responding to this Request.
*/
+ @Override
public int getServerPort() {
return coyoteRequest.getServerPort();
}
/**
* Was this request received on a secure connection?
*/
+ @Override
public boolean isSecure() {
return secure;
}
*
* @param name Name of the request attribute to remove
*/
+ @Override
public void removeAttribute(String name) {
Object value = null;
boolean found = false;
* @param name Name of the request attribute to set
* @param value The associated value
*/
+ @Override
public void setAttribute(String name, Object value) {
// Name cannot be null
*
* @since Servlet 2.3
*/
+ @Override
public void setCharacterEncoding(String enc)
throws UnsupportedEncodingException {
}
+ @Override
public ServletContext getServletContext() {
return context.getServletContext();
}
+ @Override
public AsyncContext startAsync() {
return startAsync(getRequest(),response.getResponse());
}
+ @Override
public AsyncContext startAsync(ServletRequest request,
ServletResponse response) {
if (!isAsyncSupported()) {
throw new IllegalStateException("Already started.");
}
- asyncContext.setStarted(getContext());
- asyncContext.init(request,response);
- asyncContext.setHasOriginalRequestAndResponse(request==getRequest() &&
- response==getResponse().getResponse());
-
+ asyncContext.setStarted(getContext(), request, response,
+ request==getRequest() && response==getResponse().getResponse());
asyncContext.setTimeout(getConnector().getAsyncTimeout());
return asyncContext;
}
+ @Override
public boolean isAsyncStarted() {
if (asyncContext == null) {
return false;
asyncContext.getState()==AsyncContextImpl.AsyncState.COMPLETING);
}
+ @Override
public boolean isAsyncSupported() {
if (this.asyncSupported == null) {
return true;
return asyncSupported.booleanValue();
}
+ @Override
public AsyncContext getAsyncContext() {
return this.asyncContext;
}
+ @Override
public DispatcherType getDispatcherType() {
if (internalDispatcherType == null) {
return DispatcherType.REQUEST;
/**
* Return the authentication type used for this Request.
*/
+ @Override
public String getAuthType() {
return authType;
}
* Return the portion of the request URI used to select the Context
* of the Request.
*/
+ @Override
public String getContextPath() {
return mappingData.contextPath.toString();
}
/**
* Return the set of Cookies received with this Request.
*/
+ @Override
public Cookie[] getCookies() {
if (!cookiesParsed)
* @exception IllegalArgumentException if the specified header value
* cannot be converted to a date
*/
+ @Override
public long getDateHeader(String name) {
String value = getHeader(name);
*
* @param name Name of the requested header
*/
+ @Override
public String getHeader(String name) {
return coyoteRequest.getHeader(name);
}
*
* @param name Name of the requested header
*/
+ @Override
public Enumeration<String> getHeaders(String name) {
return coyoteRequest.getMimeHeaders().values(name);
}
/**
* Return the names of all headers received with this request.
*/
+ @Override
public Enumeration<String> getHeaderNames() {
return coyoteRequest.getMimeHeaders().names();
}
* @exception IllegalArgumentException if the specified header value
* cannot be converted to an integer
*/
+ @Override
public int getIntHeader(String name) {
String value = getHeader(name);
/**
* Return the HTTP request method used in this Request.
*/
+ @Override
public String getMethod() {
return coyoteRequest.method().toString();
}
/**
* Return the path information associated with this Request.
*/
+ @Override
public String getPathInfo() {
return mappingData.pathInfo.toString();
}
* Return the extra path information for this request, translated
* to a real path.
*/
+ @Override
public String getPathTranslated() {
if (context == null)
/**
* Return the query string associated with this request.
*/
+ @Override
public String getQueryString() {
return coyoteRequest.queryString().toString();
}
* Return the name of the remote user that has been authenticated
* for this Request.
*/
+ @Override
public String getRemoteUser() {
if (userPrincipal == null) {
/**
* Return the session identifier included in this request, if any.
*/
+ @Override
public String getRequestedSessionId() {
return requestedSessionId;
}
/**
* Return the request URI for this request.
*/
+ @Override
public String getRequestURI() {
return coyoteRequest.requestURI().toString();
}
* @return A <code>StringBuffer</code> object containing the
* reconstructed URL
*/
+ @Override
public StringBuffer getRequestURL() {
StringBuffer url = new StringBuffer();
* Return the portion of the request URI used to select the servlet
* that will process this request.
*/
+ @Override
public String getServletPath() {
return (mappingData.wrapperPath.toString());
}
* Return the session associated with this Request, creating one
* if necessary.
*/
+ @Override
public HttpSession getSession() {
Session session = doGetSession(true);
if (session == null) {
*
* @param create Create a new session if one does not exist
*/
+ @Override
public HttpSession getSession(boolean create) {
Session session = doGetSession(create);
if (session == null) {
* Return <code>true</code> if the session identifier included in this
* request came from a cookie.
*/
+ @Override
public boolean isRequestedSessionIdFromCookie() {
if (requestedSessionId == null) {
* Return <code>true</code> if the session identifier included in this
* request came from the request URI.
*/
+ @Override
public boolean isRequestedSessionIdFromURL() {
if (requestedSessionId == null) {
* @deprecated As of Version 2.1 of the Java Servlet API, use
* <code>isRequestedSessionIdFromURL()</code> instead.
*/
+ @Override
@Deprecated
public boolean isRequestedSessionIdFromUrl() {
return (isRequestedSessionIdFromURL());
* Return <code>true</code> if the session identifier included in this
* request identifies a valid session.
*/
+ @Override
public boolean isRequestedSessionIdValid() {
if (requestedSessionId == null) {
*
* @param role Role name to be validated
*/
+ @Override
public boolean isUserInRole(String role) {
// Have we got an authenticated principal at all?
/**
* Return the principal that has been authenticated for this Request.
*/
+ @Override
public Principal getUserPrincipal() {
if (userPrincipal instanceof GenericPrincipal) {
return ((GenericPrincipal) userPrincipal).getUserPrincipal();
* @throws ServletException If the caller is responsible for handling the
* error and the container has NOT set the HTTP response code etc.
*/
+ @Override
public boolean authenticate(HttpServletResponse response)
throws IOException, ServletException {
if (response.isCommitted()) {
/**
* {@inheritDoc}
*/
+ @Override
public void login(String username, String password)
throws ServletException {
if (getAuthType() != null || getRemoteUser() != null ||
/**
* {@inheritDoc}
*/
+ @Override
public void logout() throws ServletException {
context.getAuthenticator().register(this, getResponse(), null,
null, null, null);
/**
* {@inheritDoc}
*/
+ @Override
public Collection<Part> getParts() throws IOException, IllegalStateException,
ServletException {
/**
* {@inheritDoc}
*/
+ @Override
public Part getPart(String name) throws IOException, IllegalStateException,
ServletException {
Collection<Part> c = getParts();
private final class GetAttributePrivilegedAction
implements PrivilegedAction<Enumeration<String>> {
+ @Override
public Enumeration<String> run() {
return request.getAttributeNames();
}
private final class GetParameterMapPrivilegedAction
implements PrivilegedAction<Map<String,String[]>> {
+ @Override
public Map<String,String[]> run() {
return request.getParameterMap();
}
this.path = path;
}
+ @Override
public RequestDispatcher run() {
return request.getRequestDispatcher(path);
}
this.name = name;
}
+ @Override
public String run() {
return request.getParameter(name);
}
private final class GetParameterNamesPrivilegedAction
implements PrivilegedAction<Enumeration<String>> {
+ @Override
public Enumeration<String> run() {
return request.getParameterNames();
}
this.name = name;
}
+ @Override
public String[] run() {
return request.getParameterValues(name);
}
private final class GetCookiesPrivilegedAction
implements PrivilegedAction<Cookie[]> {
+ @Override
public Cookie[] run() {
return request.getCookies();
}
private final class GetCharacterEncodingPrivilegedAction
implements PrivilegedAction<String> {
+ @Override
public String run() {
return request.getCharacterEncoding();
}
this.name = name;
}
+ @Override
public Enumeration<String> run() {
return request.getHeaders(name);
}
private final class GetHeaderNamesPrivilegedAction
implements PrivilegedAction<Enumeration<String>> {
+ @Override
public Enumeration<String> run() {
return request.getHeaderNames();
}
private final class GetLocalePrivilegedAction
implements PrivilegedAction<Locale> {
+ @Override
public Locale run() {
return request.getLocale();
}
private final class GetLocalesPrivilegedAction
implements PrivilegedAction<Enumeration<Locale>> {
+ @Override
public Enumeration<Locale> run() {
return request.getLocales();
}
this.create = create;
}
+ @Override
public HttpSession run() {
return request.getSession(create);
}
// ------------------------------------------------- ServletRequest Methods
+ @Override
public Object getAttribute(String name) {
if (request == null) {
}
+ @Override
public Enumeration<String> getAttributeNames() {
if (request == null) {
}
+ @Override
public String getCharacterEncoding() {
if (request == null) {
}
+ @Override
public void setCharacterEncoding(String env)
throws java.io.UnsupportedEncodingException {
}
+ @Override
public int getContentLength() {
if (request == null) {
}
+ @Override
public String getContentType() {
if (request == null) {
}
+ @Override
public ServletInputStream getInputStream() throws IOException {
if (request == null) {
}
+ @Override
public String getParameter(String name) {
if (request == null) {
}
+ @Override
public Enumeration<String> getParameterNames() {
if (request == null) {
}
+ @Override
public String[] getParameterValues(String name) {
if (request == null) {
}
+ @Override
public Map<String,String[]> getParameterMap() {
if (request == null) {
}
+ @Override
public String getProtocol() {
if (request == null) {
}
+ @Override
public String getScheme() {
if (request == null) {
}
+ @Override
public String getServerName() {
if (request == null) {
}
+ @Override
public int getServerPort() {
if (request == null) {
}
+ @Override
public BufferedReader getReader() throws IOException {
if (request == null) {
}
+ @Override
public String getRemoteAddr() {
if (request == null) {
}
+ @Override
public String getRemoteHost() {
if (request == null) {
}
+ @Override
public void setAttribute(String name, Object o) {
if (request == null) {
}
+ @Override
public void removeAttribute(String name) {
if (request == null) {
}
+ @Override
public Locale getLocale() {
if (request == null) {
}
+ @Override
public Enumeration<Locale> getLocales() {
if (request == null) {
}
+ @Override
public boolean isSecure() {
if (request == null) {
}
+ @Override
public RequestDispatcher getRequestDispatcher(String path) {
if (request == null) {
}
}
+ @Override
public String getRealPath(String path) {
if (request == null) {
}
+ @Override
public String getAuthType() {
if (request == null) {
}
+ @Override
public Cookie[] getCookies() {
if (request == null) {
}
+ @Override
public long getDateHeader(String name) {
if (request == null) {
}
+ @Override
public String getHeader(String name) {
if (request == null) {
}
+ @Override
public Enumeration<String> getHeaders(String name) {
if (request == null) {
}
+ @Override
public Enumeration<String> getHeaderNames() {
if (request == null) {
}
+ @Override
public int getIntHeader(String name) {
if (request == null) {
}
+ @Override
public String getMethod() {
if (request == null) {
}
+ @Override
public String getPathInfo() {
if (request == null) {
}
+ @Override
public String getPathTranslated() {
if (request == null) {
}
+ @Override
public String getContextPath() {
if (request == null) {
}
+ @Override
public String getQueryString() {
if (request == null) {
}
+ @Override
public String getRemoteUser() {
if (request == null) {
}
+ @Override
public boolean isUserInRole(String role) {
if (request == null) {
}
+ @Override
public java.security.Principal getUserPrincipal() {
if (request == null) {
}
+ @Override
public String getRequestedSessionId() {
if (request == null) {
}
+ @Override
public String getRequestURI() {
if (request == null) {
}
+ @Override
public StringBuffer getRequestURL() {
if (request == null) {
}
+ @Override
public String getServletPath() {
if (request == null) {
}
+ @Override
public HttpSession getSession(boolean create) {
if (request == null) {
}
}
+ @Override
public HttpSession getSession() {
if (request == null) {
}
+ @Override
public boolean isRequestedSessionIdValid() {
if (request == null) {
}
+ @Override
public boolean isRequestedSessionIdFromCookie() {
if (request == null) {
}
+ @Override
public boolean isRequestedSessionIdFromURL() {
if (request == null) {
}
+ @Override
public boolean isRequestedSessionIdFromUrl() {
if (request == null) {
}
+ @Override
public String getLocalAddr() {
if (request == null) {
}
+ @Override
public String getLocalName() {
if (request == null) {
}
+ @Override
public int getLocalPort() {
if (request == null) {
}
+ @Override
public int getRemotePort() {
if (request == null) {
}
+ @Override
public ServletContext getServletContext() {
if (request == null) {
throw new IllegalStateException(
}
+ @Override
public AsyncContext startAsync() throws IllegalStateException {
return request.startAsync();
}
+ @Override
public AsyncContext startAsync(ServletRequest request, ServletResponse response)
throws IllegalStateException {
return request.startAsync(request, response);
}
+ @Override
public boolean isAsyncStarted() {
return request.isAsyncStarted();
}
+ @Override
public boolean isAsyncSupported() {
return request.isAsyncSupported();
}
+ @Override
public AsyncContext getAsyncContext() {
return request.getAsyncContext();
}
+ @Override
public DispatcherType getDispatcherType() {
return request.getDispatcherType();
}
+ @Override
public boolean authenticate(HttpServletResponse response)
throws IOException, ServletException {
return request.authenticate(response);
}
+ @Override
public void login(String username, String password)
throws ServletException {
request.login(username, password);
}
+ @Override
public void logout() throws ServletException {
request.logout();
}
+ @Override
public Collection<Part> getParts() throws IllegalStateException,
IOException, ServletException {
return request.getParts();
}
+ @Override
public Part getPart(String name) throws IllegalStateException, IOException,
ServletException {
return request.getPart(name);
* Return the content type that was set or calculated for this response,
* or <code>null</code> if no content type was set.
*/
+ @Override
public String getContentType() {
return (coyoteResponse.getContentType());
}
*
* @exception IOException if an input/output error occurs
*/
+ @Override
public void flushBuffer()
throws IOException {
outputBuffer.flush();
/**
* Return the actual buffer size used for this Response.
*/
+ @Override
public int getBufferSize() {
return outputBuffer.getBufferSize();
}
/**
* Return the character encoding used for this Response.
*/
+ @Override
public String getCharacterEncoding() {
return (coyoteResponse.getCharacterEncoding());
}
* already been called for this response
* @exception IOException if an input/output error occurs
*/
+ @Override
public ServletOutputStream getOutputStream()
throws IOException {
/**
* Return the Locale assigned to this response.
*/
+ @Override
public Locale getLocale() {
return (coyoteResponse.getLocale());
}
* already been called for this response
* @exception IOException if an input/output error occurs
*/
+ @Override
public PrintWriter getWriter()
throws IOException {
/**
* Has the output of this response already been committed?
*/
+ @Override
public boolean isCommitted() {
return (coyoteResponse.isCommitted());
}
* @exception IllegalStateException if this response has already
* been committed
*/
+ @Override
public void reset() {
if (included)
* @exception IllegalStateException if the response has already
* been committed
*/
+ @Override
public void resetBuffer() {
resetBuffer(false);
}
* @exception IllegalStateException if this method is called after
* output has been committed for this response
*/
+ @Override
public void setBufferSize(int size) {
if (isCommitted() || !outputBuffer.isNew())
*
* @param length The new content length
*/
+ @Override
public void setContentLength(int length) {
if (isCommitted())
*
* @param type The new content type
*/
+ @Override
@SuppressWarnings("deprecation") // isSpace (deprecated) cannot be replaced by isWhiteSpace
public void setContentType(String type) {
*
* @param charset String containing the name of the character encoding.
*/
+ @Override
public void setCharacterEncoding(String charset) {
if (isCommitted())
*
* @param locale The new locale
*/
+ @Override
public void setLocale(Locale locale) {
if (isCommitted())
*
* @param name Header name to look up
*/
+ @Override
public String getHeader(String name) {
return coyoteResponse.getMimeHeaders().getHeader(name);
}
/**
* Return an Iterable of all the header names set for this response.
*/
+ @Override
public Collection<String> getHeaderNames() {
MimeHeaders headers = coyoteResponse.getMimeHeaders();
*
* @param name Header name to look up
*/
+ @Override
public Collection<String> getHeaders(String name) {
Enumeration<String> enumeration =
/**
* Return the HTTP status code associated with this Response.
*/
+ @Override
public int getStatus() {
return coyoteResponse.getStatus();
}
*
* @param cookie Cookie to be added
*/
+ @Override
public void addCookie(final Cookie cookie) {
// Ignore any call from an included servlet
//from the appendCookieValue invocation
if (SecurityUtil.isPackageProtectionEnabled()) {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
public Void run(){
ServerCookie.appendCookieValue
(sb, cookie.getVersion(), cookie.getName(),
* @param name Name of the header to set
* @param value Date value to be set
*/
+ @Override
public void addDateHeader(String name, long value) {
if (name == null || name.length() == 0) {
* @param name Name of the header to set
* @param value Value to be set
*/
+ @Override
public void addHeader(String name, String value) {
if (name == null || name.length() == 0 || value == null) {
* @param name Name of the header to set
* @param value Integer value to be set
*/
+ @Override
public void addIntHeader(String name, int value) {
if (name == null || name.length() == 0) {
*
* @param name Name of the header to check
*/
+ @Override
public boolean containsHeader(String name) {
// Need special handling for Content-Type and Content-Length due to
// special handling of these in coyoteResponse
*
* @param url URL to be encoded
*/
+ @Override
public String encodeRedirectURL(String url) {
if (isEncodeable(toAbsolute(url))) {
* @deprecated As of Version 2.1 of the Java Servlet API, use
* <code>encodeRedirectURL()</code> instead.
*/
+ @Override
@Deprecated
public String encodeRedirectUrl(String url) {
return (encodeRedirectURL(url));
*
* @param url URL to be encoded
*/
+ @Override
public String encodeURL(String url) {
String absolute = toAbsolute(url);
* @deprecated As of Version 2.1 of the Java Servlet API, use
* <code>encodeURL()</code> instead.
*/
+ @Override
@Deprecated
public String encodeUrl(String url) {
return (encodeURL(url));
* already been committed
* @exception IOException if an input/output error occurs
*/
+ @Override
public void sendError(int status)
throws IOException {
sendError(status, null);
* already been committed
* @exception IOException if an input/output error occurs
*/
+ @Override
public void sendError(int status, String message)
throws IOException {
* already been committed
* @exception IOException if an input/output error occurs
*/
+ @Override
public void sendRedirect(String location)
throws IOException {
* @param name Name of the header to set
* @param value Date value to be set
*/
+ @Override
public void setDateHeader(String name, long value) {
if (name == null || name.length() == 0) {
* @param name Name of the header to set
* @param value Value to be set
*/
+ @Override
public void setHeader(String name, String value) {
if (name == null || name.length() == 0 || value == null) {
* @param name Name of the header to set
* @param value Integer value to be set
*/
+ @Override
public void setIntHeader(String name, int value) {
if (name == null || name.length() == 0) {
*
* @param status The new HTTP status
*/
+ @Override
public void setStatus(int status) {
setStatus(status, null);
}
* has been deprecated due to the ambiguous meaning of the message
* parameter.
*/
+ @Override
@Deprecated
public void setStatus(int status, String message) {
return (
AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ @Override
public Boolean run(){
return new Boolean(doIsEncodeable(hreq, session, location));
}
try{
encodedURI = AccessController.doPrivileged(
new PrivilegedExceptionAction<String>(){
+ @Override
public String run() throws IOException{
return urlEncoder.encodeURL(frelativePath);
}
this.contentType = contentType;
}
+ @Override
public Void run() {
response.setContentType(contentType);
return null;
this.add = add;
}
+ @Override
public Void run() {
if(add) {
response.addDateHeader(name, value);
// ------------------------------------------------ ServletResponse Methods
+ @Override
public String getCharacterEncoding() {
if (response == null) {
}
+ @Override
public ServletOutputStream getOutputStream()
throws IOException {
}
+ @Override
public PrintWriter getWriter()
throws IOException {
}
+ @Override
public void setContentLength(int len) {
if (isCommitted())
}
+ @Override
public void setContentType(String type) {
if (isCommitted())
}
+ @Override
public void setBufferSize(int size) {
if (isCommitted())
}
+ @Override
public int getBufferSize() {
if (response == null) {
}
+ @Override
public void flushBuffer()
throws IOException {
AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>(){
+ @Override
public Void run() throws IOException{
response.setAppCommitted(true);
}
+ @Override
public void resetBuffer() {
if (isCommitted())
}
+ @Override
public boolean isCommitted() {
if (response == null) {
}
+ @Override
public void reset() {
if (isCommitted())
}
+ @Override
public void setLocale(Locale loc) {
if (isCommitted())
}
+ @Override
public Locale getLocale() {
if (response == null) {
}
+ @Override
public void addCookie(Cookie cookie) {
if (isCommitted())
}
+ @Override
public boolean containsHeader(String name) {
if (response == null) {
}
+ @Override
public String encodeURL(String url) {
if (response == null) {
}
+ @Override
public String encodeRedirectURL(String url) {
if (response == null) {
}
+ @Override
public String encodeUrl(String url) {
if (response == null) {
}
+ @Override
public String encodeRedirectUrl(String url) {
if (response == null) {
}
+ @Override
public void sendError(int sc, String msg)
throws IOException {
}
+ @Override
public void sendError(int sc)
throws IOException {
}
+ @Override
public void sendRedirect(String location)
throws IOException {
}
+ @Override
public void setDateHeader(String name, long date) {
if (isCommitted())
}
+ @Override
public void addDateHeader(String name, long date) {
if (isCommitted())
}
+ @Override
public void setHeader(String name, String value) {
if (isCommitted())
}
+ @Override
public void addHeader(String name, String value) {
if (isCommitted())
}
+ @Override
public void setIntHeader(String name, int value) {
if (isCommitted())
}
+ @Override
public void addIntHeader(String name, int value) {
if (isCommitted())
}
+ @Override
public void setStatus(int sc) {
if (isCommitted())
}
+ @Override
public void setStatus(int sc, String sm) {
if (isCommitted())
}
+ @Override
public String getContentType() {
if (response == null) {
}
+ @Override
public void setCharacterEncoding(String arg0) {
if (response == null) {
response.setCharacterEncoding(arg0);
}
+ @Override
public int getStatus() {
return response.getStatus();
}
+ @Override
public String getHeader(String name) {
return response.getHeader(name);
}
+ @Override
public Collection<String> getHeaderNames() {
return response.getHeaderNames();
}
+ @Override
public Collection<String> getHeaders(String name) {
return response.getHeaders(name);
}
state.get() == AsyncState.DISPATCHING);
}
- public void setStarted(Context context) {
+ public void setStarted(Context context, ServletRequest request,
+ ServletResponse response, boolean hasOriginalRequestAndResponse) {
if (state.compareAndSet(AsyncState.NOT_STARTED, AsyncState.STARTED) ||
state.compareAndSet(AsyncState.DISPATCHED, AsyncState.STARTED)) {
this.context = context;
+ this.servletRequest = request;
+ this.servletResponse = response;
+ this.hasOriginalRequestAndResponse = hasOriginalRequestAndResponse;
+ this.event = new AsyncEvent(this, request, response);
} else {
throw new IllegalStateException("Start illegal. Invalid state: "+state.get());
}
return hasOriginalRequestAndResponse;
}
- public void setHasOriginalRequestAndResponse(boolean hasOriginalRequestAndResponse) {
- this.hasOriginalRequestAndResponse = hasOriginalRequestAndResponse;
- }
-
protected void doInternalDispatch() throws ServletException, IOException {
if (log.isDebugEnabled()) {
logDebug("intDispatch");
state.set(AsyncState.ERROR_DISPATCHING);
}
- public void init(ServletRequest request, ServletResponse response) {
- this.servletRequest = request;
- this.servletResponse = response;
- event = new AsyncEvent(this, request, response);
- }
-
private void logDebug(String method) {
String rHashCode;
String crHashCode;