net.sourceforge.groboutils.util.classes.v1
Class SPISingletonStore

java.lang.Object
  extended bynet.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
      extended bynet.sourceforge.groboutils.util.classes.v1.SPISingletonStore

public class SPISingletonStore
extends AbstractMultipleStore

Aids pluggable factories and related classes by being a central repository for storing SPI singletons, and creating means to load and change the singletons.

This uses the same pattern as the SingletonStore class, but this one allows for multiple singleton instances, and loads them from the SPILoader class.

Since:
June 28, 2002
Version:
$Date: 2003/02/10 22:52:36 $
Author:
Matt Albrecht groboclown@users.sourceforge.net
See Also:
SingletonStore

Nested Class Summary
 
Nested classes inherited from class net.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
AbstractMultipleStore.AllowMultiplesAction
 
Field Summary
 
Fields inherited from class net.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
MULTIPLES_OK, NO_MULTIPLES_ERROR, NO_MULTIPLES_SILENT
 
Constructor Summary
SPISingletonStore(java.lang.Class instanceOf, AbstractMultipleStore.AllowMultiplesAction ama)
          Constructor specifying all the parameters for using a singleton in this framework.
 
Method Summary
protected  void addDefaultSingletons()
          Adds the default inner singletons, which is an implementation specific method.
 void addSPI(java.lang.ClassLoader cl)
          Add a set of SPIs from the given class loader.
 
Methods inherited from class net.sourceforge.groboutils.util.classes.v1.AbstractMultipleStore
addSingleton, getSingletons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SPISingletonStore

public SPISingletonStore(java.lang.Class instanceOf,
                         AbstractMultipleStore.AllowMultiplesAction ama)
Constructor specifying all the parameters for using a singleton in this framework.

Parameters:
instanceOf - singletons must be of this class. This is also used to load the SPI classes.
ama - true if this store should allow multiple instances of the exact same class, or false if it should prevent multiple instances sharing the exact same class. This helps to enforce the idea of 'singleton'.
Method Detail

addDefaultSingletons

protected void addDefaultSingletons()
Adds the default inner singletons, which is an implementation specific method.

Specified by:
addDefaultSingletons in class AbstractMultipleStore

addSPI

public void addSPI(java.lang.ClassLoader cl)
            throws java.io.IOException
Add a set of SPIs from the given class loader.

Throws:
java.io.IOException


Copyright © 2001-2003 by The GroboUtils Project