Class TransitionFactory

java.lang.Object
org.btrplace.scheduler.choco.transition.TransitionFactory

public class TransitionFactory
extends Object
A customisable factory that provides the right transition model according to the given element states.
Author:
Fabien Hermenier
  • Constructor Details

  • Method Details

    • add

      public void add​(VMTransitionBuilder b)
      Add a builder for a VM. Every builder that supports the same transition will be replaced.
      Parameters:
      b - the builder to add
    • remove

      public boolean remove​(VMTransitionBuilder b)
      Remove a builder for an action on a VM.
      Parameters:
      b - the builder to remove
      Returns:
      true if it has been removed
    • remove

      public boolean remove​(NodeTransitionBuilder b)
      Remove a builder for an action on a node.
      Parameters:
      b - the builder to remove
      Returns:
      true if it has been removed
    • add

      public void add​(NodeTransitionBuilder b)
      Add a builder for a VM
      Parameters:
      b - the builder to add
    • getBuilder

      public VMTransitionBuilder getBuilder​(VMState srcState, VMState dstState)
      Get the model builder for a given transition
      Parameters:
      srcState - the current VM state
      dstState - the current VM state
      Returns:
      the list of possible transitions. null if no transition is available
    • getBuilder

      public NodeTransitionBuilder getBuilder​(NodeState srcState)
      Get the model builder for a given transition
      Parameters:
      srcState - the current node state
      Returns:
      the NodeTransition associated to the state transition. null if no transition is available
    • newBundle

      public static TransitionFactory newBundle()
      a new factory that embeds the default builders.
      Returns:
      a viable factory
    • toString

      public String toString()
      Overrides:
      toString in class Object