1
22
23 package com.liferay.counter.service.persistence;
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 CounterUtil {
36
37 public static List<String> getNames() throws SystemException {
38 return getPersistence().getNames();
39 }
40
41 public static CounterPersistence getPersistence() {
42 if (_persistence == null) {
43 _persistence = (CounterPersistence)PortalBeanLocatorUtil.locate(
44 CounterPersistence.class.getName());
45 }
46
47 return _persistence;
48 }
49
50 public static long increment() throws SystemException {
51 return getPersistence().increment();
52 }
53
54 public static long increment(String name) throws SystemException {
55 return getPersistence().increment(name);
56 }
57
58 public static long increment(String name, int size)
59 throws SystemException {
60
61 return getPersistence().increment(name, size);
62 }
63
64 public static void rename(String oldName, String newName)
65 throws SystemException {
66
67 getPersistence().rename(oldName, newName);
68 }
69
70 public static void reset(String name) throws SystemException {
71 getPersistence().reset(name);
72 }
73
74 public static void reset(String name, long size) throws SystemException {
75 getPersistence().reset(name, size);
76 }
77
78 public void setPersistence(CounterPersistence persistence) {
79 _persistence = persistence;
80 }
81
82 private static CounterPersistence _persistence;
83
84 }