Package org.apache.jcs.engine.control

Examples of org.apache.jcs.engine.control.CompositeCache


        Arrays.sort( cacheNames );

        LinkedList cacheInfo = new LinkedList();

        CacheRegionInfo regionInfo;
        CompositeCache cache;

        for ( int i = 0; i < cacheNames.length; i++ )
        {
            cache = ( CompositeCache ) cacheHub.getCache( cacheNames[ i ] );
View Full Code Here


            // ordered cache item update and notification.
            synchronized ( cacheDesc )
            {
                try
                {
                    CompositeCache c = ( CompositeCache ) cacheDesc.cache;

                    //TODO; make this a bit less of a hack
                    // If the source of this request was from a cluster, then
                    // update the remote caches.  COnsider it a local update.
                    // This requires that two local caches not be connected to
                    // two clustered remote caches. The failover runner will
                    // have to make sure of this.  ALos, the local cache needs
                    // avoid updating this source.  Will need to pass the source
                    // id somehow.  The remote cache should udate all local caches
                    // but not update the cluster source.  Cluster remote caches
                    // should only be updated by the server and not the RemoteCache.
                    // PUT LOGIC IN REMOTE CACHE
                    // WILL TRY UPDATING REMOTES
                    if ( fromCluster )
                    {
                        if ( log.isDebugEnabled() )
                        {
                            log.debug( "not updating clusters **************************************" );
                        }

                        c.localUpdate( item );
                    }
                    else
                    {
                        if ( log.isDebugEnabled() )
                        {
                            log.debug( "updating clusters **************************************" );
                        }

                        c.update( item );
                    }
                }
                catch ( Exception oee )
                {
                }
View Full Code Here

        {
            return null;
        }
        else
        {
            CompositeCache c = ( CompositeCache ) cacheDesc.cache;

            return c.localGet( key );
        }
    }
View Full Code Here

        {
            return Collections.EMPTY_SET;
        }
        else
        {
            CompositeCache c = ( CompositeCache ) cacheDesc.cache;
            return c.getGroupKeys(group);
        }
    }
View Full Code Here

            {

                boolean removeSuccess = false;

                // No need to notify if it was not cached.
                CompositeCache c = ( CompositeCache ) cacheDesc.cache;

                if ( fromCluster )
                {
                    if ( log.isDebugEnabled() )
                    {
                        log.debug( "not updating clusters **************************************" );
                    }
                    removeSuccess = c.localRemove( key );
                }
                else
                {
                    if ( log.isDebugEnabled() )
                    {
                        log.debug( "updating clusters **************************************" );
                    }
                    removeSuccess = c.remove( key );
                }

                if ( removeSuccess )
                {

View Full Code Here

        throws Exception
    {
        CompositeCacheManager cacheMgr = CompositeCacheManager
            .getUnconfiguredInstance();
        cacheMgr.configure( "/TestDiskCache.ccf" );
        CompositeCache cache = cacheMgr.getCache( region );

        LRUMemoryCache lru = new LRUMemoryCache();
        lru.initialize(cache);

        // Add items to cache

        for ( int i = 0; i < items; i++ )
        {
            ICacheElement ice = new CacheElement(
                cache.getCacheName(), i + ":key", region + " data " + i);
            ice.setElementAttributes(cache.getElementAttributes().copy());
            lru.update(ice);
        }

        // Test that initial items have been purged
View Full Code Here

            Serializable val = item.getVal();

            log.debug( "item read in = " + item );
            log.debug( "item.getKey = " + item.getKey() );

            CompositeCache cache = ( CompositeCache ) cacheMgr.getCache( hashtableName );
            try
            {
                // need to set as from lateral
                cache.localUpdate( item );
            }
            catch ( Exception e )
            {
                // Ignored -- log it?
            }
View Full Code Here

    protected CompositeCache createSystemCache( String cacheName,
                                       AuxiliaryCache[] auxCaches,
                                       ICompositeCacheAttributes cattr,
                                       IElementAttributes attr )
    {
        CompositeCache systemGroupIdCache =
            ( CompositeCache ) systemCaches.get( "groupIdCache" );

        return new GroupCache( cacheName, auxCaches, cattr, attr,
                               systemGroupIdCache );
    }
View Full Code Here

    protected CompositeCache createCache( String cacheName,
                                 AuxiliaryCache[] auxCaches,
                                 ICompositeCacheAttributes cattr,
                                 IElementAttributes attr )
    {
        CompositeCache systemGroupIdCache =
            ( CompositeCache ) systemCaches.get( "groupIdCache" );

        return new GroupCache( cacheName, auxCaches, cattr, attr,
                               systemGroupIdCache );
    }
View Full Code Here

                    log.debug( "puts = " + puts );
                }
            }

            getCacheManager();
            CompositeCache cache = cacheMgr.getCache( cb.getCacheName() );

            cache.localUpdate( cb );
        }

        return;
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.engine.control.CompositeCache

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.