Examples of addElementEventHandler()


Examples of org.apache.jcs.engine.ElementAttributes.addElementEventHandler()

        String value = "value";

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

        ElementAttributes elementAttr = new ElementAttributes();
        elementAttr.addElementEventHandler( handler );
        elementAttr.setIsEternal( false );
        element.setElementAttributes( elementAttr );
        element.getElementAttributes().setMaxLifeSeconds( 1 );
        memory.update( element );
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

                            long n_start = System.currentTimeMillis();
                            for ( int n = 0; n < num; n++ )
                            {
                                IElementAttributes attrp = cache_control.getElementAttributes();
                                TestElementEventHandler hand = new TestElementEventHandler();
                                attrp.addElementEventHandler( hand );
                                cache_control.put( "key" + n,
                                    "data" + n + " put from ta = junk", attrp );
                            }
                            long n_end = System.currentTimeMillis();
                            p( "---put " + num + " in " + String.valueOf( n_end - n_start ) + " millis ---" );
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

                            long n_start = System.currentTimeMillis();
                            for ( int n = 0; n < num; n++ )
                            {
                                IElementAttributes attrp = cache_control.getElementAttributes();
                                TestElementEventHandler hand = new TestElementEventHandler();
                                attrp.addElementEventHandler( hand );
                                cache_control.put( "key" + n,
                                    "data" + n + " put from ta = junk", attrp );
                            }
                            long n_end = System.currentTimeMillis();
                            p( "---put " + num + " in " + String.valueOf( n_end - n_start ) + " millis ---" );
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

        MyEventHandler meh = new MyEventHandler();

        JCS jcs = JCS.getInstance( "WithDisk" );
        // this should add the event handler to all items as they are created.
        IElementAttributes attributes = jcs.getDefaultElementAttributes();
        attributes.addElementEventHandler( meh );
        jcs.setDefaultElementAttributes( attributes );

        // put them in
        for ( int i = 0; i <= items; i++ )
        {
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

        MyEventHandler meh = new MyEventHandler();

        // this should add the event handler to all items as they are created.
        IElementAttributes attributes = jcs.getDefaultElementAttributes();
        attributes.addElementEventHandler( meh );
        jcs.setDefaultElementAttributes( attributes );

        // put them in
        for ( int i = 0; i <= items; i++ )
        {
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

        MyEventHandler meh = new MyEventHandler();

        JCS jcs = JCS.getInstance( "DiskButNotAllowed" );
        // this should add the event handler to all items as they are created.
        IElementAttributes attributes = jcs.getDefaultElementAttributes();
        attributes.addElementEventHandler( meh );
        jcs.setDefaultElementAttributes( attributes );

        // put them in
        for ( int i = 0; i <= items; i++ )
        {
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

        // put them in
        for ( int i = 0; i <= items; i++ )
        {
            IElementAttributes attributes = jcs.getDefaultElementAttributes();
            attributes.addElementEventHandler( meh );
            jcs.put( i + ":key", "data" + i, attributes );
        }

        // wait a bit for it to finish
        Thread.sleep( items / 20 );
View Full Code Here

Examples of org.apache.jcs.engine.behavior.IElementAttributes.addElementEventHandler()

                            long n_start = System.currentTimeMillis();
                            for ( int n = 0; n < num; n++ )
                            {
                                IElementAttributes attrp = cache_control.getDefaultElementAttributes();
                                ElementEventHandlerMockImpl hand = new ElementEventHandlerMockImpl();
                                attrp.addElementEventHandler( hand );
                                cache_control.put( "key" + n, "data" + n + " put from ta = junk", attrp );
                            }
                            long n_end = System.currentTimeMillis();
                            p( "---put " + num + " in " + String.valueOf( n_end - n_start ) + " millis ---" );
                        }
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.