1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.util.service;
16  
17  import com.liferay.portal.kernel.configuration.Configuration;
18  import com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil;
19  import com.liferay.portal.kernel.configuration.Filter;
20  
21  import java.util.Properties;
22  
23  /**
24   * <a href="ServiceProps.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public class ServiceProps {
29  
30      public static void addProperties(Properties properties) {
31          _instance._configuration.addProperties(properties);
32      }
33  
34      public static boolean contains(String key) {
35          return _instance._configuration.contains(key);
36      }
37  
38      public static String get(String key) {
39          return _instance._configuration.get(key);
40      }
41  
42      public static String get(String key, Filter filter) {
43          return _instance._configuration.get(key, filter);
44      }
45  
46      public static String[] getArray(String key) {
47          return _instance._configuration.getArray(key);
48      }
49  
50      public static String[] getArray(String key, Filter filter) {
51          return _instance._configuration.getArray(key, filter);
52      }
53  
54      public static Properties getProperties() {
55          return _instance._configuration.getProperties();
56      }
57  
58      public static void removeProperties(Properties properties) {
59          _instance._configuration.removeProperties(properties);
60      }
61  
62      public static void set(String key, String value) {
63          _instance._configuration.set(key, value);
64      }
65  
66      private ServiceProps() {
67          _configuration = ConfigurationFactoryUtil.getConfiguration(
68              ServiceProps.class.getClassLoader(), "service");
69      }
70  
71      private static ServiceProps _instance = new ServiceProps();
72  
73      private Configuration _configuration;
74  
75  }