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

1   /*
2    * $Id: TilesApplicationContextWrapper.java 950476 2010-06-02 10:31:43Z 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.io.IOException;
24  import java.net.URL;
25  import java.util.Map;
26  import java.util.Set;
27  
28  import org.apache.tiles.TilesApplicationContext;
29  
30  /***
31   * Delegate for ease of customization.
32   *
33   * @since Tiles 2.1.1
34   * @version $Rev: 950476 $ $Date: 2010-06-02 12:31:43 +0200 (mer, 02 giu 2010) $
35   */
36  public class TilesApplicationContextWrapper implements TilesApplicationContext {
37  
38      /***
39       * The original context.
40       */
41      private TilesApplicationContext context;
42  
43      /***
44       * Constructor.
45       *
46       * @param context The original context.
47       */
48      public TilesApplicationContextWrapper(TilesApplicationContext context) {
49          this.context = context;
50      }
51  
52      /***
53       * Returns the wrapped application context.
54       *
55       * @return The wrapped application context.
56       */
57      public TilesApplicationContext getWrappedApplicationContext() {
58          return context;
59      }
60  
61      /*** {@inheritDoc} */
62      public Map<String, Object> getApplicationScope() {
63          return context.getApplicationScope();
64      }
65  
66      /*** {@inheritDoc} */
67      public Object getContext() {
68          return context.getContext();
69      }
70  
71      /*** {@inheritDoc} */
72      public Map<String, String> getInitParams() {
73          return context.getInitParams();
74      }
75  
76      /*** {@inheritDoc} */
77      public URL getResource(String path) throws IOException {
78          return context.getResource(path);
79      }
80  
81      /*** {@inheritDoc} */
82      public Set<URL> getResources(String path) throws IOException {
83          return context.getResources(path);
84      }
85  }