Class RPCMessageBus

java.lang.Object
com.yahoo.messagebus.NetworkMessageBus
com.yahoo.messagebus.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 Details

    • RPCMessageBus

      public RPCMessageBus(MessageBusParams mbusParams, RPCNetworkParams rpcParams)
      Constructs a new instance of this class.
      Parameters:
      mbusParams - A complete set of message bus parameters, including messagebus config.
      rpcParams - A complete set of network parameters, including rpc network config.
    • RPCMessageBus

      public RPCMessageBus(MessageBusParams mbusParams, RPCNetworkParams rpcParams, 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(List<Protocol> protocols, RPCNetworkParams rpcParams, 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, 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 Details

    • 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 RPCNetwork getRPCNetwork()
      Returns the network of this as a RPCNetwork