[
https://issues.apache.org/jira/browse/DELTASPIKE-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13856877#comment-13856877
]
Christian Kaltepoth commented on DELTASPIKE-399:
------------------------------------------------
@ [~gpetracek]:
I'm fine with using a marker interface instead of a string to make it more
type-safe. So you are talking about something like this, right?
{code}
@ExternalResource(storage=Classpath.class, name="myapp.properties")
{code}
With {{Classpath}} being a simple marker interface:
{code}
public interface Classpath {}
{code}
That's fine. But you were talking about enums before which I don't think is a
good idea because users cannot extend them.
Perhaps it would make even more sense to use an annotation instead of an
attribute for the storage. Something like:
{code}
@Classpath
@ExternalResource("myapp.properties")
{code}
Regarding #1 + #2: I think we need something like the {{storage}} attribute
now, because the current implementation simply tries all
{{ExternalResourceProvider}} and returns the first resource found, which is
(like discussed before) not what we want.
BTW: I don't get what you mean with "replacing a producer". Basically the
storage attribute is used to select a {{ExternalResourceProvider}} that should
be used to load the resource. So there is no need to replace anything. Users
could provider alternative providers that retrieve resources from other places.
And I think allowing users to add other provider implementations is a very
important feature.
> 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)