1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
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  }