Package org.jgroups.util

Examples of org.jgroups.util.UUID


    private static String printUUIDs(Membership mbrs) {
        StringBuilder sb=new StringBuilder();
        boolean first=true;
        for(int i=0; i < mbrs.size(); i++) {
            UUID mbr=(UUID)mbrs.elementAt(i);
            if(first)
                first=false;
            else
                sb.append(", ");
            sb.append(mbr.toStringLong());
        }
        return sb.toString();
    }
View Full Code Here


        isSender[1]=true;
        isSender[2]=true;

        // dummy IP addresses and ports
        for(int i=0; i < addresses.length; i++) {
            UUID uuid=UUID.randomUUID();
            UUID.add(uuid, "node-" + i);
            addresses[i]=uuid;
        }

        // dummy set of members which works for all three simulators
View Full Code Here

                    String addr_str=Util.readToken(in);
                    String coord_str=Util.readToken(in);
                    if(name_str == null || uuid_str == null || addr_str == null || coord_str == null)
                        break;

                    UUID uuid=null;
                    try {
                        long tmp=Long.valueOf(uuid_str);
                        uuid=new UUID(0, tmp);
                    }
                    catch(Throwable t) {
                        uuid=UUID.fromString(uuid_str);
                    }
View Full Code Here

            if(header.type == Relay2Header.DATA && can_forward_local_cluster) {
                SiteUUID site_uuid=(SiteUUID)hdr.final_dest;

                //  If configured to do so, we want to load-balance these messages,
                int index=(int)Util.random( members.size()) -1;
                UUID tmp=(UUID)members.get(index);
                SiteAddress final_dest=new SiteUUID(tmp, site_uuid.getName(), site_uuid.getSite());

                // If we select a different address to handle this message, we handle it here.
                if(!final_dest.equals(hdr.final_dest)) {
                    message=copy(msg);
View Full Code Here

                    throw new IllegalStateException("site master was null");
                send_to_coord=true;
            }
            else {
                SiteUUID tmp=(SiteUUID)dest;
                local_dest=new UUID(tmp.getMostSignificantBits(), tmp.getLeastSignificantBits());
            }
        }
        else
            local_dest=dest;
View Full Code Here

        try {
            for(RelayConfig.BridgeConfig bridge_config: bridge_configs) {
                Bridge bridge=new Bridge(bridge_config.createChannel(), bridge_config.getClusterName(), bridge_name,
                                         new AddressGenerator() {
                                             public Address generateAddress() {
                                                 UUID uuid=UUID.randomUUID();
                                                 return new SiteUUID(uuid, null, my_site_id);
                                             }
                                         });
                bridges.add(bridge);
            }
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

    private PingDao pingDao;
   
    @Test
    public void testPingLifecycle() throws UnknownHostException {
        final String cluster = "cluster";
        final UUID uuid = UUID.randomUUID();
        final IpAddress ipAddress = new IpAddress("127.0.0.1", 1337);
        final IpAddress ipAddress2 = new IpAddress("127.0.0.2", 7331);
       
        //Doesn't exist
        this.execute(new CallableWithoutResult() {
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

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.