Package de.javakaffee.web.msm.MemcachedNodesManager

Examples of de.javakaffee.web.msm.MemcachedNodesManager.MemcachedClientCallback


            }
        };
    }

  protected MemcachedClientCallback createMemcachedClientCallback() {
    return new MemcachedClientCallback() {
      @Override
      public Object get(final String key) {
        return _memcached.get(_memcachedNodesManager.getStorageKeyFormat().format( key ));
      }
    };
View Full Code Here


        return null;
    }

    @Override
    protected MemcachedClientCallback createMemcachedClientCallback() {
      return new MemcachedClientCallback() {
      @Override
      public Object get(final String key) {
        return null;
      }
    };
View Full Code Here

    @Test
    public void testGetNextAvailableNodeId() {
        assertNull(createFor( "n1:localhost:11211", null, null, _mcc ).getNextAvailableNodeId("n1"));
        assertEquals(createFor( "n1:localhost:11211,n2:localhost:11212", null, null, _mcc ).getNextAvailableNodeId("n1"), "n2");

        final MemcachedClientCallback mcc = mock(MemcachedClientCallback.class);
        when(mcc.get(anyString())).thenReturn(null);
        when(mcc.get(endsWith("n2"))).thenThrow(new OperationTimeoutException("SimulatedException"));
        assertNull(createFor( "n1:localhost:11211,n2:localhost:11212", null, null, mcc).getNextAvailableNodeId("n1"));

        assertEquals(createFor( "n1:localhost:11211,n2:localhost:11212,n3:localhost:11213", null, null, mcc).getNextAvailableNodeId("n1"), "n3");
    }
View Full Code Here

TOP

Related Classes of de.javakaffee.web.msm.MemcachedNodesManager.MemcachedClientCallback

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.