Package org.apache.turbine.services.cache

Examples of org.apache.turbine.services.cache.CachedObject


     * @see PortletCacheService#removeCacheable
     * @param handle the identifier of the object we wish to retrieve
     */
    public void removeCacheable( String handle ) {
       
        CachedObject obj = null;
       
        try {
            obj = GlobalCache.getObject( handle );
        } catch ( ObjectExpiredException e) {
            // nothing to do if already expired
        }
       
        if ( obj != null ) {
            obj.setStale(true);
        }
    }
View Full Code Here


     * @param handle the identifier of the object we wish to retrieve
     * @return the cacehd object or null if not found
     */
    public Cacheable getCacheable( String handle ) {
       
        CachedObject obj = null;
       
        try {
            obj = GlobalCache.getObject( handle );
        } catch (ObjectExpiredException e) {
            logger.info( "cache miss, object expired: " + handle );
        }
       
        if ( obj == null ) {
            //Log.info( "cache miss: " + handle );
            return null;
        } /*else {
            Log.info( "cache hit: " + handle );
            } */
       
        return (Cacheable)obj.getContents();
       
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.cache.CachedObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.