Class Router


public class Router extends OutputSection
This class implements a router, which routes the jobs according to the specified routing strategies (one for each job class).

The class has different constructors to create a generic router or a blocking region border queue, that is the router of a node which is inside a blocking region and which sends jobs also to nodes outside the region. When a job leaves the blocking region, the region input station must receive a message, in order to serve the blocked jobs.
However it is also possible to create a generic router and then to turn on/off the "border router" behaviour using the borderRouterTurnON(..) and borderRouterTurnOFF() methods.
Author:
Francesco Radaelli, Stefano Omini, Bertoli Marco - Fixed lockup issues with closed class and sinks 13/11/2005, Bertoli Marco - Fixed bug with multiserver stations Modified by Ashanka (Oct 2009) for FCR Bug fix: Events are created with job instead of null for EVENT_JOB_OUT_OF_REGION
  • Constructor Details

    • Router

      public Router(RoutingStrategy[] routingStrategies)
      Creates a new instance of Router.
      Parameters:
      routingStrategies - Routing strategies, one for each class.
  • Method Details

    • isBorderRouterON

      public boolean isBorderRouterON()
      Tells whether the "border router" behaviour has been turned on.
      Returns:
      true, if the "border router" behaviour is on; false otherwise.
    • borderRouterTurnON

      public void borderRouterTurnON(BlockingRegion region)
      Turns on the "border router" behaviour.
      Parameters:
      region - the blocking region to which the owner node of this router belongs.
    • borderRouterTurnOFF

      public void borderRouterTurnOFF()
      Turns off the "borderRouter" behaviour.
    • nodeLinked

      protected void nodeLinked(NetNode node) throws NetException
      Description copied from class: NodeSection
      This method should be overridden to implement a specific behaviour of the node section when the node section itself is linked to the owner node. This method should be used to set node section properties depending on the owner node ones.
      Overrides:
      nodeLinked in class NodeSection
      Parameters:
      node - Owner node.
      Throws:
      NetException
    • process

      protected int process(NetMessage message) throws NetException
      Description copied from class: NodeSection
      This method should be overridden to implement a specific NetMessage processor.
      Specified by:
      process in class NodeSection
      Parameters:
      message - message to be processed.
      Returns:
      message processing result.
      Throws:
      NetException