1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.kernel.cache;
16  
17  import java.io.Serializable;
18  
19  /**
20   * <a href="SingleVMPoolUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * @author Brian Wing Shun Chan
23   * @author Michael Young
24   */
25  public class SingleVMPoolUtil {
26  
27      public static void clear() {
28          getSingleVMPool().clear();
29      }
30  
31      public static void clear(String name) {
32          getSingleVMPool().clear(name);
33      }
34  
35      public static Object get(String name, String key) {
36          return getSingleVMPool().get(name, key);
37      }
38  
39      /**
40       * @deprecated
41       */
42      public static Object get(PortalCache portalCache, String key) {
43          return getSingleVMPool().get(portalCache, key);
44      }
45  
46      public static PortalCache getCache(String name) {
47          return getSingleVMPool().getCache(name);
48      }
49  
50      public static PortalCache getCache(String name, boolean blocking) {
51          return getSingleVMPool().getCache(name, blocking);
52      }
53  
54      public static SingleVMPool getSingleVMPool() {
55          return _singleVMPool;
56      }
57  
58      public static void put(String name, String key, Object obj) {
59          getSingleVMPool().put(name, key, obj);
60      }
61  
62      /**
63       * @deprecated
64       */
65      public static void put(PortalCache portalCache, String key, Object obj) {
66          getSingleVMPool().put(portalCache, key, obj);
67      }
68  
69      /**
70       * @deprecated
71       */
72      public static void put(
73          PortalCache portalCache, String key, Object obj, int timeToLive) {
74  
75          getSingleVMPool().put(portalCache, key, obj, timeToLive);
76      }
77  
78      public static void put(String name, String key, Serializable obj) {
79          getSingleVMPool().put(name, key, obj);
80      }
81  
82      /**
83       * @deprecated
84       */
85      public static void put(
86          PortalCache portalCache, String key, Serializable obj) {
87  
88          getSingleVMPool().put(portalCache, key, obj);
89      }
90  
91      /**
92       * @deprecated
93       */
94      public static void put(
95          PortalCache portalCache, String key, Serializable obj, int timeToLive) {
96  
97          getSingleVMPool().put(portalCache, key, obj, timeToLive);
98      }
99  
100     public static void remove(String name, String key) {
101         getSingleVMPool().remove(name, key);
102     }
103 
104     /**
105      * @deprecated
106      */
107     public static void remove(PortalCache portalCache, String key) {
108         getSingleVMPool().remove(portalCache, key);
109     }
110 
111     public void setSingleVMPool(SingleVMPool singleVMPool) {
112         _singleVMPool = singleVMPool;
113     }
114 
115     private static SingleVMPool _singleVMPool;
116 
117 }