1/*2 * Copyright 2000-2001,2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.portletcache;
1819import org.apache.turbine.services.TurbineServices;
2021/***22 * This class is a static accessor for the PortletCache service23 * 24 * @author <a href="mailto:burton@apache.org">Kevin A. Burton</a>25 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>26 * @version $Id: PortletCache.java,v 1.4 2004/02/23 03:34:54 jford Exp $27 */28publicclassPortletCache {
2930/***31 * Add an object to the cache32 *33 * @see PortletCacheService#addCacheable34 */35publicstaticvoid addCacheable( Cacheable item ) {
3637PortletCacheService gcs = (PortletCacheService)TurbineServices
38 .getInstance()
39 .getService( PortletCacheService.SERVICE_NAME );
4041 gcs.addCacheable( item );
42 }
4344/***45 * Removes an object from the cache based on its handle46 *47 * @see PortletCacheService#removeCacheable48 */49publicstaticvoid removeCacheable( String handle ) {
5051PortletCacheService gcs = (PortletCacheService)TurbineServices
52 .getInstance()
53 .getService( PortletCacheService.SERVICE_NAME );
5455 gcs.removeCacheable( handle );
5657 }
5859/***60 * Retrieves an object from the cache61 *62 * @see PortletCacheService#getCacheable63 */64publicstaticCacheable getCacheable( String handle ) {
6566PortletCacheService gcs = (PortletCacheService)TurbineServices
67 .getInstance()
68 .getService( PortletCacheService.SERVICE_NAME );
6970return gcs.getCacheable( handle );
71 }
7273 }