Interface MessageFacility


  • public interface MessageFacility

    Rhino extension facility which allows a resource adaptor entity to pass messages between cluster nodes.

    The MessageFacility is made available to a resource adaptor entity via its configuration properties, under the CONFIG_PROPERTY_NAME key. Example of how access the message facility from a resource adaptor: ``

    import com.opencloud.rhino.facilities.message.MessageFacility;
    import javax.slee.resource.ConfigProperties;
    
    public class MyResourceAdapter implements ResourceAdaptor {
    
        public void raConfigure(ConfigProperties configProperties) {
          ...
          MessageFacility messageFacility = null;
          ConfigProperties.Property property = configProperties.getProperty(MessageFacility.CONFIG_PROPERTY_NAME);
          if (property != null) {
              messageFacility = (MessageFacility) property.getValue();
          }
          ...
        }
        ...
    }
    • Method Detail

      • getLocalNodeID

        int getLocalNodeID()

        Returns the node ID of the current Rhino node.

      • addMessageListener

        void addMessageListener​(MessageListener listener)

        Adds the given message listener. If the listener was already added, this method has no effect.

        Typically this method would be called in raConfigure(ConfigProperties) or raActive()

        Parameters:
        listener - The message listener to add
      • removeMessageListener

        void removeMessageListener​(MessageListener listener)

        Removes the given message listener. If the listener was not currently registered, this method has no effect.

        This method would typically be called in raUnconfigure(), raStopping(), or raInactive()

        Parameters:
        listener - The message listener to remove
      • setRequestListener

        void setRequestListener​(RequestListener listener)

        Sets the listener to respond to incoming requests.

        Typically this method would be called in raConfigure(ConfigProperties)

        Parameters:
        listener - the listener.
        Since:
        Rhino 2.3.0