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 Summary
Constructors Constructor Description TransitionFactory()
Make a new factory. -
Method Summary
Modifier and Type Method Description void
add(NodeTransitionBuilder b)
Add a builder for a VMvoid
add(VMTransitionBuilder b)
Add a builder for a VM.NodeTransitionBuilder
getBuilder(NodeState srcState)
Get the model builder for a given transitionVMTransitionBuilder
getBuilder(VMState srcState, VMState dstState)
Get the model builder for a given transitionstatic TransitionFactory
newBundle()
a new factory that embeds the default builders.boolean
remove(NodeTransitionBuilder b)
Remove a builder for an action on a node.boolean
remove(VMTransitionBuilder b)
Remove a builder for an action on a VM.String
toString()
-
Constructor Details
-
TransitionFactory
public TransitionFactory()Make a new factory.
-
-
Method Details
-
add
Add a builder for a VM. Every builder that supports the same transition will be replaced.- Parameters:
b
- the builder to add
-
remove
Remove a builder for an action on a VM.- Parameters:
b
- the builder to remove- Returns:
true
if it has been removed
-
remove
Remove a builder for an action on a node.- Parameters:
b
- the builder to remove- Returns:
true
if it has been removed
-
add
Add a builder for a VM- Parameters:
b
- the builder to add
-
getBuilder
Get the model builder for a given transition- Parameters:
srcState
- the current VM statedstState
- the current VM state- Returns:
- the list of possible transitions.
null
if no transition is available
-
getBuilder
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
a new factory that embeds the default builders.- Returns:
- a viable factory
-
toString
-