1
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
27 public class CounterServiceUtil {
28
29 public static List<String> getNames() throws SystemException {
30 return getService().getNames();
31 }
32
33 public static CounterService getService() {
34 if (_service == null) {
35 _service = (CounterService)PortalBeanLocatorUtil.locate(
36 CounterService.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)
65 throws SystemException {
66
67 getService().reset(name, size);
68 }
69
70 public void setService(CounterService service) {
71 _service = service;
72 }
73
74 private static CounterService _service;
75
76 }