axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amila Suriarachchi <amilasuriarach...@gmail.com>
Subject Removing ListnerManager.defaultConfigurationContext
Date Tue, 09 Mar 2010 12:57:13 GMT
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/

Mime
View raw message