org.jdtaus.core.container
Class ModelFactory

java.lang.Object
  extended by org.jdtaus.core.container.ModelFactory

public abstract class ModelFactory
extends Object

Factory for the Model singleton.

Version:
$Id: ModelFactory.java 8044 2009-07-02 01:29:05Z schulte2005 $
Author:
Christian Schulte

Constructor Summary
ModelFactory()
           
 
Method Summary
static Model getModel()
          Gets the Model singleton.
static Model newModel()
          Creates a new instance of the configured Model implementation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelFactory

public ModelFactory()
Method Detail

getModel

public static Model getModel()
Gets the Model singleton.

By default this class will instantiate a new instance and hold it in a static class variable as the singleton to return for other calls. This behaviour can be changed by setting a system property with key org.jdtaus.core.container.ModelFactory to the name of a class defining a public static Model getModel() method returning the singleton instance of the model.

Returns:
the singleton Model instance.
Throws:
ModelError - for unrecoverable model errors.
See Also:
newModel()

newModel

public static Model newModel()
Creates a new instance of the configured Model implementation.

The implementation to be used can be controlled via a system property with key org.jdtaus.core.container.Model set to a class name to be loaded as the Model implementation.

This method should be used by getModel() implementors to retrieve a new Model instance.

Returns:
a new instance of the configured Model implementation.
Throws:
ModelError - for unrecoverable model errors.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.