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.counter.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.exception.SystemException;
19  
20  import java.util.List;
21  
22  /**
23   * <a href="CounterLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   */
27  public class CounterLocalServiceUtil {
28  
29      public static List<String> getNames() throws SystemException {
30          return getService().getNames();
31      }
32  
33      public static CounterLocalService getService() {
34          if (_service == null) {
35              _service = (CounterLocalService)PortalBeanLocatorUtil.locate(
36                  CounterLocalService.class.getName());
37          }
38  
39          return _service;
40      }
41  
42      public static long increment() throws SystemException {
43          return getService().increment();
44      }
45  
46      public static long increment(String name) throws SystemException {
47          return getService().increment(name);
48      }
49  
50      public static long increment(String name, int size) throws SystemException {
51          return getService().increment(name, size);
52      }
53  
54      public static void rename(String oldName, String newName)
55          throws SystemException {
56  
57          getService().rename(oldName, newName);
58      }
59  
60      public static void reset(String name) throws SystemException {
61          getService().reset(name);
62      }
63  
64      public static void reset(String name, long size) throws SystemException {
65          getService().reset(name, size);
66      }
67  
68      public void setService(CounterLocalService service) {
69          _service = service;
70      }
71  
72      private static CounterLocalService _service;
73  
74  }