001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.pluto.wrappers;
018:
019: import javax.portlet.PortletURL;
020: import javax.portlet.RenderResponse;
021: import java.io.IOException;
022: import java.io.OutputStream;
023:
024: public class RenderResponseWrapper extends PortletResponseWrapper
025: implements RenderResponse {
026: /**
027: * Creates a ServletResponse adaptor wrapping the given response object.
028: * @throws java.lang.IllegalArgumentException
029: * if the response is null.
030: */
031: public RenderResponseWrapper(RenderResponse renderResponse) {
032: super (renderResponse);
033:
034: if (renderResponse == null) {
035: throw new IllegalArgumentException(
036: "Response cannot be null");
037: }
038: }
039:
040: // javax.portlet.RenderResponse implementation ------------------------------------------------
041: public String getContentType() {
042: return this .getRenderResponse().getContentType();
043: }
044:
045: public PortletURL createRenderURL() {
046: return this .getRenderResponse().createRenderURL();
047: }
048:
049: public PortletURL createActionURL() {
050: return this .getRenderResponse().createActionURL();
051: }
052:
053: public String getNamespace() {
054: return this .getRenderResponse().getNamespace();
055: }
056:
057: public void setTitle(String title) {
058: this .getRenderResponse().setTitle(title);
059: }
060:
061: public void setContentType(String type) {
062: this .getRenderResponse().setContentType(type);
063: }
064:
065: public String getCharacterEncoding() {
066: return this .getRenderResponse().getCharacterEncoding();
067: }
068:
069: public java.io.PrintWriter getWriter() throws java.io.IOException {
070: return this .getRenderResponse().getWriter();
071: }
072:
073: public java.util.Locale getLocale() {
074: return this .getRenderResponse().getLocale();
075: }
076:
077: public void setBufferSize(int size) {
078: this .getRenderResponse().setBufferSize(size);
079: }
080:
081: public int getBufferSize() {
082: return this .getRenderResponse().getBufferSize();
083: }
084:
085: public void flushBuffer() throws java.io.IOException {
086: this .getRenderResponse().flushBuffer();
087: }
088:
089: public void resetBuffer() {
090: this .getRenderResponse().resetBuffer();
091: }
092:
093: public boolean isCommitted() {
094: return this .getRenderResponse().isCommitted();
095: }
096:
097: public void reset() {
098: this .getRenderResponse().reset();
099: }
100:
101: public OutputStream getPortletOutputStream() throws IOException {
102: return this .getRenderResponse().getPortletOutputStream();
103: }
104:
105: // --------------------------------------------------------------------------------------------
106:
107: // additional methods -------------------------------------------------------------------------
108: /**
109: * Return the wrapped ServletResponse object.
110: */
111: public RenderResponse getRenderResponse() {
112: return (RenderResponse) getPortletResponse();
113: }
114: // --------------------------------------------------------------------------------------------
115:
116: }
|