Package org.apache.stratum.jcs.engine

Examples of org.apache.stratum.jcs.engine.CacheElement


            while ( notDone )
            {
                System.out.println( "enter mesage:" );
                message = br.readLine();
                CacheElement ce = new CacheElement( "test", "test", message );
                LateralElementDescriptor led = new LateralElementDescriptor( ce );
                lur.send( led );
            }
        }
        catch ( Exception e )
View Full Code Here


     */
    public final void put( Serializable key, Serializable value,
                     IElementAttributes attributes )
        throws IOException
    {
        CacheElement ce = new CacheElement( cacheName, key, value );

        ce.setElementAttributes( attributes );

        update( ce );
    }
View Full Code Here

    public void put( Serializable key, Serializable value, IElementAttributes attr )
        throws IOException
    {
        try
        {
            CacheElement ce = new CacheElement( cache.getCacheName(), key, value );
            ce.setElementAttributes( attr );
            update( ce );
        }
        catch ( IOException ex )
        {
            log.error( ex );
View Full Code Here

        // NOT GROUP RELATED
        try
        {
            //updateCaches( key, val, attr );
            CacheElement ce = new CacheElement( this.getCacheName(), key, val );
            ce.setElementAttributes( attr );
            super.update( ce, ICache.INCLUDE_REMOTE_CACHE );

        }
        catch ( IOException ioe )
        {
View Full Code Here

        try
        {
            // must make sure you call the sure here
            // updateCaches( key, val, attrE, ICache.INCLUDE_REMOTE_CACHE );
            // problem super calls back up and the last instruction gets confused
            CacheElement ce = new CacheElement( this.getCacheName(), key, val );
            ce.setElementAttributes( attrE );
            super.update( ce, ICache.INCLUDE_REMOTE_CACHE );
        }
        catch ( IOException ioe )
        {
        }
View Full Code Here

        try
        {

            // update the attribute.
            //updateCaches(key, val, attrE, INCLUDE_REMOTE_CACHE);
            CacheElement ce = new CacheElement( this.getCacheName(), key, val );
            ce.setElementAttributes( attrE );

            if ( log.isDebugEnabled() )
            {
                log.debug( "putGAN( gan,val,attr,boolean invocation) > updating group attribute via super" );
            }

            // SEND THE ELEMENT IF THE INVOCATION WAS LOCAL
            // decide what to do with this item
            boolean updateRemote = false;
            if ( invocation == ICache.LOCAL_INVOKATION )
            {
                updateRemote = ICache.INCLUDE_REMOTE_CACHE;
            }
            else
            {
                updateRemote = ICache.EXCLUDE_REMOTE_CACHE;
            }
            super.update( ce, updateRemote );

            // UPDATE THE ATTRIBUTENAME LIST, get it first
            GroupId groupId = new GroupId( this.getCacheName(), key.groupId );
            HashSet attrNameSet = null;
            attrNameSet = ( HashSet ) systemGroupIdCache.get( groupId.key, false );

            if ( attrNameSet == null )
            {
                attrNameSet = new HashSet();
            }
            attrNameSet.add( key.attrName );

            if ( log.isDebugEnabled() )
            {
                log.debug( "putGAN( gan,val,attr,boolean invocation) > attrNameSet.size()  = " + attrNameSet.size() );
            }

            CacheElement ceID = new CacheElement( this.getCacheName(), groupId.key, attrNameSet );
            ceID.setElementAttributes( attrE );

            // DO NOT SEND THE UPDATE LIST REMOTELY
            // THE ELEMENT WILL BE SENT AND THE LIST MAINTAINED REMOTELY
            systemGroupIdCache.updateExclude( ceID, EXCLUDE_REMOTE_CACHE );
            // could use the updateGroupAttr method?
View Full Code Here

    /** Description of the Method */
    public void remove( String cacheName, Serializable key, byte requesterId )
        throws IOException
    {
        CacheElement ce = new CacheElement( cacheName, key, null );
        LateralElementDescriptor led = new LateralElementDescriptor( ce );
        led.requesterId = requesterId;
        led.command = led.REMOVE;
        send( led );
    }
View Full Code Here

        {
            throw new CacheException( "createGroup(group,attr) > group " + group + " already exists " );
        }
        try
        {
            CacheElement ceID = new CacheElement( this.getCacheName(), groupId.key, attrNameSet );
            ceID.setElementAttributes( attrE );
            //updateCaches(groupId.key, attrNameSet, attrE );
            //super.update( ceID, EXCLUDE_REMOTE_CACHE );
            systemGroupIdCache.update( ceID, EXCLUDE_REMOTE_CACHE );

        }
View Full Code Here

    /** Description of the Method */
    public void removeAll( String cacheName, byte requesterId )
        throws IOException
    {
        CacheElement ce = new CacheElement( cacheName, "ALL", null );
        LateralElementDescriptor led = new LateralElementDescriptor( ce );
        led.requesterId = requesterId;
        led.command = led.REMOVEALL;
        send( led );
    }
View Full Code Here

            while ( notDone )
            {
                System.out.println( "enter mesage:" );
                message = br.readLine();
                CacheElement ce = new CacheElement( "test", "test", message );
                LateralElementDescriptor led = new LateralElementDescriptor( ce );
                lur.send( led );
            }
        }
        catch ( Exception e )
View Full Code Here

TOP

Related Classes of org.apache.stratum.jcs.engine.CacheElement

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.