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

1   /*
2    * $Id: TilesRequestContextWrapper.java 769961 2009-04-29 22:07:34Z apetrelli $
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.context;
22  
23  import java.util.Map;
24  import java.util.Locale;
25  import java.io.IOException;
26  import java.io.OutputStream;
27  import java.io.PrintWriter;
28  import java.io.Writer;
29  
30  import org.apache.tiles.TilesApplicationContext;
31  
32  /***
33   * Delegate for ease of customization.
34   *
35   * @since Tiles 2.0
36   * @version $Rev: 769961 $ $Date: 2009-04-30 00:07:34 +0200 (gio, 30 apr 2009) $
37   */
38  public class TilesRequestContextWrapper implements TilesRequestContext {
39  
40      /***
41       * The wrapper request context object.
42       */
43      private TilesRequestContext context;
44  
45  
46      /***
47       * Constructor.
48       *
49       * @param context The request context to wrap.
50       */
51      public TilesRequestContextWrapper(TilesRequestContext context) {
52          this.context = context;
53      }
54  
55      /***
56       * Returns the wrapped Tiles request.
57       *
58       * @return The wrapped Tiles request.
59       * @since 2.1.1
60       */
61      public TilesRequestContext getWrappedRequest() {
62          return context;
63      }
64  
65      /*** {@inheritDoc} */
66      public Map<String, String> getHeader() {
67          return context.getHeader();
68      }
69  
70      /*** {@inheritDoc} */
71      public Map<String, String[]> getHeaderValues() {
72          return context.getHeaderValues();
73      }
74  
75      /*** {@inheritDoc} */
76      public Map<String, Object> getRequestScope() {
77          return context.getRequestScope();
78      }
79  
80      /*** {@inheritDoc} */
81      public Map<String, Object> getSessionScope() {
82          return context.getSessionScope();
83      }
84  
85      /*** {@inheritDoc} */
86      public TilesApplicationContext getApplicationContext() {
87          return context.getApplicationContext();
88      }
89  
90      /*** {@inheritDoc} */
91      public void dispatch(String path) throws IOException {
92          context.dispatch(path);
93      }
94  
95      /*** {@inheritDoc} */
96      public void include(String path) throws IOException {
97          context.include(path);
98      }
99  
100     /*** {@inheritDoc} */
101     public OutputStream getOutputStream() throws IOException {
102         return context.getOutputStream();
103     }
104 
105     /*** {@inheritDoc} */
106     public Writer getWriter() throws IOException {
107         return context.getWriter();
108     }
109 
110     /*** {@inheritDoc} */
111     public PrintWriter getPrintWriter() throws IOException {
112         return context.getPrintWriter();
113     }
114 
115     /*** {@inheritDoc} */
116     public boolean isResponseCommitted() {
117         return context.isResponseCommitted();
118     }
119 
120     /*** {@inheritDoc} */
121     public void setContentType(String contentType) {
122         context.setContentType(contentType);
123     }
124 
125     /*** {@inheritDoc} */
126     public Map<String, String> getParam() {
127         return context.getParam();
128     }
129 
130     /*** {@inheritDoc} */
131     public Map<String, String[]> getParamValues() {
132         return context.getParamValues();
133     }
134 
135     /*** {@inheritDoc} */
136     public Locale getRequestLocale() {
137         return context.getRequestLocale();
138     }
139 
140     /*** {@inheritDoc} */
141     public boolean isUserInRole(String role) {
142         return context.isUserInRole(role);
143     }
144 
145     /*** {@inheritDoc} */
146     public Object[] getRequestObjects() {
147         return context.getRequestObjects();
148     }
149 
150     /*** {@inheritDoc} */
151     @Deprecated
152     public Object getResponse() {
153         return context.getResponse();
154     }
155 
156     /*** {@inheritDoc} */
157     @Deprecated
158     public Object getRequest() {
159         return context.getRequest();
160     }
161 }