Class GrizzlyNetworkManager

    • Field Detail

      • LOG

        public final java.util.logging.Logger LOG
      • nomcastLogger

        public final java.util.logging.Logger nomcastLogger
      • peerIDMap

        public final java.util.concurrent.ConcurrentHashMap<java.lang.String,​PeerID<GrizzlyPeerID>> peerIDMap
      • running

        public volatile boolean running
      • multicastTimeToLive

        public int multicastTimeToLive
      • instanceName

        public java.lang.String instanceName
      • groupName

        public java.lang.String groupName
      • host

        public java.lang.String host
      • tcpPort

        public int tcpPort
      • tcpStartPort

        public int tcpStartPort
      • tcpEndPort

        public int tcpEndPort
      • multicastPort

        public int multicastPort
      • multicastAddress

        public java.lang.String multicastAddress
      • networkInterfaceName

        public java.lang.String networkInterfaceName
      • failTcpTimeout

        public long failTcpTimeout
      • highWaterMark

        protected int highWaterMark
      • numberToReclaim

        protected int numberToReclaim
      • maxParallelSendConnections

        protected int maxParallelSendConnections
      • startTimeoutMillis

        public long startTimeoutMillis
      • sendWriteTimeoutMillis

        public long sendWriteTimeoutMillis
      • multicastPacketSize

        public int multicastPacketSize
      • writeSelectorPoolSize

        public int writeSelectorPoolSize
      • DEFAULT_IPv4_MULTICAST_ADDRESS

        public static final java.lang.String DEFAULT_IPv4_MULTICAST_ADDRESS
        See Also:
        Constant Field Values
      • DEFAULT_IPv6_MULTICAST_ADDRESS

        public static final java.lang.String DEFAULT_IPv6_MULTICAST_ADDRESS
        See Also:
        Constant Field Values
      • pingMessageLockMap

        public final java.util.concurrent.ConcurrentHashMap<PeerID,​java.util.concurrent.CountDownLatch> pingMessageLockMap
      • disableMulticast

        protected boolean disableMulticast
      • virtualUriList

        protected java.lang.String virtualUriList
    • Constructor Detail

      • GrizzlyNetworkManager

        public GrizzlyNetworkManager()
    • Method Detail

      • configure

        public void configure​(java.util.Map properties)
      • initialize

        public void initialize​(java.lang.String groupName,
                               java.lang.String instanceName,
                               java.util.Map properties)
                        throws java.io.IOException
        Description copied from interface: NetworkManager
        Initializes this network manager with given params and properties
        Specified by:
        initialize in interface NetworkManager
        Overrides:
        initialize in class AbstractNetworkManager
        Parameters:
        groupName - group name
        instanceName - instance name
        properties - specific properties
        Throws:
        java.io.IOException - if an unexpected error occurs
      • addRemotePeer

        public void addRemotePeer​(PeerID peerID)
        Description copied from interface: NetworkManager
        Add the peerID to this network manager
        Parameters:
        peerID - the peer Id
      • removeRemotePeer

        public void removeRemotePeer​(java.lang.String instanceName)
      • send

        public boolean send​(PeerID peerID,
                            Message message)
                     throws java.io.IOException
        Description copied from interface: MessageSender
        Sends the given Message to the destination
        Parameters:
        peerID - the destination PeerID. null is not allowed
        message - a message which is sent to the peer
        Returns:
        true if the message is sent to the destination successfully, otherwise false
        Throws:
        java.io.IOException - if I/O error occurs or given parameters are not valid
      • broadcast

        public boolean broadcast​(Message message)
                          throws java.io.IOException
        Description copied from interface: MulticastMessageSender
        Broadcasts or Multicasts the given Message to all members
        Parameters:
        message - a message which is sent to all members
        Returns:
        true if the message is sent to all members successfully, otherwise false
        Throws:
        java.io.IOException - if I/O error occurs or given parameters are not valid
      • getPeerID

        public PeerID getPeerID​(java.lang.String instanceName)
        Description copied from interface: NetworkManager
        Returns the proper PeerID corresponding with a given instance name
        Parameters:
        instanceName - instance name
        Returns:
        peer id
      • removePeerID

        public void removePeerID​(PeerID peerID)
        Description copied from interface: NetworkManager
        Removes the peerID from this network manager
        Parameters:
        peerID - the peer Id
      • isConnected

        public boolean isConnected​(PeerID peerID)
        Description copied from interface: NetworkManager
        Check whether the suspicious peer is alive or not This API is mainly used in HealthMonitor in order to determine the failure member
        Parameters:
        peerID - peer id
        Returns:
        true if the peer is still alive, otherwise false
      • getPingMessageLock

        public java.util.concurrent.CountDownLatch getPingMessageLock​(PeerID peerID)
      • getGrizzlyLogger

        protected abstract java.util.logging.Logger getGrizzlyLogger()
      • getVirtualPeerIDList

        protected java.util.List<PeerID> getVirtualPeerIDList​(java.lang.String groupDiscoveryUriList)
      • getPeerIDFromURI

        protected PeerID<GrizzlyPeerID> getPeerIDFromURI​(java.lang.String uri)
                                                  throws java.net.URISyntaxException
        Throws:
        java.net.URISyntaxException
      • isLeavingMessage

        protected boolean isLeavingMessage​(MessageEvent msgEvent)
      • addToVMS

        protected void addToVMS​(PeerID peerID)
      • removeFromVMS

        protected void removeFromVMS​(PeerID peerID)