Examples of ICacheEventQueue


Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        }
        int count = 0;
        // Set those not qualified to null;  Count those qualified.
        for ( int i = 0; i < list.length; i++ )
        {
            ICacheEventQueue q = list[i];
            if ( q.isAlive() && q.getListenerId() != requesterId )
            {
                count++;
            }
            else
            {
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        synchronized ( eventQMap )
        {
            for ( Iterator itr = eventQMap.entrySet().iterator(); itr.hasNext())
            {
                Map.Entry e = ( Map.Entry ) itr.next();
                ICacheEventQueue q = ( ICacheEventQueue ) e.getValue();

                if ( !q.isAlive() )
                {
                    itr.remove();
                    p1( "Cache event queue " + q + " dead and removed from cache server." );
                }
            }
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        try
        {
            CacheListeners cacheDesc = getCacheListeners( cacheName );
            Map eventQMap = cacheDesc.eventQMap;
            cleanupEventQMap( eventQMap );
            ICacheEventQueue q = ( ICacheEventQueue ) eventQMap.remove( listener );

            if ( q != null )
            {
                q.destroy();
            }
            if ( log.isDebugEnabled() )
            {
                log.debug( "****** Cache " + cacheName + "'s listener size=" + cacheDesc.eventQMap.size() );
            }
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        ICacheElement element = new CacheElement( "testUpdate", "key", "value" );

        // DO WORK
        noWait.update( element );
        SleepUtil.sleepAtLeast( 10 );
        ICacheEventQueue originalQueue = noWait.getCacheEventQueue();

        noWait.fixCache( service );

        noWait.update( element );
        SleepUtil.sleepAtLeast( 10 );
        ICacheEventQueue newQueue = noWait.getCacheEventQueue();

        // VERIFY
        assertEquals( "Wrong status", service, client.fixed );
        assertFalse( "Original queue should not alive", originalQueue.isAlive() );
        assertTrue( "New queue should be alive." + newQueue, newQueue.isAlive() );
    }
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        }
        int count = 0;
        // Set those not qualified to null; Count those qualified.
        for ( int i = 0; i < list.length; i++ )
        {
            ICacheEventQueue q = list[i];
            if ( q.isWorking() && q.getListenerId() != requesterId )
            {
                count++;
            }
            else
            {
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        synchronized ( eventQMap )
        {
            for ( Iterator itr = eventQMap.entrySet().iterator(); itr.hasNext(); )
            {
                Map.Entry e = (Map.Entry) itr.next();
                ICacheEventQueue q = (ICacheEventQueue) e.getValue();

                // this does not care if the q is alive (i.e. if
                // there are active threads; it cares if the queue
                // is working -- if it has not encoutnered errors
                // above the failure threshhold
                if ( !q.isWorking() )
                {
                    itr.remove();
                    log.warn( "Cache event queue " + q + " is not working and removed from cache server." );
                }
            }
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

            {
                log.error( "Problem setting listener id, listenerAddress [" + listenerAddress + "]", ioe );
            }

            CacheEventQueueFactory fact = new CacheEventQueueFactory();
            ICacheEventQueue q = fact.createCacheEventQueue( listener, id, cacheName, rcsa.getEventQueuePoolName(),
                                                             rcsa.getEventQueueTypeFactoryCode() );

            eventQMap.put( new Long( listener.getListenerId() ), q );

            if ( log.isInfoEnabled() )
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

        {
            cacheDesc = getCacheListeners( cacheName );
        }
        Map eventQMap = cacheDesc.eventQMap;
        cleanupEventQMap( eventQMap );
        ICacheEventQueue q = (ICacheEventQueue) eventQMap.remove( new Long( listenerId ) );

        if ( q != null )
        {
            if ( log.isDebugEnabled() )
            {
                log.debug( "Found queue for cache region = [" + cacheName + "] and listenerId  [" + listenerId + "]" );
            }
            q.destroy();
            cleanupEventQMap( eventQMap );
        }
        else
        {
            if ( log.isDebugEnabled() )
View Full Code Here

Examples of org.apache.jcs.engine.behavior.ICacheEventQueue

     * listener id, so we should create a new queue. We should let the old queue drain. If we were
     * conencted to the failover, it would be best to finish sending items.
     */
    public void resetEventQ()
    {
        ICacheEventQueue previousQueue = cacheEventQueue;

        CacheEventQueueFactory fact = new CacheEventQueueFactory();
        this.cacheEventQueue = fact.createCacheEventQueue( new CacheAdaptor( cache ), cache.getListenerId(), cache.getCacheName(),
                                             cache.getAuxiliaryCacheAttributes().getEventQueuePoolName(), cache
                                                 .getAuxiliaryCacheAttributes().getEventQueueTypeFactoryCode() );

        if ( previousQueue.isWorking() )
        {
            // we don't expect anything, it would have all gone to the zombie
            if ( log.isInfoEnabled() )
            {
                log.info( "resetEventQ, previous queue has [" + previousQueue.size() + "] items queued up." );
            }
            previousQueue.destroy();
        }
    }
View Full Code Here

Examples of org.apache.stratum.jcs.engine.behavior.ICacheEventQueue

        }
        int count = 0;
        // Set those not qualified to null;  Count those qualified.
        for ( int i = 0; i < list.length; i++ )
        {
            ICacheEventQueue q = list[i];
            if ( q.isAlive() && q.getListenerId() != requesterId )
            {
                count++;
            }
            else
            {
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.