| java.lang.Object net.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
All known Subclasses: net.sourceforge.groboutils.util.classes.v1.SPISingletonStore,
AbstractMultipleStore | abstract public class AbstractMultipleStore (Code) | | Similar in concept to the AbstractSingleStore, except this houses
multiple instances of 'singletons'.
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/02/10 22:52:36 $ since: June 28, 2002 |
Inner Class :abstract public static class AllowMultiplesAction | |
Constructor Summary | |
public | AbstractMultipleStore(Class instanceOf, AllowMultiplesAction ama) Constructor specifying all the parameters for using a singleton in this
framework.
Parameters: instanceOf - singletons must be of this class. Parameters: ama - true if this store should allowmultiple instances of the exact same class, or falseif it should prevent multiple instances sharing the exactsame class. |
MULTIPLES_OK | final public static AllowMultiplesAction MULTIPLES_OK(Code) | | |
NO_MULTIPLES_ERROR | final public static AllowMultiplesAction NO_MULTIPLES_ERROR(Code) | | |
NO_MULTIPLES_SILENT | final public static AllowMultiplesAction NO_MULTIPLES_SILENT(Code) | | |
AbstractMultipleStore | public AbstractMultipleStore(Class instanceOf, AllowMultiplesAction ama)(Code) | | Constructor specifying all the parameters for using a singleton in this
framework.
Parameters: instanceOf - singletons must be of this class. Parameters: ama - true if this store should allowmultiple instances of the exact same class, or falseif it should prevent multiple instances sharing the exactsame class. This helps to enforce the idea of 'singleton'. |
addDefaultSingletons | abstract protected void addDefaultSingletons()(Code) | | Adds the default inner singletons, which is an implementation
specific method.
|
addSingleton | public synchronized void addSingleton(Object singleton)(Code) | | Sets the singleton. It must be of the correct class, and non-null.
Parameters: singleton - the singleton to set. exception: IllegalArgumentException - if singleton isnull, or is not of the correct type. |
getSingletons | public Enumeration getSingletons()(Code) | | Returns the current inner singletons. If it has never been set, then
the default will be used instead.
the inner singleton instances. exception: IllegalStateException - if no singleton was created. |
|
|