Package net.sf.jportlet.service.cache

Examples of net.sf.jportlet.service.cache.Cacheable


        CacheDescriptor     cache = _descriptor.getCacheDescriptor( request.getMode(  ) );
        String              id = getCacheableId( cache, request, response );
        PortletResponseImpl response2 = new PortletResponseImpl( this, request, response.getHttpResponse(  ) );
        String              body = null;
        CacheRegion         region = null;
        Cacheable           cacheable;

        /* Load the body from the cache */
        if ( id != null )
        {
            if ( debug )
            {
                _log.debug( "Loading portlet body from the cache.id=" + id );
            }

            region    = getCacheRegion(  );
            cacheable = region.get( id );
            if ( cacheable != null )
            {
                if ( !isDirty( request ) )
                {
                    if ( debug )
                    {
                        _log.debug( "...Portlet body found in the cache" );
                    }

                    body = ( String ) cacheable.getData(  );
                }
                else
                {
                    if ( debug )
                    {
                        _log.debug( "...Portlet dirty. expiring the portlet body" );
                    }

                    cacheable.expire(  );
                    body = null;
                }
            }
        }
        else
View Full Code Here


        if ( id != null )
        {
            /* Get the cacheable object */
            CacheRegion region = getCacheService( proxy ).getRegion( proxy.getDescriptor(  ).getName(  ), true );
            Cacheable   cacheable = region.get( id );
            if ( cacheable != null )
            {
                if ( !proxy.isDirty( request ) )
                {
                    if ( debug )
                    {
                        __log.debug( "...writing cached content into the portlet response" );
                    }

                    Object              data = cacheable.getData(  );
                    PortletResponseImpl resp = ( PortletResponseImpl ) response;
                    resp.getBuffer(  ).append( data );
                    return Interceptor.SKIP;
                }
                else
                {
                    if ( debug )
                    {
                        __log.debug( "...portlet dirty. expiring the portlet content" );
                    }

                    cacheable.expire(  );
                }
            }
        }

        return Interceptor.CONTINUE;
View Full Code Here

TOP

Related Classes of net.sf.jportlet.service.cache.Cacheable

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.