org.jdtaus.core.container
Class ContainerFactory

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

public abstract class ContainerFactory
extends Object

Factory for the Container singleton.

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

Constructor Summary
ContainerFactory()
           
 
Method Summary
static Container getContainer()
          Gets the Container singleton.
static Container newContainer()
          Creates a new instance of the Container singleton implementation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerFactory

public ContainerFactory()
Method Detail

getContainer

public static Container getContainer()
Gets the Container singleton.

By default this class will instantiate a new container 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.ContainerFactory to the name of a class defining a public static Container getContainer() method returning the singleton instance of Container.

Returns:
the singleton Container instance.
Throws:
ContainerError - for unrecoverable container errors.
See Also:
newContainer()

newContainer

public static Container newContainer()
Creates a new instance of the Container singleton implementation.

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

This method should be used by getContainer() implementors to retrieve a new Container instance.

Returns:
a new instance of the configured Container implementation.
Throws:
ContainerError - for unrecoverable container errors.


Copyright © 2005-2009 jDTAUS. All Rights Reserved.