This project has retired. For details please refer to its Attic page.
DispatchRequestWrapper xref
View Javadoc

1   /*
2    * $Id: DispatchRequestWrapper.java 1375743 2012-08-21 20:05:58Z nlebas $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.tiles.request;
22  
23  import java.io.IOException;
24  import java.io.OutputStream;
25  import java.io.PrintWriter;
26  import java.io.Writer;
27  import java.util.Collections;
28  import java.util.List;
29  import java.util.Locale;
30  import java.util.Map;
31  
32  import org.apache.tiles.request.attribute.Addable;
33  
34  /**
35   * Delegate for ease of customization.
36   *
37   * @deprecated prefer RequestWrapper which is more general in purpose, unless you want to override dispatch() or include().
38   * @version $Rev: 1215009 $ $Date: 2011-12-16 01:32:31 +0100 (Fri, 16 Dec 2011) $
39   */
40  @Deprecated
41  public class DispatchRequestWrapper extends AbstractRequest implements
42          RequestWrapper {
43  
44      /**
45       * The wrapper request context object.
46       */
47      private DispatchRequest context;
48  
49      /**
50       * Constructor.
51       *
52       * @param context The request context to wrap.
53       */
54      public DispatchRequestWrapper(DispatchRequest context) {
55          this.context = context;
56      }
57  
58      /** {@inheritDoc} */
59      public DispatchRequest getWrappedRequest() {
60          return context;
61      }
62  
63      /** {@inheritDoc} */
64      public Map<String, String> getHeader() {
65          return context.getHeader();
66      }
67  
68      /** {@inheritDoc} */
69      public Map<String, String[]> getHeaderValues() {
70          return context.getHeaderValues();
71      }
72  
73      /** {@inheritDoc} */
74      public Addable<String> getResponseHeaders() {
75          return context.getResponseHeaders();
76      }
77  
78      /** {@inheritDoc} */
79      public Map<String, Object> getContext(String scope) {
80          return context.getContext(scope);
81      }
82  
83      /** {@inheritDoc} */
84      public List<String> getAvailableScopes() {
85          return context.getAvailableScopes();
86      }
87  
88      /** {@inheritDoc} */
89      public ApplicationContext getApplicationContext() {
90          return context.getApplicationContext();
91      }
92  
93      /** {@inheritDoc} */
94      public void dispatch(String path) throws IOException {
95          context.dispatch(path);
96      }
97  
98      /** {@inheritDoc} */
99      public void include(String path) throws IOException {
100         context.include(path);
101     }
102 
103     /** {@inheritDoc} */
104     public OutputStream getOutputStream() throws IOException {
105         return context.getOutputStream();
106     }
107 
108     /** {@inheritDoc} */
109     public Writer getWriter() throws IOException {
110         return context.getWriter();
111     }
112 
113     /** {@inheritDoc} */
114     public PrintWriter getPrintWriter() throws IOException {
115         return context.getPrintWriter();
116     }
117 
118     /** {@inheritDoc} */
119     public boolean isResponseCommitted() {
120         return context.isResponseCommitted();
121     }
122 
123     /** {@inheritDoc} */
124     public void setContentType(String contentType) {
125         context.setContentType(contentType);
126     }
127 
128     /** {@inheritDoc} */
129     public Map<String, String> getParam() {
130         return context.getParam();
131     }
132 
133     /** {@inheritDoc} */
134     public Map<String, String[]> getParamValues() {
135         return context.getParamValues();
136     }
137 
138     /** {@inheritDoc} */
139     public Locale getRequestLocale() {
140         return context.getRequestLocale();
141     }
142 
143     /** {@inheritDoc} */
144     public boolean isUserInRole(String role) {
145         return context.isUserInRole(role);
146     }
147 }