You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Michael Thibodeau (JIRA)" <ji...@apache.org> on 2008/10/13 23:30:46 UTC
[jira] Updated: (AXIS2-3623) application scope Services loaded via
ServiceObjectProviders do not have init method invoked at application scope
init time
[ https://issues.apache.org/jira/browse/AXIS2-3623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Thibodeau updated AXIS2-3623:
-------------------------------------
Attachment: svn_diff.txt
I had real trouple setting up and running maven so the code is untested
Here are the diffs
There is a question as to under what circumstances the created service object should be stored in the service context
Previously DependencyManager and org.apache.axis2.jaxws.server.endpoint.lifecycle.impl.EndpointLifecycleManagerImpl stored the created Service object in the service context.
The AbstractMessageReceiver did NOT store it.
I have changed the code so that the MessageReceiver stores created service object in the Service Context.
*** This may not be write approach and someone must verify ***
I also made no changes to org.apache.axis2.jaxws.server.endpoint.lifecycle.impl.EndpointLifecycleManagerImpl although it does similar work in creating the service object (but only looks at the SERVICE_OBJECT_SUPPLIER). With some retooling it may be able to make use of the DependencyManager.prepareServiceObject static method that I have refactored here.
> 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
> Attachments: svn_diff.txt
>
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org