Package org.smooks.engine
Class DefaultRegistry
- java.lang.Object
-
- org.smooks.engine.DefaultRegistry
-
-
Constructor Summary
Constructors Constructor Description DefaultRegistry(ClassLoader classLoader, ResourceConfigLoader resourceConfigLoader, ProfileStore profileStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddProfileSets(List<ProfileSet> profileSets)voidclose()Cleans up the resources of thisRegistryand calls thePreDestroymethod of each registered object.voiddeRegisterObject(Object key)Removes a registered object from thisRegistry.ClassLoadergetClassLoader()<T> Tlookup(Object key)Looks up a registered object by its key.<R> Rlookup(Function<Map<Object,Object>,R> function)Looks up a registered object by function.<T> Tlookup(TypedKey<T> key)Looks up a registered object by its typed key.voidregisterObject(Object value)Registers an object with its key derived from the object'sResource.name()attribute or the object's class name.voidregisterObject(Object key, Object value)Adds an object with the given key to thisRegistry.voidregisterResourceConfig(ResourceConfig resourceConfig)Register aResourceConfigon this context store.voidregisterResourceConfigSeq(ResourceConfigSeq resourceConfigSeq)Add aResourceConfigSeqto this registry.ResourceConfigSeqregisterResources(String baseURI, InputStream inputStream)Register the set of resources specified in the supplied XML configuration stream.
-
-
-
Constructor Detail
-
DefaultRegistry
public DefaultRegistry(ClassLoader classLoader, ResourceConfigLoader resourceConfigLoader, ProfileStore profileStore)
-
-
Method Detail
-
registerObject
public void registerObject(Object value)
Description copied from interface:RegistryRegisters an object with its key derived from the object'sResource.name()attribute or the object's class name.- Specified by:
registerObjectin interfaceRegistry- Parameters:
value- object to register
-
registerObject
public void registerObject(Object key, Object value)
Description copied from interface:RegistryAdds an object with the given key to thisRegistry.- Specified by:
registerObjectin interfaceRegistry- Parameters:
key- object that maps to thevalueto registervalue- object to register which can be retrieved by itskey
-
deRegisterObject
public void deRegisterObject(Object key)
Description copied from interface:RegistryRemoves a registered object from thisRegistry.- Specified by:
deRegisterObjectin interfaceRegistry- Parameters:
key- key of the registered object to remove
-
lookup
public <R> R lookup(Function<Map<Object,Object>,R> function)
Description copied from interface:RegistryLooks up a registered object by function.
-
lookup
public <T> T lookup(Object key)
Description copied from interface:RegistryLooks up a registered object by its key.
-
lookup
public <T> T lookup(TypedKey<T> key)
Description copied from interface:RegistryLooks up a registered object by its typed key.
-
registerResources
public ResourceConfigSeq registerResources(String baseURI, InputStream inputStream)
Register the set of resources specified in the supplied XML configuration stream.- Specified by:
registerResourcesin interfaceRegistry- Parameters:
baseURI- The base URI to be associated with the configuration stream.inputStream- XML resource configuration stream.- Returns:
- The ResourceConfigList created from the added resource configuration.
- See Also:
ResourceConfig
-
addProfileSets
protected void addProfileSets(List<ProfileSet> profileSets)
-
registerResourceConfig
public void registerResourceConfig(ResourceConfig resourceConfig)
Register aResourceConfigon this context store. The config gets added to the default resource list.- Specified by:
registerResourceConfigin interfaceRegistry- Parameters:
resourceConfig- The Content Delivery Resource definition to be registered.
-
registerResourceConfigSeq
public void registerResourceConfigSeq(ResourceConfigSeq resourceConfigSeq)
Add aResourceConfigSeqto this registry.- Specified by:
registerResourceConfigSeqin interfaceRegistry- Parameters:
resourceConfigSeq- All the ResourceConfigList instances added on this registry.
-
close
public void close()
Description copied from interface:RegistryCleans up the resources of thisRegistryand calls thePreDestroymethod of each registered object.
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfaceRegistry- Returns:
- the class loader of this
Registry
-
-