Package org.apache.jcs.auxiliary.lateral

Examples of org.apache.jcs.auxiliary.lateral.LateralCacheNoWaitFacade


        }

        createListener( (ILateralCacheAttributes) iaca, cacheMgr );

        // create the no wait facade.
        LateralCacheNoWaitFacade lcnwf = new LateralCacheNoWaitFacade( (LateralCacheNoWait[]) noWaits
            .toArray( new LateralCacheNoWait[0] ), (ILateralCacheAttributes)iaca );

        // create udp discovery if available.
        createDiscoveryService( lac, lcnwf, cacheMgr );
View Full Code Here


        // create a no wait facade for the service
        ArrayList noWaits = new ArrayList();
        ILateralCacheAttributes attr = new LateralCacheAttributes();
        attr.setCacheName( "testCache1" );

        LateralCacheNoWaitFacade lcnwf = new LateralCacheNoWaitFacade( (LateralCacheNoWait[]) noWaits
            .toArray( new LateralCacheNoWait[0] ), attr );

        // add the facade to the service under the name testCache1
        service.addNoWaitFacade( lcnwf, "testCache1" );
View Full Code Here

        throws Exception
    {
        ArrayList noWaits = new ArrayList();
        ILateralCacheAttributes attr = new LateralCacheAttributes();
        attr.setCacheName( "testCache1" );
        LateralCacheNoWaitFacade lcnwf = new LateralCacheNoWaitFacade( (LateralCacheNoWait[]) noWaits
            .toArray( new LateralCacheNoWait[0] ), attr );

        TCPLateralCacheAttributes lac = new TCPLateralCacheAttributes();
        lac.setTransmissionType( LateralCacheAttributes.TCP );
        lac.setTcpServer( "localhost" + ":" + 1111 );

        LateralCache cache = new MockLateralCache( lac );

        // add one
        LateralCacheNoWait noWait = new LateralCacheNoWait( cache );
        lcnwf.addNoWait( noWait );
        assertEquals( "Facade should have 1 no wait", 1, lcnwf.noWaits.length );

        // add another
        LateralCacheNoWait noWait2 = new LateralCacheNoWait( cache );
        lcnwf.addNoWait( noWait2 );
        assertEquals( "Facade should have 2 no waits", 2, lcnwf.noWaits.length );

        // try adding the same one again
        lcnwf.addNoWait( noWait2 );
        assertEquals( "Facade should still have 2 no waits", 2, lcnwf.noWaits.length );

    }
View Full Code Here

     *
     * @param noWait
     */
    protected void addNoWait( LateralCacheNoWait noWait )
    {
        LateralCacheNoWaitFacade facade = (LateralCacheNoWaitFacade) facades.get( noWait.getCacheName() );
        if ( log.isDebugEnabled() )
        {
            log.debug( "Got facade for " + noWait.getCacheName() + " = " + facade );
        }

        if ( facade != null )
        {
            boolean isNew = facade.addNoWait( noWait );
            if ( log.isDebugEnabled() )
            {
                log.debug( "Called addNoWait, isNew = " + isNew );
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jcs.auxiliary.lateral.LateralCacheNoWaitFacade

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.