Class ServiceAnnouncement


  • public class ServiceAnnouncement
    extends java.lang.Object

    Purpose: A structured message object to announce a new RCM service instance becoming available

    Description: This object is sent over the multicast by a service wanting to join the EclipseLink cluster. It is received by all other services subscribing to the same channel. Receipt of this announcement triggers an exchange protocol between the sending and receiving services to establish communications with all of the other services on the channel.

    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceAnnouncement​(byte[] bytes)
      INTERNAL: Constructor to initialize a new instance when receiving a message
      ServiceAnnouncement​(ServiceId newServiceId)
      INTERNAL: Constructor to initialize a new instance when creating a message
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ServiceId getServiceId()
      INTERNAL: Return the id of the service sending this announcement
      void readFromBytes​(byte[] bytes)
      INTERNAL: Initialize the instance fields from the serialized bytes.
      byte[] toBytes()
      INTERNAL: Convert the instance attributes to serialized bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ServiceAnnouncement

        public ServiceAnnouncement​(byte[] bytes)
        INTERNAL: Constructor to initialize a new instance when receiving a message
      • ServiceAnnouncement

        public ServiceAnnouncement​(ServiceId newServiceId)
        INTERNAL: Constructor to initialize a new instance when creating a message
    • Method Detail

      • readFromBytes

        public void readFromBytes​(byte[] bytes)
        INTERNAL: Initialize the instance fields from the serialized bytes. Assumptions: - Same character converters exist on the reading and storing sides - Strings are not greater than 255 bytes (bytes, not characters) Byte storage: - 1 byte to store length of String that is to follow - String of 'length' bytes follows
      • toBytes

        public byte[] toBytes()
        INTERNAL: Convert the instance attributes to serialized bytes. Assumptions: - Same character converters exist on the reading and storing sides - channel, id and converted to bytes < 256 bytes each Byte storage: - 1 byte to store length of String that is to follow - String of 'length' bytes follows
      • getServiceId

        public ServiceId getServiceId()
        INTERNAL: Return the id of the service sending this announcement