001
014
015 package com.liferay.portal.kernel.cache.cluster;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019
020
023 public class PortalCacheClusterLinkUtil {
024
025 public static PortalCacheClusterLink getPortalCacheClusterLink() {
026 if (_portalCacheClusterLink == null) {
027 if (_log.isWarnEnabled()) {
028 _log.warn(
029 "PortalCacheClusterLinkUtil has not been initialized.");
030 }
031
032 return null;
033 }
034
035 return _portalCacheClusterLink;
036 }
037
038 public static long getSubmittedEventNumber() {
039 if (_portalCacheClusterLink == null) {
040 if (_log.isWarnEnabled()) {
041 _log.warn(
042 "PortalCacheClusterLinkUtil has not been initialized.");
043 }
044
045 return -1;
046 }
047
048 return _portalCacheClusterLink.getSubmittedEventNumber();
049 }
050
051 public static void sendEvent(
052 PortalCacheClusterEvent portalCacheClusterEvent) {
053
054 if (_portalCacheClusterLink == null) {
055 if (_log.isWarnEnabled()) {
056 _log.warn(
057 "PortalCacheClusterLinkUtil has not been initialized.");
058 }
059
060 return;
061 }
062
063 _portalCacheClusterLink.sendEvent(portalCacheClusterEvent);
064 }
065
066 public void setPortalCacheClusterLink(
067 PortalCacheClusterLink portalCacheClusterLink) {
068
069 _portalCacheClusterLink = portalCacheClusterLink;
070 }
071
072 private static Log _log = LogFactoryUtil.getLog(
073 PortalCacheClusterLinkUtil.class);
074
075 private static PortalCacheClusterLink _portalCacheClusterLink;
076
077 }