001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.kernel.cache;
022:
023: import com.liferay.portal.kernel.bean.BeanLocatorUtil;
024:
025: import java.io.Serializable;
026:
027: import java.util.Map;
028:
029: /**
030: * <a href="MultiVMPoolUtil.java.html"><b><i>View Source</i></b></a>
031: *
032: * @author Brian Wing Shun Chan
033: * @author Michael Young
034: *
035: */
036: public class MultiVMPoolUtil {
037:
038: public static void clear() {
039: getMultiVMPool().clear();
040: }
041:
042: public static void clear(String name) {
043: getMultiVMPool().clear(name);
044: }
045:
046: public static void clearGroup(Map groups, String groupKey,
047: PortalCache portalCache) {
048:
049: getMultiVMPool().clearGroup(groups, groupKey, portalCache);
050: }
051:
052: public static Object get(String name, String key) {
053: return getMultiVMPool().get(name, key);
054: }
055:
056: public static Object get(PortalCache portalCache, String key) {
057: return getMultiVMPool().get(portalCache, key);
058: }
059:
060: public static MultiVMPool getMultiVMPool() {
061: return _getUtil()._multiVMPool;
062: }
063:
064: public static PortalCache getCache(String name) {
065: return getMultiVMPool().getCache(name);
066: }
067:
068: public static void put(String name, String key, Object obj) {
069: getMultiVMPool().put(name, key, obj);
070: }
071:
072: public static void put(PortalCache portalCache, String key,
073: Object obj) {
074: getMultiVMPool().put(portalCache, key, obj);
075: }
076:
077: public static void put(PortalCache portalCache, String key,
078: Map groups, String groupKey, Object obj) {
079:
080: getMultiVMPool().put(portalCache, key, groups, groupKey, obj);
081: }
082:
083: public static void put(String name, String key, Serializable obj) {
084: getMultiVMPool().put(name, key, obj);
085: }
086:
087: public static void put(PortalCache portalCache, String key,
088: Serializable obj) {
089:
090: getMultiVMPool().put(portalCache, key, obj);
091: }
092:
093: public static void put(PortalCache portalCache, String key,
094: Map groups, String groupKey, Serializable obj) {
095:
096: getMultiVMPool().put(portalCache, key, groups, groupKey, obj);
097: }
098:
099: public static void remove(String name, String key) {
100: getMultiVMPool().remove(name, key);
101: }
102:
103: public static void remove(PortalCache portalCache, String key) {
104: getMultiVMPool().remove(portalCache, key);
105: }
106:
107: public static void updateGroup(Map groups, String groupKey,
108: String key) {
109: getMultiVMPool().updateGroup(groups, groupKey, key);
110: }
111:
112: public void setMultiVMPool(MultiVMPool multiVMPool) {
113: _multiVMPool = multiVMPool;
114: }
115:
116: private static MultiVMPoolUtil _getUtil() {
117: if (_util == null) {
118: _util = (MultiVMPoolUtil) BeanLocatorUtil.locate(_UTIL);
119: }
120:
121: return _util;
122: }
123:
124: private static final String _UTIL = MultiVMPoolUtil.class.getName();
125:
126: private static MultiVMPoolUtil _util;
127:
128: private MultiVMPool _multiVMPool;
129:
130: }
|