Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.1.0.5
-
None
-
None
Description
The Javadoc for ObjectLocator.autobuild() states that it "Autobuilds a class by finding the public constructor with the most parameters. Services and resources will be injected into the parameters of the constructor." However, this seems to only be true for the ServiceResourcesImpl implementation of the interface, which is aware of the following resources (code from 5.1.0.5, AbstractServiceCreator, line 63):
injectionResources.put(String.class, serviceId);
injectionResources.put(ObjectLocator.class, resources);
injectionResources.put(ServiceResources.class, resources);
injectionResources.put(Logger.class, logger);
injectionResources.put(Class.class, resources.getServiceInterface());
injectionResources.put(OperationTracker.class, resources.getTracker());
On the other hand, RegistryImpl is only aware of the OperationTracker resource (RegistryImpl line 841)
resourcesMap.put(OperationTracker.class, tracker);
Specifically, one cannot call registry.autobuild() on any class that has a Logger resource in its constructor. If this is the intended behavior than the ObjectLocator javadoc should be updated.