View Javadoc

1   /*
2    * Copyright (c) 2005-2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.danube.tapestry;
14  
15  import java.util.ArrayList;
16  import java.util.List;
17  
18  import org.apache.tapestry.describe.DescriptionReceiver;
19  import org.apache.tapestry.web.WebActivator;
20  
21  /**
22   * {@link WebActivator} interface implementation
23   *
24   *
25   * @author Daniel Sendula
26   */
27  public class DanubeActivator implements WebActivator {
28  
29      /** Handler */
30      protected TapestryConnectionHandler handler;
31  
32      /**
33       * Constructor
34       * @param handler handler
35       */
36      public DanubeActivator(TapestryConnectionHandler handler) {
37          this.handler = handler;
38      }
39  
40      /**
41       * Returns "Danube"
42       * @return "Danube"
43       */
44      public String getActivatorName() {
45          return "Danube";
46      }
47  
48      /**
49       * Returns an empty list
50       * @return an empty list
51       */
52      @SuppressWarnings("unchecked")
53      public List getInitParameterNames() {
54          ArrayList<String> names = new ArrayList<String>(handler.getInitialParameters().keySet());
55          return names;
56      }
57  
58      /**
59       * Returns <code>null</code>
60       * @param name parameter name
61       * @return <code>null</code>
62       */
63      public String getInitParameterValue(String name) {
64          return handler.getInitialParameters().get(name);
65      }
66  
67      /**
68       * Does nothing
69       */
70      public void describeTo(DescriptionReceiver receiver) {
71      }
72  
73  }