Class SimpleRouterImplementation

java.lang.Object
net.messagevortex.AbstractDaemon
net.messagevortex.router.SimpleRouterImplementation
All Implemented Interfaces:
BlendingReceiver, Router, RunningDaemon

public class SimpleRouterImplementation extends AbstractDaemon implements Router

A simple router implementation providing some basic strategies for building a routing block.

  • Constructor Details

    • SimpleRouterImplementation

      public SimpleRouterImplementation(String section)

      Default constructor to build class from configuration object.

      Parameters:
      section - configuration section to be used for obtaining the setup parameters
  • Method Details

    • addBlendingLayer

      public boolean addBlendingLayer(Blender blendingLayer)
      Description copied from interface: Router

      Adds a blender layer to the router infrastructure.

      Specified by:
      addBlendingLayer in interface Router
      Parameters:
      blendingLayer - the blender layer to be added
      Returns:
      true if the blender layer has been accepted (only one blender layer per transport scheme is accepted)
    • removeBlendingLayer

      public boolean removeBlendingLayer(Blender blendingLayer)
      Description copied from interface: Router

      Removes a previously added blender layer.

      Specified by:
      removeBlendingLayer in interface Router
      Parameters:
      blendingLayer - the blender layer to be removed
      Returns:
      true if the blender layer was found (and removed)
    • getAllBlendingLayer

      public List<Blender> getAllBlendingLayer()
      Description copied from interface: Router

      Get a list of all currently known blender layers.

      Specified by:
      getAllBlendingLayer in interface Router
      Returns:
      a list of a registered blender layers
    • setAccountant

      public final Accountant setAccountant(Accountant accountant)
      Description copied from interface: Router

      Sets the accounting layer for the router layer.

      Specified by:
      setAccountant in interface Router
      Parameters:
      accountant - the accounting layer to be used
      Returns:
      the previously set accounting layer
    • getAccountant

      public Accountant getAccountant()
      Description copied from interface: Router

      Get the currently set accounting layer.

      Specified by:
      getAccountant in interface Router
      Returns:
      the accounting layer or null if none
    • gotMessage

      public boolean gotMessage(VortexMessage message)
      Description copied from interface: BlendingReceiver

      This Method is called by the Blending layer if a vmessage has been extracted.

      Specified by:
      gotMessage in interface BlendingReceiver
      Parameters:
      message - the vortex message to be processed
      Returns:
      true if processing was successful