001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003: * notice. All rights reserved.
004: */
005: package weblogic.servlet.internal;
006:
007: import com.tc.object.util.OverrideCheck;
008: import com.terracotta.session.TerracottaRequest;
009: import com.terracotta.session.TerracottaResponse;
010:
011: import java.io.IOException;
012: import java.io.PrintWriter;
013: import java.util.Locale;
014:
015: import javax.servlet.ServletOutputStream;
016: import javax.servlet.http.Cookie;
017:
018: /**
019: * The whole point of this class is to remain type compatible with weblogic's internal response types. There are places
020: * in their container where the concrete type of the response needs to be instanceof compatible with their type. This
021: * class also must reside in the weblogic package such that it can override and delegate package private methods. This
022: * class is instrumented at runtime to override all non-private methods of ServletResponseImpl and delegate the
023: * nativeResponse instance
024: */
025: public final class TerracottaServletResponseImpl extends
026: ServletResponseImpl implements TerracottaResponse {
027:
028: static {
029: OverrideCheck.check(ServletResponseImpl.class,
030: TerracottaServletResponseImpl.class);
031: }
032:
033: private final TerracottaRequest req;
034: private final ServletResponseImpl nativeResponse;
035:
036: public TerracottaServletResponseImpl(TerracottaRequest req,
037: ServletResponseImpl response) {
038: this .req = req;
039: this .nativeResponse = response;
040: }
041:
042: public String encodeRedirectUrl(String url) {
043: return encodeRedirectURL(url);
044: }
045:
046: public String encodeUrl(String url) {
047: return encodeURL(url);
048: }
049:
050: public String encodeRedirectURL(final String url) {
051: return req.encodeRedirectURL(url);
052: }
053:
054: public String encodeURL(final String url) {
055: return req.encodeURL(url);
056: }
057:
058: public void addCookie(Cookie arg0) {
059: nativeResponse.addCookie(arg0);
060: }
061:
062: public void addDateHeader(String arg0, long arg1) {
063: nativeResponse.addDateHeader(arg0, arg1);
064: }
065:
066: public void addHeader(String arg0, String arg1) {
067: nativeResponse.addHeader(arg0, arg1);
068: }
069:
070: public void addIntHeader(String arg0, int arg1) {
071: nativeResponse.addIntHeader(arg0, arg1);
072: }
073:
074: public boolean containsHeader(String arg0) {
075: return nativeResponse.containsHeader(arg0);
076: }
077:
078: public void flushBuffer() throws IOException {
079: nativeResponse.flushBuffer();
080: }
081:
082: public int getBufferSize() {
083: return nativeResponse.getBufferSize();
084: }
085:
086: public String getCharacterEncoding() {
087: return nativeResponse.getCharacterEncoding();
088: }
089:
090: public String getContentType() {
091: return nativeResponse.getContentType();
092: }
093:
094: public Locale getLocale() {
095: return nativeResponse.getLocale();
096: }
097:
098: public ServletOutputStream getOutputStream() throws IOException {
099: return nativeResponse.getOutputStream();
100: }
101:
102: public PrintWriter getWriter() throws IOException {
103: return nativeResponse.getWriter();
104: }
105:
106: public boolean isCommitted() {
107: return nativeResponse.isCommitted();
108: }
109:
110: public void reset() {
111: nativeResponse.reset();
112: }
113:
114: public void resetBuffer() {
115: nativeResponse.resetBuffer();
116: }
117:
118: public void sendError(int arg0, String arg1) throws IOException {
119: nativeResponse.sendError(arg0, arg1);
120: }
121:
122: public void sendError(int arg0) throws IOException {
123: nativeResponse.sendError(arg0);
124: }
125:
126: public void sendRedirect(String arg0) throws IOException {
127: nativeResponse.sendRedirect(arg0);
128: }
129:
130: public void setBufferSize(int arg0) {
131: nativeResponse.setBufferSize(arg0);
132: }
133:
134: public void setCharacterEncoding(String arg0) {
135: nativeResponse.setCharacterEncoding(arg0);
136: }
137:
138: public void setContentLength(int arg0) {
139: nativeResponse.setContentLength(arg0);
140: }
141:
142: public void setContentType(String arg0) {
143: nativeResponse.setContentType(arg0);
144: }
145:
146: public void setDateHeader(String arg0, long arg1) {
147: nativeResponse.setDateHeader(arg0, arg1);
148: }
149:
150: public void setHeader(String arg0, String arg1) {
151: nativeResponse.setHeader(arg0, arg1);
152: }
153:
154: public void setIntHeader(String arg0, int arg1) {
155: nativeResponse.setIntHeader(arg0, arg1);
156: }
157:
158: public void setLocale(Locale arg0) {
159: nativeResponse.setLocale(arg0);
160: }
161:
162: public void setStatus(int arg0, String arg1) {
163: nativeResponse.setStatus(arg0, arg1);
164: }
165:
166: public void setStatus(int arg0) {
167: nativeResponse.setStatus(arg0);
168: }
169:
170: }
|