All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jgroups.protocols.relay.CanBeSiteMaster Maven / Gradle / Ivy

Go to download

This artifact provides a single jar that contains all classes required to use remote EJB and JMS, including all dependencies. It is intended for use by those not using maven, maven users should just import the EJB and JMS BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up with different versions on classes on the class path).

There is a newer version: 33.0.2.Final
Show newest version
package org.jgroups.protocols.relay;

import org.jgroups.util.ExtendedUUID;
import org.jgroups.util.UUID;

/**
 * Subclass of {@link org.jgroups.util.ExtendedUUID} using flag {@link ExtendedUUID#can_become_site_master}. The flag i
 * ndicates whether the current address can become a site master, or not.
 * @author Bela Ban
 * @deprecated Use {@link ExtendedUUID} directly. This class will get dropped in 4.0.
 */
@Deprecated
public class CanBeSiteMaster extends ExtendedUUID {
    private static final long serialVersionUID=711248753245248165L;

    public CanBeSiteMaster() {
    }

    protected CanBeSiteMaster(byte[] data, boolean can_become_site_master) {
        super(data);
        if(can_become_site_master)
            setFlag(ExtendedUUID.can_become_site_master);
    }

    protected CanBeSiteMaster(UUID uuid, boolean can_become_site_master) {
        super(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits());
        if(can_become_site_master)
            setFlag(ExtendedUUID.can_become_site_master);
    }

    public static CanBeSiteMaster randomUUID(boolean can_become_site_master) {
        return new CanBeSiteMaster(generateRandomBytes(), can_become_site_master);
    }

    public static CanBeSiteMaster randomUUID(String logical_name, boolean can_become_site_master) {
        CanBeSiteMaster retval=new CanBeSiteMaster(generateRandomBytes(), can_become_site_master);
        UUID.add(retval, logical_name);
        return retval;
    }

    public boolean canBecomeSiteMaster() {
        return isFlagSet(ExtendedUUID.can_become_site_master);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy