1
14
15 package com.liferay.counter.service.persistence;
16
17 import com.liferay.portal.SystemException;
18 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19
20 import java.util.List;
21
22
27 public class CounterUtil {
28
29 public static List<String> getNames() throws SystemException {
30 return getPersistence().getNames();
31 }
32
33 public static CounterPersistence getPersistence() {
34 if (_persistence == null) {
35 _persistence = (CounterPersistence)PortalBeanLocatorUtil.locate(
36 CounterPersistence.class.getName());
37 }
38
39 return _persistence;
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 void setPersistence(CounterPersistence persistence) {
71 _persistence = persistence;
72 }
73
74 private static CounterPersistence _persistence;
75
76 }