KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > services > config > ConfigService


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
18  */

19
20 package org.apache.pluto.portalImpl.services.config;
21
22 import org.apache.pluto.portalImpl.services.Service;
23 import org.apache.pluto.portalImpl.util.Parameters;
24
25 /**
26  ** The <CODE>ConfigService</CODE> holds the basic portal
27  ** configuration.
28  **
29  ** @see Config
30  **/

31
32 public abstract class ConfigService extends Service
33 {
34
35     /**
36      ** Returns the configuration parameters managed by this service.
37      **
38      ** @return the configuration parameters
39      **/

40
41     public abstract Parameters getParameters ();
42
43
44     public String JavaDoc getString (String JavaDoc name)
45     {
46         return getParameters().getString(name);
47     }
48
49     public String JavaDoc getString (String JavaDoc name, String JavaDoc defaultValue)
50     {
51         return getParameters().getString(name, defaultValue);
52     }
53
54     public Integer JavaDoc getInteger (String JavaDoc name)
55     {
56         return getParameters().getInteger(name);
57     }
58
59     public Integer JavaDoc getInteger (String JavaDoc name, Integer JavaDoc defaultValue)
60     {
61         return getParameters().getInteger(name, defaultValue);
62     }
63
64     public int getInteger (String JavaDoc name, int defaultValue)
65     {
66         return getParameters().getInteger(name, defaultValue);
67     }
68
69     public Boolean JavaDoc getBoolean (String JavaDoc name)
70     {
71         return getParameters().getBoolean(name);
72     }
73
74     public Boolean JavaDoc getBoolean (String JavaDoc name, Boolean JavaDoc defaultValue)
75     {
76         return getParameters().getBoolean(name, defaultValue);
77     }
78
79     public boolean getBoolean (String JavaDoc name, boolean defaultValue)
80     {
81         return getParameters().getBoolean(name, defaultValue);
82     }
83
84     public java.util.Iterator JavaDoc keys ()
85     {
86         return getParameters().keys();
87     }
88
89 }
90
Popular Tags