Package org.jgroups.util

Examples of org.jgroups.util.UUID


        LazyRemovalCache<UUID, String> cache=new LazyRemovalCache<UUID, String>(10, 0);
        List<UUID> list=Arrays.asList(UUID.randomUUID(), UUID.randomUUID(), UUID.randomUUID());
        int cnt=1;
        for(UUID uuid: list)
            cache.add(uuid, "node-" + cnt++);
        UUID uuid1=UUID.randomUUID();
        UUID uuid2=UUID.randomUUID();
        cache.add(uuid1, "foo");
        cache.add(uuid2, "bar");
        System.out.println("cache = " + cache);
        assert cache.size() == 5;
View Full Code Here


    }


    public static void testRemovalOnExceedingMaxSize() {
        LazyRemovalCache<UUID, String> cache=new LazyRemovalCache<UUID, String>(2, 0);
        UUID u1=UUID.randomUUID(), u2=UUID.randomUUID(), u3=UUID.randomUUID(), u4=UUID.randomUUID();
        cache.add(u1, "u1"); cache.add(u2, "u2");
        assert cache.size() == 2;
        cache.add(u3, "u3"); cache.add(u4, "u4");
        System.out.println("cache = " + cache);
        assert cache.size() == 4;
View Full Code Here

        assert cache.size() == 1;
    }

    public void testValuesIterator() {
        LazyRemovalCache<UUID, String> cache=new LazyRemovalCache<UUID, String>(10, 10000);
        UUID u1=UUID.randomUUID(), u2=UUID.randomUUID(), u3=UUID.randomUUID(), u4=UUID.randomUUID();
        cache.add(u1, "u1"); cache.add(u2, "u2");
        cache.add(u3, "u3"); cache.add(u4, "u4");
        System.out.println("cache = " + cache);
        assert cache.size() == 4;
View Full Code Here

    /**
     * Generates new UUID and sets local address. Sends down a REMOVE_ADDRESS (if existing address was present) and
     * a SET_LOCAL_ADDRESS
     */
    protected void setAddress() {
        UUID old_addr=local_addr;
        local_addr=UUID.randomUUID();

        byte[] buf=(byte[])additional_data.get("additional_data");
        if(buf != null)
            local_addr.setAdditionalData(buf);
View Full Code Here

     * <li>Sets the channel closed and channel connected flags to true and false
     * <li>Notifies any channel listener of the channel close operation
     * </ol>
     */
    protected void _close(boolean disconnect, boolean close_mq) {
        UUID old_addr=local_addr;
        if(closed)
            return;

        if(disconnect)
            disconnect();                     // leave group if connected
View Full Code Here

TOP

Related Classes of org.jgroups.util.UUID

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.