application scope Services loaded via ServiceObjectProviders do not have init
method invoked at application scope init time
---------------------------------------------------------------------------------------------------------------------------
Key: AXIS2-3623
URL: https://issues.apache.org/jira/browse/AXIS2-3623
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Components: modules
Affects Versions: 1.3
Environment: Windows
Reporter: Michael Thibodeau
DependencyManager.initService looks for ServiceClass parameter to load and
invoke init method of the ServiceClass.
This requirement defeats the purpose of the ServiceObjectSupplier parameter
especially with Spring orient Service Object providers (i.e.
SpringAppContextAwareObjectSupplier, SpringServletContextObjectSupplier).
There is no work around. Some initialization can be performed by the Spring
Application Context when the Service bean is initialized.
This is not really the same as scope-based initialization and involvement in
Service LifeCycle
Affects all areas of code where LifeCycle methods are expected to be invoked
(i.e. ConfigurationContextFactory.initApplicationScopeServices,
ConfigurationContext.deployService, etc.)
The stuff being done in AbstractMessageReceiver.makeNewServiceObject needs to
be replicated in to these additional scope based service class instantiations
while (serviceItr.hasNext()) {
AxisService axisService = (AxisService) serviceItr.next();
ServiceContext serviceContext =
serviceGroupContext.getServiceContext(axisService);
AxisService service = serviceContext.getAxisService();
ClassLoader classLoader = service.getClassLoader();
Parameter implInfoParam =
service.getParameter(Constants.SERVICE_CLASS); //**** Must have ServiceClass
if (implInfoParam != null) {
try {
Class implClass = Loader.loadClass(
classLoader,
((String) implInfoParam.getValue()).trim());
Object serviceImpl = implClass.newInstance();
serviceContext.setProperty(ServiceContext.SERVICE_OBJECT,
serviceImpl);
initServiceObject(serviceImpl, serviceContext);
} catch (Exception e) {
AxisFault.makeFault(e);
}
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]