1
14
15 package com.liferay.portal.kernel.cache.cluster;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19
20
25 public class PortalCacheClusterLinkUtil {
26
27 public static PortalCacheClusterLink getPortalCacheClusterLink() {
28 if (_portalCacheClusterLink == null) {
29 if (_log.isWarnEnabled()) {
30 _log.warn(
31 "PortalCacheClusterLinkUtil has not been initialized.");
32 }
33
34 return null;
35 }
36
37 return _portalCacheClusterLink;
38 }
39
40 public static long getSubmittedEventNumber() {
41 if (_portalCacheClusterLink == null) {
42 if (_log.isWarnEnabled()) {
43 _log.warn(
44 "PortalCacheClusterLinkUtil has not been initialized.");
45 }
46
47 return -1;
48 }
49
50 return _portalCacheClusterLink.getSubmittedEventNumber();
51 }
52
53 public static void sendEvent(
54 PortalCacheClusterEvent portalCacheClusterEvent) {
55
56 if (_portalCacheClusterLink == null) {
57 if (_log.isWarnEnabled()) {
58 _log.warn(
59 "PortalCacheClusterLinkUtil has not been initialized.");
60 }
61
62 return;
63 }
64
65 _portalCacheClusterLink.sendEvent(portalCacheClusterEvent);
66 }
67
68 public void setPortalCacheClusterLink(
69 PortalCacheClusterLink portalCacheClusterLink) {
70
71 _portalCacheClusterLink = portalCacheClusterLink;
72 }
73
74 private static Log _log = LogFactoryUtil.getLog(
75 PortalCacheClusterLinkUtil.class);
76
77 private static PortalCacheClusterLink _portalCacheClusterLink;
78
79 }