1 48 49 50 package com.caucho.portal.generic.context; 51 52 import com.caucho.portal.generic.PortletConnection; 53 54 import java.io.IOException ; 55 import java.io.OutputStream ; 56 import java.io.PrintWriter ; 57 import java.io.UnsupportedEncodingException ; 58 import java.util.Locale ; 59 60 63 class TopLevelResponseHandler implements ResponseHandler 64 { 65 private PortletConnection _connection; 66 private ConnectionContext _context; 67 68 public TopLevelResponseHandler( PortletConnection connection, 69 ConnectionContext context ) 70 { 71 _connection = connection; 72 _context = context; 73 } 74 75 public void finish() 76 throws IOException 77 { 78 } 79 80 public ResponseHandler getSuccessor() 81 { 82 return null; 83 } 84 85 96 public void setProperty(String name, String value) 97 { 98 if (!name.startsWith("Cache-")) 99 _connection.setProperty(name, value); 100 } 101 102 113 public void addProperty(String name, String value) 114 { 115 if (!name.startsWith("Cache-")) 116 _connection.addProperty(name, value); 117 } 118 119 public void setLocale(Locale locale) 120 { 121 _connection.setLocale(locale); 122 } 123 124 public Locale getLocale() 125 { 126 return _connection.getLocale(); 127 } 128 129 public void setContentType(String contentType) 130 { 131 _connection.setContentType(contentType); 132 } 133 134 public String getContentType() 135 { 136 return _connection.getContentType(); 137 } 138 139 public void setBufferSize(int size) 140 { 141 _connection.setBufferSize(size); 142 } 143 144 public int getBufferSize() 145 { 146 return _connection.getBufferSize(); 147 } 148 149 public void flushBuffer() 150 throws IOException 151 { 152 _connection.flushBuffer(); 153 } 154 155 public void resetBuffer() 156 { 157 _connection.resetBuffer(); 158 } 159 160 public void reset() 161 { 162 _connection.reset(); 163 } 164 165 public boolean isCommitted() 166 { 167 return _connection.isCommitted(); 168 } 169 170 public void setCharacterEncoding(String enc) 171 throws UnsupportedEncodingException 172 { 173 _connection.setCharacterEncoding(enc); 174 } 175 176 179 public String getCharacterEncoding() 180 { 181 return _connection.getCharacterEncoding(); 182 } 183 184 187 public PrintWriter getWriter() 188 throws IOException 189 { 190 return _connection.getWriter(); 191 } 192 193 public OutputStream getOutputStream() 194 throws IOException 195 { 196 return _connection.getOutputStream(); 197 } 198 } 199 | Popular Tags |