javaee / hk2

A light-weight and dynamic dependency injection framework
https://javaee.github.io/hk2
Other
112 stars 83 forks source link

Add ServiceLocator.createDynamicConfiguration() convenience method #108

Closed glassfishrobot closed 10 years ago

glassfishrobot commented 12 years ago

We have a lot of places where we just repeat the same code:

final DynamicConfigurationService dcs = serviceLocator.getService(DynamicConfigurationService.class);
final DynamicConfiguration dc = dcs.createDynamicConfiguration();

Seems the only use case for working with DCS is really just to create a new configuration. So I'd say the DCS could be hidden as an internal HK2 impl detail and the DC could be directly exposed via ServiceLocator interface:

final DynamicConfiguration dc = serviceLocator.createDynamicConfiguration();

Affected Versions

[2.1.*]

glassfishrobot commented 12 years ago

Reported by @mpotociar

glassfishrobot commented 12 years ago

@jwells131313 said: I added this method to ServiceLocatorUtilities

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA HK2-64

glassfishrobot commented 10 years ago

Marked as fixed on Friday, December 6th 2013, 4:24:09 am