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 void
addProfileSets(List<ProfileSet> profileSets)
void
close()
Cleans up the resources of thisRegistry
and calls thePreDestroy
method of each registered object.void
deRegisterObject(Object key)
Removes a registered object from thisRegistry
.ClassLoader
getClassLoader()
<T> T
lookup(Object key)
Looks up a registered object by its key.<R> R
lookup(Function<Map<Object,Object>,R> function)
Looks up a registered object by function.<T> T
lookup(TypedKey<T> key)
Looks up a registered object by its typed key.void
registerObject(Object value)
Registers an object with its key derived from the object'sResource.name()
attribute or the object's class name.void
registerObject(Object key, Object value)
Adds an object with the given key to thisRegistry
.void
registerResourceConfig(ResourceConfig resourceConfig)
Register aResourceConfig
on this context store.void
registerResourceConfigSeq(ResourceConfigSeq resourceConfigSeq)
Add aResourceConfigSeq
to this registry.ResourceConfigSeq
registerResources(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:Registry
Registers an object with its key derived from the object'sResource.name()
attribute or the object's class name.- Specified by:
registerObject
in interfaceRegistry
- Parameters:
value
- object to register
-
registerObject
public void registerObject(Object key, Object value)
Description copied from interface:Registry
Adds an object with the given key to thisRegistry
.- Specified by:
registerObject
in interfaceRegistry
- Parameters:
key
- object that maps to thevalue
to registervalue
- object to register which can be retrieved by itskey
-
deRegisterObject
public void deRegisterObject(Object key)
Description copied from interface:Registry
Removes a registered object from thisRegistry
.- Specified by:
deRegisterObject
in 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:Registry
Looks up a registered object by function.
-
lookup
public <T> T lookup(Object key)
Description copied from interface:Registry
Looks up a registered object by its key.
-
lookup
public <T> T lookup(TypedKey<T> key)
Description copied from interface:Registry
Looks 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:
registerResources
in 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 aResourceConfig
on this context store. The config gets added to the default resource list.- Specified by:
registerResourceConfig
in interfaceRegistry
- Parameters:
resourceConfig
- The Content Delivery Resource definition to be registered.
-
registerResourceConfigSeq
public void registerResourceConfigSeq(ResourceConfigSeq resourceConfigSeq)
Add aResourceConfigSeq
to this registry.- Specified by:
registerResourceConfigSeq
in interfaceRegistry
- Parameters:
resourceConfigSeq
- All the ResourceConfigList instances added on this registry.
-
close
public void close()
Description copied from interface:Registry
Cleans up the resources of thisRegistry
and calls thePreDestroy
method of each registered object.
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceRegistry
- Returns:
- the class loader of this
Registry
-
-