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 "Davanum Srinivas (JIRA)" <ji...@apache.org> on 2008/03/20 03:42:24 UTC

[jira] Commented: (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:comment-tabpanel&focusedCommentId=12580642#action_12580642 ] 

Davanum Srinivas commented on AXIS2-3623:
-----------------------------------------

Michael,

Could you please help us with a patch?

thanks,
dims

> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org