Class TransporterProvider

    • Field Detail

      • myInitialRequestSelectionRule

        protected QObjectSelectionRuleIfc<QObject> myInitialRequestSelectionRule
        Can be used to supply a rule for how the requests are selected for allocation
      • myRequestSelectionRule

        protected QObjectSelectionRuleIfc<QObject> myRequestSelectionRule
        Can be used to supply a rule for how the requests are selected for allocation
    • Constructor Detail

      • TransporterProvider

        public TransporterProvider​(ModelElement parent)
        Creates a TransporterProvider that uses a FIFO queue discipline. An empty TransporterSet is created and must be filled
        Parameters:
        parent -
      • TransporterProvider

        public TransporterProvider​(ModelElement parent,
                                   java.lang.String name)
        Creates a TransporterProvider that uses a FIFO queue discipline. An empty TransporterSet is created and must be filled
        Parameters:
        parent -
        name -
      • TransporterProvider

        public TransporterProvider​(ModelElement parent,
                                   java.lang.String name,
                                   TransporterSet set)
        Creates a TransporterProvider that uses the supplied set and FIFO queue discipline
        Parameters:
        parent -
        name -
        set -
      • TransporterProvider

        public TransporterProvider​(ModelElement parent,
                                   TransporterSet set)
        Creates a TransporterProvider that uses the supplied set and FIFO queue discipline
        Parameters:
        parent -
        set -
      • TransporterProvider

        public TransporterProvider​(ModelElement parent,
                                   TransporterSet set,
                                   Queue.Discipline discipline)
        Creates a TransporterProvider that uses the supplied set and queue discipline
        Parameters:
        parent -
        set -
        discipline -
      • TransporterProvider

        public TransporterProvider​(ModelElement parent,
                                   java.lang.String name,
                                   TransporterSet set,
                                   Queue.Discipline discipline)
        Creates a TransporterProvider that uses the supplied set and queue discipline
        Parameters:
        parent -
        name -
        set -
        discipline -
    • Method Detail

      • changeDispatchQueueDiscipline

        public final void changeDispatchQueueDiscipline​(Queue.Discipline discipline)
        This will change the queue discipline of the underlying Queue
        Parameters:
        discipline -
      • getDispatchQueueInitialDiscipline

        public final Queue.Discipline getDispatchQueueInitialDiscipline()
        Returns the initial discipline for the queue
        Returns:
      • setDispatchQueueInitialDiscipline

        public final void setDispatchQueueInitialDiscipline​(Queue.Discipline discipline)
        Sets the initial queue discipline
        Parameters:
        discipline -
      • getNumberInDispatchQueue

        public final int getNumberInDispatchQueue()
        Returns the current number of requests in the dispatch queue
        Returns:
      • cancelRequest

        public final void cancelRequest​(QObject request)
        If the request is in the dispatch queue, this removes it. It does this without collecting statistics on the time in queue for the request.
        Parameters:
        request - Should not be null
      • requestIdleTransporter

        public final QObject requestIdleTransporter​(TransporterRequesterIfc requester)
        This method provides a transporter to the requester. A request is created with the default priority. The request is placed in the request queue for this TransporterProvider. If the request is given an idle transporter, the request is removed from the dispatch queue and the requester is notified through the use of its idleTransporterProvided() method. If there are no idle transporters the request waits in the dispatch queue. When an idle transporter becomes available for the request, the requester is automatically notified through it idleTransporterProvided() method. The request can be by the client to see if it has been queued.
        Parameters:
        requester - The requester for a transporter
        Returns:
        A reference to the request.
      • requestIdleTransporter

        public QObject requestIdleTransporter​(TransporterRequesterIfc requester,
                                              int priority)
        This method provides a transporter to the requester. A request is created with the given priority. The request is placed in the request queue for this TransporterProvider. If the request is given an idle transporter, the request is removed from the dispatch queue and the requester is notified through the use of its idleTransporterProvided() method. If there are no idle transporters the request waits in the dispatch queue. When an idle transporter becomes available for the request, the requester is automatically notified through it idleTransporterProvided() method. The request can be checked by the client to see if it has been queued.
        Parameters:
        requester - The requester for a transporter
        priority - , The priority for the request
        Returns:
        A reference to the request.
      • getRequestSelectionRule

        public final QObjectSelectionRuleIfc getRequestSelectionRule()
        Returns a reference to the request selection rule. May be null.
        Returns:
      • setRequestSelectionRule

        public final void setRequestSelectionRule​(QObjectSelectionRuleIfc<QObject> rule)
        A request selection rule can be supplied to provide alternative behavior within the selectNextRequest() method. A request selection rule, provides a mechanism to select the next request from the queue of waiting requests
        Parameters:
        rule -
      • getInitialRequestSelectionRule

        public final QObjectSelectionRuleIfc<QObject> getInitialRequestSelectionRule()
        The rule to use when this provider is initialized
        Returns:
      • setInitialRequestSelectionRule

        public final void setInitialRequestSelectionRule​(QObjectSelectionRuleIfc<QObject> rule)
        The rule to use when this provider is initialized
        Parameters:
        rule -
      • selectNextRequest

        protected QObject selectNextRequest()
        Selects a candidate request from the queue for allocation to one of the transporter units. The selection process does not remove the request from the queue.
        Returns:
        The request that was selected to for a transporter
      • initialize

        protected void initialize()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called
        Overrides:
        initialize in class ModelElement
      • setTransporterSet

        protected final void setTransporterSet​(TransporterSet set)
      • transporterFreed

        protected void transporterFreed()