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