On Tue, Mar 9, 2010 at 7:40 PM, Deepal jayasinghe <[email protected]> wrote:
> Amila, > > MessageContext.getCurrentMessageContext() only work at Server side and > only after MessaeReceiver, so you cannot use this at the client side. > At client side any way ListnerManager.defaultConfigurationContext is null. Please see the commit message[1] you have done. According to that the only requirement is to access the server configuration context when a client running inside a server. Lets do this change since there is no apparent problem with that. if a something happens which can not fix with this change lets revert it. thanks, Amila. And also we cannot assume that user is going to invoke with a > MessageContext when he use ServiceClient APIs (I agree in the case of > OperationClient it does and that is why you do not have this issue with > generated code). > [1] http://svn.apache.org/viewvc?view=revision&revision=378210 > > -Deepal > > > > hi, > > > > The ListnerManager.defaultConfigurationContext is used as an easy way > > to access the configuration context object within any place of the > > Axis2 container. But this would cause some security issues if we try > > to run multiple Axis2 instances in a single JVM. (For an example using > > Axis2 in an Multitenancy environment would cause problems with this). > > > > > > ListnerManager.defaultConfigurationContext is used in two places. > > > > 1. > > > > getMyEPR method of the service Context class > > > > This method is only uses in isEquivalent method which does not > > have any usage. So it is safe to delete both methods. > > > > 2. > > > > At the ServiceClient class to get the server Configuration > > context object. > > > > if (ListenerManager.defaultConfigurationContext == null) { > > > > configContext = ConfigurationContextFactory. > > > > createConfigurationContextFromFileSystem(null, null); > > > > ListenerManager.defaultConfigurationContext = configContext; > > > > createConfigCtx = true; > > > > } else { > > > > configContext = ListenerManager.defaultConfigurationContext; > > > > } > > > > > > This code is to get a server configuration context if a user invokes a > > service using service client at the skelton method. But here since > > configuration context can be read from the message context it can be > > replaced with this code. > > > > if (MessageContext.getCurrentMessageContext() == null) { > > > > configContext = ConfigurationContextFactory. > > > > createConfigurationContextFromFileSystem(null, null); > > > > createConfigCtx = true; > > > > } else { > > > > configContext = > > MessageContext.getCurrentMessageContext().getConfigurationContext(); > > > > } > > > > > > Here with I have attach a patch with do the fix. > > > > > > WDYT? > > > > > > Thanks, > > > > Amila. > > > > > > > > -- > > Amila Suriarachchi > > WSO2 Inc. > > blog: http://amilachinthaka.blogspot.com/ > > ------------------------------------------------------------------------ > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > -- > Thank you! > > > http://blogs.deepal.org > http://deepal.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/
