Class ModelFactory

  • All Implemented Interfaces:
    Factory

    public class ModelFactory
    extends Object
    implements Factory
    This is the factory class to access the implementations to the data model interfaces.

    The system contains one default model that can be accessed via getDefaultModel(). It can also manage several other models that can be created by the method newModel(String)}.

    Author:
    Rainer Maximini, Christian Zeyen
    See Also:
    Factory, Model
    • Field Detail

      • DEFAULT_MODEL_NAME

        public static String DEFAULT_MODEL_NAME
    • Method Detail

      • getDefaultModel

        public static Model getDefaultModel()
        Returns:
        The system default Model.
      • getModel

        public static Model getModel​(String name)
        Parameters:
        name - model name defined in composition.xml
        Returns:
        The model Model with the given name.
      • newModel

        public static Model newModel​(String name)
        This method creates a new model and may overwrite an existing models with the same name.
        Parameters:
        name - The name of the new model. If name equals DEFAULT_MODEL_NAME, the new Model will be the default Model. It is not possible to go back to the previous model.
        Returns:
      • reset

        public void reset()
        Description copied from interface: Factory
        This method has to be implemented by every factory in order to allow a proper restart of ProCAKE. For example, this method might reset the default factory object or other stateful variables.
        Specified by:
        reset in interface Factory
      • bind

        public boolean bind​(Object implementation)
        Description copied from interface: Factory
        Bind an implementation to the factory.
        Specified by:
        bind in interface Factory
        Parameters:
        implementation -
        Returns:
        Returns true if the bind was successful
        See Also:
        Factory.bind(java.lang.Object)
      • unbind

        public boolean unbind​(Object implementation)
        Description copied from interface: Factory
        Unbinds an implementation from the factory.
        Specified by:
        unbind in interface Factory
        Parameters:
        implementation -
        Returns:
        Returns true if the unbind was successful
        See Also:
        Factory.unbind(java.lang.Object)