Examples of ICache


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

    /** Get an aux cache for the listed aux for a region. */
    protected ICache parseAuxiliary( Properties props,
                                     String auxName,
                                     String regName )
    {
        ICache auxCache;

        // GET FACTORY
        IAuxiliaryCacheFactory auxFac = ccMgr.registryFacGet( auxName );
        if ( auxFac == null )
        {
View Full Code Here

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

        if ( log.isDebugEnabled() )
        {
            log.debug( "handleRemoveAll> cacheName=" + cacheName );
        }
        getCacheManager();
        ICache cache = cacheMgr.getCache( cacheName );
        cache.removeAll();
    }
View Full Code Here

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

     * @return A cache, either from the existing set or newly created.
     *
     */
    public ICache getCache( IIndexedDiskCacheAttributes cacheAttributes )
    {
        ICache cache = null;

        String cacheName = cacheAttributes.getCacheName();

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

View Full Code Here

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

     *
     * @param cacheName Name of cache to dispose.
     */
    public void freeCache( String cacheName )
    {
        ICache cache = ( ICache ) caches.get( cacheName );

        if ( cache != null )
        {
            try
            {
                cache.dispose();
            }
            catch ( Exception e )
            {
                log.error( "Failure disposing cache: " + cacheName, e );
            }
View Full Code Here

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

        StringBuffer stats = new StringBuffer();
        Enumeration allCaches = caches.elements();

        while ( allCaches.hasMoreElements() )
        {
            ICache raf = ( ICache ) allCaches.nextElement();

            if ( raf != null )
            {
                stats.append( raf.getStats() );
                stats.append( ", " );
            }
        }

        return stats.toString();
View Full Code Here

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

        {
            Enumeration allCaches = caches.elements();

            while ( allCaches.hasMoreElements() )
            {
                ICache cache = ( ICache ) allCaches.nextElement();

                if ( cache != null )
                {
                    try
                    {
                        cache.dispose();
                    }
                    catch ( Exception e )
                    {
                        log.error( "Failure disposing cache: " +
                            cache.getCacheName(), e );
                    }
                }
            }
        }
    }
View Full Code Here

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

        String result = "";

        try
        {

            ICache cache = cacheMgr.getCache( cacheName );

            if ( key != null )
            {
                if ( key.toUpperCase().equals( "ALL" ) )
                {
                    cache.removeAll();

                    if ( log.isDebugEnabled() )
                    {
                        log.debug( "Removed all elements from " + cacheName );
                    }
                    result = "key = " + key;
                }
                else
                {
                    if ( log.isDebugEnabled() )
                    {
                        log.debug( "key = " + key );
                    }
                    result = "key = " + key;
                    StringTokenizer toke = new StringTokenizer( key, "_" );

                    while ( toke.hasMoreElements() )
                    {
                        String temp = ( String ) toke.nextElement();
                        cache.remove( key );

                        if ( log.isDebugEnabled() )
                        {
                            log.debug( "Removed " + temp + " from " + cacheName );
                        }
View Full Code Here

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

    /** Description of the Method */
    public String stats( String cacheName )
    {

        ICache cache = cacheMgr.getCache( cacheName );

        return cache.getStats();
    }
View Full Code Here

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

        {
            Hashtable ht = new Hashtable();
            String name = list[i];
            ht.put( "name", name );

            ICache cache = cacheMgr.getCache( name );
            int size = cache.getSize();
            ht.put( "size", Integer.toString( size ) );

            int status = cache.getStatus();
            String stat = status == ICache.STATUS_ALIVE ? "ALIVE"
                 : status == ICache.STATUS_DISPOSED ? "DISPOSED"
                 : status == ICache.STATUS_ERROR ? "ERROR"
                 : "UNKNOWN";
            ht.put( "stat", stat );
View Full Code Here

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

                primayDefined = true;

                failovers.add( rca.getRemoteHost() + ":" + rca.getRemotePort() );

                RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
                ICache ic = rcm.getCache( rca );
                if ( ic != null )
                {
                    noWaits.add( ic );
                }
                else
                {
                    //p( "noWait is null" );
                }
            }

            // GET HANDLE BUT DONT REGISTER A LISTENER FOR FAILOVERS
            String failoverList = rca.getFailoverServers();
            if ( failoverList != null )
            {
                StringTokenizer fit = new StringTokenizer( failoverList, "," );
                int fCnt = 0;
                while ( fit.hasMoreElements() )
                {
                    fCnt++;

                    String server = ( String ) fit.nextElement();
                    failovers.add( server );

                    rca.setRemoteHost( server.substring( 0, server.indexOf( ":" ) ) );
                    rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
                    RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
                    // add a listener if there are none, need to tell rca what number it is at
                    if ( ( !primayDefined && fCnt == 1 ) || noWaits.size() <= 0 )
                    {
                        ICache ic = rcm.getCache( rca );
                        if ( ic != null )
                        {
                            noWaits.add( ic );
                        }
                        else
                        {
                            //p( "noWait is null" );
                        }
                    }
                }
                // end while
            }
            // end if failoverList != null

            rca.setFailovers( ( String[] ) failovers.toArray( new String[0] ) );

            // if CLUSTER
        }
        else
            if ( rca.getRemoteType() == rca.CLUSTER )
        {

            // REGISTER LISTENERS FOR EACH SYSTEM CLUSTERED CACHEs
            StringTokenizer it = new StringTokenizer( rca.getClusterServers(), "," );
            while ( it.hasMoreElements() )
            {
                //String server = (String)it.next();
                String server = ( String ) it.nextElement();
                //p( "tcp server = " +  server );
                rca.setRemoteHost( server.substring( 0, server.indexOf( ":" ) ) );
                rca.setRemotePort( Integer.parseInt( server.substring( server.indexOf( ":" ) + 1 ) ) );
                RemoteCacheManager rcm = RemoteCacheManager.getInstance( rca );
                rca.setRemoteType( rca.CLUSTER );
                ICache ic = rcm.getCache( rca );
                if ( ic != null )
                {
                    noWaits.add( ic );
                }
                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.