Class RPCMessageBus


  • public class RPCMessageBus
    extends NetworkMessageBus
    The RPCMessageBus class wraps a MessageBus with an RPCNetwork and handles reconfiguration. Please note that according to the object shutdown order, you must shut down all sessions before shutting down this object.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      RPCMessageBus​(MessageBusParams mbusParams, com.yahoo.messagebus.network.rpc.RPCNetworkParams rpcParams, java.lang.String routingCfgId)
      Constructs a new instance of this class.
      RPCMessageBus​(Protocol protocol, java.lang.String configId)
      This constructor requires a single protocol that it is to support, as well as the host application's config identifier.
      RPCMessageBus​(java.util.List<Protocol> protocols, com.yahoo.messagebus.network.rpc.RPCNetworkParams rpcParams, java.lang.String routingCfgId)
      This constructor requires an array of protocols that it is to support, as well as the host application's config identifier.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean destroy()
      Sets the destroyed flag to true.
      com.yahoo.messagebus.network.rpc.RPCNetwork getRPCNetwork()
      Returns the network of this as a RPCNetwork
      • Methods inherited from class java.lang.Object

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

      • RPCMessageBus

        public RPCMessageBus​(MessageBusParams mbusParams,
                             com.yahoo.messagebus.network.rpc.RPCNetworkParams rpcParams,
                             java.lang.String routingCfgId)
        Constructs a new instance of this class.
        Parameters:
        mbusParams - A complete set of message bus parameters.
        rpcParams - A complete set of network parameters.
        routingCfgId - The config id for message bus routing specs.
      • RPCMessageBus

        public RPCMessageBus​(java.util.List<Protocol> protocols,
                             com.yahoo.messagebus.network.rpc.RPCNetworkParams rpcParams,
                             java.lang.String routingCfgId)
        This constructor requires an array of protocols that it is to support, as well as the host application's config identifier. That identifier is necessary so that all created sessions can be uniquely identified on the network.
        Parameters:
        protocols - An array of known protocols.
        rpcParams - A complete set of network parameters.
        routingCfgId - The config id for message bus routing specs.
      • RPCMessageBus

        public RPCMessageBus​(Protocol protocol,
                             java.lang.String configId)
        This constructor requires a single protocol that it is to support, as well as the host application's config identifier.
        Parameters:
        protocol - An instance of the known protocol.
        configId - The host application's config id. This will be used to resolve the service name prefix used when registering with the slobrok. Using null here is allowed, but will not allow intermediate- or destination sessions to be routed to.
    • Method Detail

      • destroy

        public boolean destroy()
        Sets the destroyed flag to true. The very first time this method is called, it cleans up all its dependencies. Even if you retain a reference to this object, all of its content is allowed to be garbage collected.
        Overrides:
        destroy in class NetworkMessageBus
        Returns:
        true if content existed and was destroyed.
      • getRPCNetwork

        public com.yahoo.messagebus.network.rpc.RPCNetwork getRPCNetwork()
        Returns the network of this as a RPCNetwork