Package org.apache.directmemory.memory

Examples of org.apache.directmemory.memory.Pointer


        String obj = "Simple String Object";
        Cache.init( 1, Ram.Mb( 16 ) );
        Cache.scheduleDisposalEvery( Every.seconds( 1 ) );
        Cache.dump();

        Pointer p = Cache.put( "1", obj );
        Object result = Cache.retrieve( "1" );

        Cache.dump();
        Monitor.dump( "cache" );
View Full Code Here


        SimpleObject obj2 = new SimpleObject( "2", "Object Two" );
        Cache.init( 1, Ram.Mb( 16 ) );
        Cache.scheduleDisposalEvery( Every.seconds( 1 ) );
        Cache.dump();

        Pointer p1 = Cache.put( "1", obj1 );
        Pointer p2 = Cache.put( "2", obj2 );
        Object result1 = Cache.retrieve( "1" );
        Object result2 = Cache.retrieve( "2" );

        Cache.dump();
        Monitor.dump( "cache" );
View Full Code Here

        cacheService.scheduleDisposalEvery( Every.seconds( 1 ) );
        cacheService.dump();
        Monitor.dump( "cache" );

        Pointer p = cacheService.put( "2", obj );
        result = cacheService.retrieve( "2" );
        cacheService.dump();
        assertEquals( obj, result );
    }
View Full Code Here

        CacheService cacheService = getOsgiService( CacheService.class );
        cacheService.scheduleDisposalEvery( Every.seconds( 1 ) );
        cacheService.dump();

        Pointer p1 = cacheService.put( "2", obj1 );
        Pointer p2 = cacheService.put( "3", obj2 );
        Object result1 = cacheService.retrieve( "2" );
        Object result2 = cacheService.retrieve( "3" );

        cacheService.dump();
        Monitor.dump( "cache" );
View Full Code Here

        String obj = "Simple String Object";
        Cache.init( 1, Ram.Mb( 16 ) );
        Cache.scheduleDisposalEvery( Every.seconds( 1 ) );
        Cache.dump();

        Pointer p = Cache.put( "1", obj );
        Object result = Cache.retrieve( "1" );

        Cache.dump();
        Monitor.dump( "cache" );
View Full Code Here

        SimpleObject obj2 = new SimpleObject( "2", "Object Two" );
        Cache.init( 1, Ram.Mb( 16 ) );
        Cache.scheduleDisposalEvery( Every.seconds( 1 ) );
        Cache.dump();

        Pointer p1 = Cache.put( "1", obj1 );
        Pointer p2 = Cache.put( "2", obj2 );
        Object result1 = Cache.retrieve( "1" );
        Object result2 = Cache.retrieve( "2" );

        Cache.dump();
        Monitor.dump( "cache" );
View Full Code Here

        cacheService.scheduleDisposalEvery( Every.seconds( 1 ) );
        cacheService.dump();
        Monitor.dump( "cache" );

        Pointer p = cacheService.put( "2", obj );
        result = cacheService.retrieve( "2" );
        cacheService.dump();
        assertEquals( obj, result );
    }
View Full Code Here

        CacheService cacheService = getOsgiService( CacheService.class );
        cacheService.scheduleDisposalEvery( Every.seconds( 1 ) );
        cacheService.dump();

        Pointer p1 = cacheService.put( "2", obj1 );
        Pointer p2 = cacheService.put( "3", obj2 );
        Object result1 = cacheService.retrieve( "2" );
        Object result2 = cacheService.retrieve( "3" );

        cacheService.dump();
        Monitor.dump( "cache" );
View Full Code Here

        }

        //if exists free first ?
        //if ( cacheService.retrieveByteArray( key ) == null )
        byte[] bytes = request.getCacheContent();
        Pointer p = cacheService.putByteArray( key, bytes, request.getExpiresIn() );
        if ( p == null )
        {
            resp.sendError( HttpServletResponse.SC_NO_CONTENT, "Content not put in cache for key: " + key );
            return;
        }
View Full Code Here

    {
        String path = req.getPathInfo();
        String servletPath = req.getServletPath();
        String key = retrieveKeyFromPath( path );

        Pointer pointer = cacheService.getPointer( key );
        if ( pointer == null )
        {
            resp.sendError( HttpServletResponse.SC_NO_CONTENT, "No content for key: " + key );
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.directmemory.memory.Pointer

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.