eclipse-ee4j / glassfish-hk2

Dynamic dependency injection framework
https://eclipse-ee4j.github.io/glassfish-hk2
Other
85 stars 57 forks source link

Add ServiceLocator.createDynamicConfiguration() convenience method #109

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 6 years ago
glassfishrobot commented 12 years ago

@glassfishrobot Commented Reported by @mpotociar

glassfishrobot commented 12 years ago

@glassfishrobot Commented @jwells131313 said: I added this method to ServiceLocatorUtilities

glassfishrobot commented 7 years ago

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

glassfishrobot commented 10 years ago

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