01: package org.mule.config.builders;
02:
03: import org.mule.api.MuleContext;
04: import org.mule.api.config.ConfigurationBuilder;
05: import org.mule.api.registry.Registry;
06:
07: import java.util.Map;
08:
09: /**
10: * This simple ConfgurationBuilder implementation. This is useful for registering any
11: * Map of objects with the {@link Registry} via the {@link ConfigurationBuilder}
12: * interface. This is useful for example for the registration of "startup properties"
13: * which are provided at startup and then used to fill "property placeholders" in
14: * other configuration mechanisms such as XML.
15: */
16: public class SimpleConfigurationBuilder extends
17: AbstractConfigurationBuilder {
18:
19: protected Map objects;
20:
21: public SimpleConfigurationBuilder(Map objects) {
22: this .objects = objects;
23: }
24:
25: protected void doConfigure(MuleContext muleContext)
26: throws Exception {
27: if (objects != null && objects.size() > 0) {
28: muleContext.getRegistry().registerObjects(objects);
29: }
30: }
31:
32: }
|