|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
ResourceLoader |
A ResourceLoader is a pluggable contract for loading resources. |
Class Summary | |
---|---|
ResourceProvider | The ResourceProvider allows dynamic loading of managed resources. |
Annotation Types Summary | |
---|---|
Resource | An injection point qualifier that may be used to specify a resource to inject. |
An extensible, injectable resource loader that can provide provide URLs, managed input streams and sets of properties.
If the resource name is known at development time, the resource can be injected:
@Inject @Resource("WEB-INF/beans.xml") URL beansXml; @Inject @Resource("WEB-INF/web.xml") InputStream webXml; @Inject @Resource("META-INF/aws.properties") Properties awsProperties;
If the resource name is not known, the ResourceProvider
can be injected, and the resource looked up dynamically:
@Inject void readXml(ResourceProvider provider, String fileName) { InputStream webXml = provider.loadResourceStream(fileName); }
Any input stream injected, or created directly by the ResourceProvider
is managed, and will be automatically closed when the bean declaring the injection point of the resource
or provider is destroyed.
Resource
,
ResourceProvider
,
ResourceLoader
,
org.jboss.solder.resourceLoader.ResourceLoaderManager
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |