Collectioncomponents = ComponentManager.get().getAll(); Component comp = ComponentManager.get().get("foo"); for (Component c : components) { }
The OpenGamma logical architecture consists of a set of components. This class loads and starts the components based on configuration. The end result is a populated {@link ComponentRepository}.
Two types of config file format are recognized - properties and INI. The INI file is the primary file for loading the components, see {@link ComponentConfigIniLoader}. The behavior of an INI file can be controlled using properties.
The properties can either be specified manually before {@link #start(Resource))}is called or loaded by specifying a properties file instead of an INI file. The properties file must contain the key "MANAGER.NEXT.FILE" which is used to load the next file. The next file is normally the INI file, but could be another properties file. As such, the properties files can be chained.
Properties are never overwritten, thus manual properties have priority over file-based, and earlier file-based have priority over later file-based.
It is not intended that the manager is retained for the lifetime of the application, the repository is intended for that purpose.
ComponentManager
selects Component
s based on a role. The contract is that all the Component
s implement the differing roles and there is one Component
per role. If you need to select on of many Component
s that implement the same role, then you need to use a ComponentSelector
. Roles are usually the full interface name. A role is better understood by the analogy of a play. There are many different roles in a script. Any actor or actress can play any given part and you get the same results (phrases said, movements made, etc.). The exact nuances of the performance is different.
Below is a list of things that might be considered the different roles:
The ComponentManager
does not specify the methodology of getting the Component
, merely the interface used to get it. Therefore the ComponentManager
can be implemented with a factory pattern, an object pool, or a simple Hashtable.
Deprecated: Use {@link org.apache.avalon.framework.service.ServiceManager} instead.
@see org.apache.avalon.framework.component.Component @see org.apache.avalon.framework.component.Composable @see org.apache.avalon.framework.component.ComponentSelector @author Avalon Development Team @version CVS $Revision: 1.21 $ $Date: 2004/02/11 14:34:24 $ComponentManager
@author Scott T. Weaver @version $Id: ComponentManager.java 187034 2004-07-20 13:42:06Z weaver $
|
|
|
|
|
|
|
|
|
|
|
|
|
|