View Javadoc

1   /*
2    * Copyright 2003,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /*
17   * This source code implements specifications defined by the Java
18   * Community Process. In order to remain compliant with the specification
19   * DO NOT add / change / or delete method signatures!
20   */
21  package javax.portlet;
22  
23  
24  
25  
26  /***
27   * The <CODE>PortletConfig</CODE> interface provides the portlet with
28   * its configuration. The configuration holds information about the
29   * portlet that is valid for all users. The configuration is retrieved
30   * from the portlet definition in the deployment descriptor.
31   * The portlet can only read the configuration data.
32   * <p>
33   * The configuration information contains the portlet name, the portlet 
34   * initialization parameters, the portlet resource bundle and the portlet 
35   * application context.
36   * 
37   * @see Portlet
38   */
39  public interface PortletConfig
40  {
41  
42  
43  
44    /***
45     * Returns the name of the portlet.
46     * <P>
47     * The name may be provided via server administration, assigned in the
48     * portlet application deployment descriptor with the <code>portlet-name</code>
49     * tag.
50     *
51     * @return   the portlet name
52     */
53  
54    public String getPortletName ();
55  
56  
57    /***
58     * Returns the <code>PortletContext</code> of the portlet application 
59     * the portlet is in.
60     *
61     * @return   a <code>PortletContext</code> object, used by the 
62     *           caller to interact with its portlet container
63     *
64     * @see PortletContext
65     */
66  
67    public PortletContext getPortletContext ();
68  
69  
70    /***
71     * Gets the resource bundle for the given locale based on the
72     * resource bundle defined in the deployment descriptor
73     * with <code>resource-bundle</code> tag or the inlined resources
74     * defined in the deployment descriptor.
75     *
76     * @param    locale    the locale for which to retrieve the resource bundle
77     * 
78     * @return   the resource bundle for the given locale
79     *
80     */
81  
82    public java.util.ResourceBundle getResourceBundle(java.util.Locale locale);
83  
84  
85    /***
86     * Returns a String containing the value of the named initialization parameter, 
87     * or null if the parameter does not exist.
88     *
89     * @param name	a <code>String</code> specifying the name
90     *			of the initialization parameter
91     *
92     * @return		a <code>String</code> containing the value 
93     *			of the initialization parameter
94     *
95     * @exception	java.lang.IllegalArgumentException	
96     *                      if name is <code>null</code>.
97     */
98  
99    public String getInitParameter(java.lang.String name);
100 
101 
102   /***
103    * Returns the names of the portlet initialization parameters as an 
104    * <code>Enumeration</code> of String objects, or an empty <code>Enumeration</code> if the 
105    * portlet has no initialization parameters.    
106    *
107    * @return		an <code>Enumeration</code> of <code>String</code> 
108    *			objects containing the names of the portlet 
109    *			initialization parameters, or an empty <code>Enumeration</code> if the 
110    *                    portlet has no initialization parameters. 
111    */
112 
113   public java.util.Enumeration getInitParameterNames();
114 }
115