org.grinvin.util
Class SingletonBroker<T>
java.lang.Object
org.grinvin.util.SingletonBroker<T>
public class SingletonBroker<T>
extends java.lang.Object
An object of this type keeps track of a set of singleton objects of
type T which can be requested by id. The list of available singleton objects
is instantiated at initialization time. An XML configuration file
determines which objects should be instantiated.
SingletonBroker(String configPath) - Instantiates a broker object and loads the corresponding objects.
|
void | addToList(List list) - Add all singleton objects to the given list.
|
T | get(String id) - Return the object with the given id.
|
Iterable | getIds() - Return the list of all ids, in the form of an
Iterable .
|
SingletonBroker
public SingletonBroker(String configPath)
Instantiates a broker object and loads the corresponding objects.
configPath
- file name in the class path of the XML file with
the requested objects
addToList
public void addToList(List list)
Add all singleton objects to the given list.
get
public T get(String id)
Return the object with the given id.
getIds
public Iterable getIds()
Return the list of all ids, in the form of an Iterable
.