Examples of AuxiliaryCache


Examples of org.apache.jcs.auxiliary.AuxiliaryCache

     * @param cattr
     * @return
     */
    protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState )
    {
        AuxiliaryCache raf;
        raf = new JDBCDiskCache( cattr, tableState );
        return raf;
    }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

     *            Attributes the cache should have.
     * @return A cache, either from the existing set or newly created.
     */
    public AuxiliaryCache getCache( BlockDiskCacheAttributes cacheAttributes )
    {
        AuxiliaryCache cache = null;

        String cacheName = cacheAttributes.getCacheName();

        log.debug( "Getting cache named: " + cacheName );

View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

                // Item not found in memory. If local invocation look in aux
                // caches, even if not local look in disk auxiliaries

                for ( int i = 0; i < auxCaches.length; i++ )
                {
                    AuxiliaryCache aux = auxCaches[i];

                    if ( aux != null )
                    {
                        long cacheType = aux.getCacheType();

                        if ( !localOnly || cacheType == AuxiliaryCache.DISK_CACHE )
                        {
                            if ( log.isDebugEnabled() )
                            {
                                log.debug( "Attempting to get from aux [" + aux.getCacheName() + "] which is of type: "
                                    + cacheType );
                            }

                            try
                            {
                                element = aux.get( key );
                            }
                            catch ( IOException ex )
                            {
                                log.error( "Error getting from aux", ex );
                            }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

    {
        HashSet allKeys = new HashSet();
        allKeys.addAll( memCache.getGroupKeys( group ) );
        for ( int i = 0; i < auxCaches.length; i++ )
        {
            AuxiliaryCache aux = auxCaches[i];
            if ( aux != null )
            {
                try
                {
                    allKeys.addAll( aux.getGroupKeys( group ) );
                }
                catch ( IOException e )
                {
                    // ignore
                }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

        auxStats[0] = getMemoryCache().getStatistics();

        for ( int i = 0; i < auxCaches.length; i++ )
        {
            AuxiliaryCache aux = auxCaches[i];
            auxStats[i + 1] = aux.getStatistics();
        }

        // sore the auxiliary stats
        stats.setAuxiliaryCacheStats( auxStats );
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

     * @param cattr
     * @return
     */
    protected AuxiliaryCache createJDBCDiskCache( JDBCDiskCacheAttributes cattr, TableState tableState )
    {
        AuxiliaryCache raf = new MySQLDiskCache( (MySQLDiskCacheAttributes) cattr, tableState );

        scheduleOptimizations( (MySQLDiskCacheAttributes) cattr, tableState );

        return raf;
    }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

        attributes.setLocalPort( 1202 );
        attributes.setRemotePort( 1101 );

        RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager );
        String regionName = "testSinglePut";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        System.out.println( server.getStats() );
        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );

        // DO WORK
        ICacheElement result = cache.get( "key" );

        // VERIFY
        assertEquals( "Wrong element.", element.getVal(), result.getVal() );
    }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

        attributes.setLocalPort( 1202 );
        attributes.setRemotePort( 1101 );

        RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager );
        String regionName = "testPutRemove";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        System.out.println( server.getStats() );
        assertEquals( "Wrong number of puts", 1, server.getPutCount() - numPutsPrior );

        // DO WORK
        ICacheElement result = cache.get( "key" );

        // VERIFY
        assertEquals( "Wrong element.", element.getVal(), result.getVal() );

        // DO WORK
        cache.remove( "key" );
        SleepUtil.sleepAtLeast( 50 );
        ICacheElement resultAfterRemote = cache.get( "key" );

        // VERIFY
        assertNull( "Element resultAfterRemote should be null.", resultAfterRemote );
    }
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

        attributes.setLocalPort( 1202 );
        attributes.setRemotePort( 1101 );

        RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager );
        String regionName = "testPutAndListen";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        RemoteCacheListenerMockImpl listener = new RemoteCacheListenerMockImpl();
        server.addCacheListener( regionName, listener );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        ICacheElement element = new CacheElement( regionName, "key", "value" );
        cache.update( element );
        SleepUtil.sleepAtLeast( 50 );

        // VERIFY
        try
        {
View Full Code Here

Examples of org.apache.jcs.auxiliary.AuxiliaryCache

        attributes.setLocalPort( 1202 );
        attributes.setRemotePort( 1101 );

        RemoteCacheManager remoteCacheManager = RemoteCacheManager.getInstance( attributes, compositeCacheManager );
        String regionName = "testPutAndListen";
        AuxiliaryCache cache = remoteCacheManager.getCache( regionName );

        RemoteCacheListenerMockImpl listener = new RemoteCacheListenerMockImpl();
        server.addCacheListener( regionName, listener );

        // DO WORK
        int numPutsPrior = server.getPutCount();
        int numToPut = 100;
        for ( int i = 0; i < numToPut; i++ )
        {
            ICacheElement element = new CacheElement( regionName, "key" + 1, "value" + i );
            cache.update( element );
        }
        SleepUtil.sleepAtLeast( 500 );

        // VERIFY
        System.out.println( server.getStats() );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.