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 de...@apache.org on 2007/07/13 14:19:40 UTC
svn commit: r555966 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2:
description/AxisDescription.java util/Utils.java
Author: deepal
Date: Fri Jul 13 05:19:39 2007
New Revision: 555966
URL: http://svn.apache.org/viewvc?view=rev&rev=555966
Log:
fixing AXIS2-2918
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=555966&r1=555965&r2=555966
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Fri Jul 13 05:19:39 2007
@@ -433,13 +433,19 @@
if (engagedModules == null) engagedModules = new HashMap();
String moduleName = axisModule.getName();
for (Iterator iterator = engagedModules.values().iterator(); iterator.hasNext();) {
- String existing = ((AxisModule)iterator.next()).getName();
- if (!Utils.checkVersion(moduleName, existing)) {
- throw new AxisFault(Messages.getMessage("mismatchedModuleVersions",
- getClass().getName(),
- moduleName,
- existing));
+ AxisModule tempAxisModule = ((AxisModule) iterator.next());
+ String tempModuleName = tempAxisModule.getName();
+
+ if (moduleName.equals(tempModuleName)) {
+ String existing = tempAxisModule.getVersion();
+ if (!Utils.checkVersion(axisModule.getVersion(), existing)) {
+ throw new AxisFault(Messages.getMessage("mismatchedModuleVersions",
+ getClass().getName(),
+ moduleName,
+ existing));
+ }
}
+
}
// Let the Module know it's being engaged. If it's not happy about it, it can throw.
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java?view=diff&rev=555966&r1=555965&r2=555966
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/Utils.java Fri Jul 13 05:19:39 2007
@@ -305,29 +305,13 @@
* - if he trying to engage the same module then method will returen false
* - else it will return true
*
- * @param deployingModuleName the module we're currently deploying
- * @param deployedModulename an existing module
- * @return true if these are different modules, false if they're the same
- * @throws AxisFault if two different versions of the same module are deployed
*/
- public static boolean checkVersion(String deployingModuleName,
- String deployedModulename) throws AxisFault {
- String module1name = getModuleName(deployingModuleName);
- String module2name = getModuleName(deployedModulename);
- String module1version = getModuleVersion(deployingModuleName);
- String module2version = getModuleVersion(deployedModulename);
- if (module1name.equals(module2name)) {
- if (module1version != null) {
- if (!module1version.equals(module2version)) {
- throw new AxisFault("trying to engage two different module versions " +
- module1version + " : " + module2version);
- } else {
- return true;
- }
- } else if (module2version != null) {
- // TODO: Check default version?
- return false;
- }
+ public static boolean checkVersion(String module1version,
+ String module2version) throws AxisFault {
+ if ((module1version !=null && !module1version.equals(module2version)) ||
+ module2version !=null && !module2version.equals(module1version)) {
+ throw new AxisFault("trying to engage two different module versions " +
+ module1version + " : " + module2version);
}
return true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org