[ 
https://issues.apache.org/jira/browse/DELTASPIKE-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13857552#comment-13857552
 ] 

Mark Struberg commented on DELTASPIKE-399:
------------------------------------------

I also think we can ditch the whole StorageType annotation. I see no real use. 
This can be easily merged with the ExternalResourceProvider.

Also this is currently not user friendly from a customer perspective. E.g. you 
would need to have core-impl as _compile_ time scoped because you need the 
FileSystemStorage class on the compile classpath. 
The goal is to have all *impl modules just as _runtime_ dependencies.

I still miss the clear benefit over the ConfigSource mechanism.
The main usecase is to Inject Properties, right?
Injecting an URL or an InputStream does not make much sense, or do you have a 
specific use case for it?
This is 3 lines of trivial code each and I would never do this via injection if 
there is no additional benefit. Or does it provide any XML parsing feature 
beyond just providing the input stream?

The only remaining benefit I can see so far is that it allows to inject 
Properties from a file URL out of the box.
Why not just provide this via a simple feature as auto-registered ConfigSource 
similar to PropertyFileConfig.
Or just extend PropertyFileConfig to detect external resources. Simply parsing 
for "://" and handling it as URL in that case should be enough. 

I think it's good to have this discussion and you brought up the topic. We 
should really improve this part of DeltaSpike.

I also think we might expand the ConfigSource idea by having a 'category' which 
allows own sets of ConfigSources for a specific category.

> Incorporate Solder's ResourceLoader features into DeltaSpike
> ------------------------------------------------------------
>
>                 Key: DELTASPIKE-399
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-399
>             Project: DeltaSpike
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.4
>            Reporter: Aaron Siri
>            Assignee: John D. Ament
>            Priority: Minor
>             Fix For: 0.6
>
>
> Seam 3's Solder module had some nice resource loading functionality within 
> the org.jboss.solder.resourceLoader packages.  With it you could do the 
> following:
> // Load a properties file
> @Inject @Resource("app.properties")
> private Properties appProperties;
> or:
> @Inject
> private ResourceProvider resourceProvider
> public Properties getHostProperties() {
>    String hostname = java.net.InetAddress.getLocalHost().getHostName();
>    return resourceProvider.loadPropertiesBundle(hostname + ".properties");
> }



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to