1
22
23 package com.liferay.counter.service;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
27
28 import java.util.List;
29
30
35 public class CounterServiceUtil {
36
37 public static List<String> getNames() throws SystemException {
38 return getService().getNames();
39 }
40
41 public static CounterService getService() {
42 if (_service == null) {
43 _service = (CounterService)PortalBeanLocatorUtil.locate(
44 CounterService.class.getName());
45 }
46
47 return _service;
48 }
49
50 public static long increment() throws SystemException {
51 return getService().increment();
52 }
53
54 public static long increment(String name) throws SystemException {
55 return getService().increment(name);
56 }
57
58 public static long increment(String name, int size) throws SystemException {
59 return getService().increment(name, size);
60 }
61
62 public static void rename(String oldName, String newName)
63 throws SystemException {
64
65 getService().rename(oldName, newName);
66 }
67
68 public static void reset(String name) throws SystemException {
69 getService().reset(name);
70 }
71
72 public static void reset(String name, long size)
73 throws SystemException {
74
75 getService().reset(name, size);
76 }
77
78 public void setService(CounterService service) {
79 _service = service;
80 }
81
82 private static CounterService _service;
83
84 }