axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal jayasinghe <deep...@gmail.com>
Subject Re: Removing ListnerManager.defaultConfigurationContext
Date Tue, 09 Mar 2010 13:45:48 GMT
Amila,

At the client side when you create the ServiceClient inside a service
(let's say inside Tomcat) we use this approach to get the server's
configuration context. There are some other instances also, however I
cannot remember all of them now. I strongly suggest you to find an
alternative approach to solve this problem in Multitenancy environment,
as I mentioned before though I cannot remember why I introduced this
static variable there were number of reasons.

One way to solve is to have a axis2.xml option.

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


-- 
Thank you!


http://blogs.deepal.org
http://deepal.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message