1
22
23 package com.liferay.counter.service.persistence;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.kernel.bean.BeanLocatorUtil;
27
28 import java.util.List;
29
30
36 public class CounterUtil {
37
38 public static List getNames() throws SystemException {
39 return getPersistence().getNames();
40 }
41
42 public static long increment() throws SystemException {
43 return getPersistence().increment();
44 }
45
46 public static long increment(String name) throws SystemException {
47 return getPersistence().increment(name);
48 }
49
50 public static long increment(String name, int size)
51 throws SystemException {
52
53 return getPersistence().increment(name, size);
54 }
55
56 public static void rename(String oldName, String newName)
57 throws SystemException {
58
59 getPersistence().rename(oldName, newName);
60 }
61
62 public static void reset(String name) throws SystemException {
63 getPersistence().reset(name);
64 }
65
66 public static void reset(String name, long size) throws SystemException {
67 getPersistence().reset(name, size);
68 }
69
70 public static CounterPersistence getPersistence() {
71 return _getUtil()._persistence;
72 }
73
74 public void setPersistence(CounterPersistence persistence) {
75 _persistence = persistence;
76 }
77
78 private static CounterUtil _getUtil() {
79 if (_util == null) {
80 _util = (CounterUtil)BeanLocatorUtil.locate(_UTIL);
81 }
82
83 return _util;
84 }
85
86 private static final String _UTIL = CounterUtil.class.getName();
87
88 private static CounterUtil _util;
89
90 private CounterPersistence _persistence;
91
92 }