bcds.phison.sim
Class PmRegistry<V,E>

java.lang.Object
  extended by bcds.tools.DynLoader
      extended by bcds.phison.sim.PmRegistry<V,E>

public class PmRegistry<V,E>
extends DynLoader

A registry for ProcessingModule objects.

Author:
Juan Segovia S.

Constructor Summary
PmRegistry()
          Creates an empty registry.
 
Method Summary
 java.util.List<ProcessingModule<V,E>> getModules()
          Returns the list of modules currently registered.
 ProcessingModule<V,E> loadModule(java.lang.String className)
          Dynamically load a class, make sure it implements ProcessingModule.
 void setupModules(SimCore<V,E> sim)
          Invoke each module's setup() method.
 
Methods inherited from class bcds.tools.DynLoader
createInstance, getConstructor, getInstance, getInstances, getNamePrefixes, load, load, register, setNamePrefixes, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmRegistry

public PmRegistry()
Creates an empty registry.

Method Detail

loadModule

public ProcessingModule<V,E> loadModule(java.lang.String className)
Dynamically load a class, make sure it implements ProcessingModule.


getModules

public java.util.List<ProcessingModule<V,E>> getModules()
Returns the list of modules currently registered. Each invocation creates a new list that is independent of any internal data structure.


setupModules

public void setupModules(SimCore<V,E> sim)
Invoke each module's setup() method. This should be called after all the modules have been loades (registered) so that they can resolve any inter-dependency among them.