tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r659420 - in /incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main: java/org/apache/tuscany/sca/binding/ws/axis2/ resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/
Date Fri, 23 May 2008 04:37:46 GMT
Author: rfeng
Date: Thu May 22 21:37:44 2008
New Revision: 659420

URL: http://svn.apache.org/viewvc?rev=659420&view=rev
Log:
Make the rampart module engagement conditional based on the intents

Added:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
  (with props)
Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
    incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java?rev=659420&r1=659419&r2=659420&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceClient.java
Thu May 22 21:37:44 2008
@@ -18,6 +18,9 @@
  */
 package org.apache.tuscany.sca.binding.ws.axis2;
 
+import static org.apache.tuscany.sca.binding.ws.axis2.AxisPolicyHelper.SOAP12_INTENT;
+import static org.apache.tuscany.sca.binding.ws.axis2.AxisPolicyHelper.isIntentRequired;
+
 import java.io.IOException;
 import java.net.URL;
 import java.security.AccessController;
@@ -76,8 +79,6 @@
 import org.apache.tuscany.sca.interfacedef.wsdl.xml.XMLDocumentHelper;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentAttachPoint;
 import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
 import org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy;
@@ -86,14 +87,13 @@
 import org.apache.tuscany.sca.policy.util.PolicyHandlerUtils;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 import org.apache.ws.commons.schema.resolver.URIResolver;
+import org.osoa.sca.ServiceRuntimeException;
 
 public class Axis2ServiceClient {
 
     private WebServiceBinding wsBinding;
     private ServiceClient serviceClient;
     Map<ClassLoader, List<PolicyHandlerTuple>> policyHandlerClassnames = null;
-    private static final QName SOAP12_INTENT = new QName("http://www.osoa.org/xmlns/sca/1.0",
"soap.1_2");
-    private static final QName MTOM_INTENT =  new QName("http://www.osoa.org/xmlns/sca/1.0",
"MTOM");
     private List<PolicyHandler> policyHandlerList = new ArrayList<PolicyHandler>();
 
     public Axis2ServiceClient(RuntimeComponent component,
@@ -138,9 +138,25 @@
      */
     protected ServiceClient createServiceClient() {
         try {
-            TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
-            ConfigurationContext configContext = tuscanyAxisConfigurator.getConfigurationContext();
+            final boolean isRampartRequired = AxisPolicyHelper.isRampartRequired(wsBinding);
+            ConfigurationContext configContext;
             
+            try {
+                // TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
+                // Allow privileged access to read properties. Requires PropertyPermission
read in
+                // security policy.
+                TuscanyAxisConfigurator tuscanyAxisConfigurator =
+                    AccessController.doPrivileged(new PrivilegedExceptionAction<TuscanyAxisConfigurator>()
{
+                        public TuscanyAxisConfigurator run() throws AxisFault {
+                            return new TuscanyAxisConfigurator(isRampartRequired);
+                        }
+                    });
+                configContext = tuscanyAxisConfigurator.getConfigurationContext();
+                // deployRampartModule();
+                // configureSecurity();
+            } catch (PrivilegedActionException e) {
+                throw new ServiceRuntimeException(e.getException());
+            }
 
             createPolicyHandlers();
             setupPolicyHandlers(policyHandlerList, configContext);
@@ -390,26 +406,11 @@
     }
 
     private boolean requiresSOAP12() {
-        if (wsBinding instanceof IntentAttachPoint) {
-            List<Intent> intents = ((IntentAttachPoint)wsBinding).getRequiredIntents();
-            for (Intent intent : intents) {
-                if (SOAP12_INTENT.equals(intent.getName())) {
-                    return true;
-                }
-            }
-        }
-        return false;
+        return isIntentRequired(wsBinding, SOAP12_INTENT);
     }
+
     private boolean requiresMTOM() {
-        if (wsBinding instanceof IntentAttachPoint) {
-            List<Intent> intents = ((IntentAttachPoint)wsBinding).getRequiredIntents();
-            for (Intent intent : intents) {
-                if (MTOM_INTENT.equals(intent.getName())) {
-                    return true;
-                }
-            }
-        }
-        return false;
+        return isIntentRequired(wsBinding, AxisPolicyHelper.MTOM_INTENT);
     }
 
     protected EndpointReference getWSATOEPR(WebServiceBinding binding) {

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java?rev=659420&r1=659419&r2=659420&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/Axis2ServiceProvider.java
Thu May 22 21:37:44 2008
@@ -19,15 +19,11 @@
 
 package org.apache.tuscany.sca.binding.ws.axis2;
 
-import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
@@ -61,12 +57,8 @@
 import org.apache.axis2.addressing.EndpointReferenceHelper;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.deployment.DeploymentErrorMsgs;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.ModuleBuilder;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisEndpoint;
-import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.Parameter;
@@ -75,10 +67,8 @@
 import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
 import org.apache.axis2.description.WSDL2Constants;
 import org.apache.axis2.description.WSDLToAxisServiceBuilder;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.ListenerManager;
 import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.jms.JMSConstants;
 import org.apache.axis2.transport.jms.JMSListener;
 import org.apache.axis2.transport.jms.JMSSender;
@@ -95,7 +85,6 @@
 import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.invocation.MessageFactory;
-import org.apache.tuscany.sca.policy.Intent;
 import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
 import org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy;
@@ -110,6 +99,7 @@
 import org.apache.ws.security.WSSecurityEngineResult;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.apache.ws.security.handler.WSHandlerResult;
+import org.osoa.sca.ServiceRuntimeException;
 
 public class Axis2ServiceProvider {
     
@@ -135,7 +125,6 @@
     private static final String DEFAULT_QUEUE_CONNECTION_FACTORY = "TuscanyQueueConnectionFactory";
     
     private static final QName TRANSPORT_JMS_QUALIFIED_INTENT = new QName("http://www.osoa.org/xmlns/sca/1.0","transport.jms");
-    
     private PolicySet transportJmsPolicySet = null;
         
 
@@ -152,6 +141,7 @@
         this.messageFactory = messageFactory;
         this.policyHandlerClassnames = policyHandlerClassnames;
 
+        final boolean isRampartRequired = AxisPolicyHelper.isRampartRequired(wsBinding);
         try {
             // TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator();
             // Allow privileged access to read properties. Requires PropertyPermission read
in
@@ -159,24 +149,22 @@
             TuscanyAxisConfigurator tuscanyAxisConfigurator =
                 AccessController.doPrivileged(new PrivilegedExceptionAction<TuscanyAxisConfigurator>()
{
                     public TuscanyAxisConfigurator run() throws AxisFault {
-                        return new TuscanyAxisConfigurator();
+                        return new TuscanyAxisConfigurator(isRampartRequired);
                     }
                 });
             configContext = tuscanyAxisConfigurator.getConfigurationContext();
             // deployRampartModule();
             // configureSecurity();
         } catch (PrivilegedActionException e) {
-            throw new RuntimeException(e);
+            throw new ServiceRuntimeException(e.getException());
         } catch (AxisFault e) {
-            throw new RuntimeException(e); // TODO: better exception
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+            throw new ServiceRuntimeException(e); // TODO: better exception
+        } 
 
         configContext.setContextRoot(servletHost.getContextPath());
 
         // pull out the binding intents to see what sort of transport is required
-        transportJmsPolicySet = getPolicySet(TRANSPORT_JMS_QUALIFIED_INTENT);
+        transportJmsPolicySet = AxisPolicyHelper.getPolicySet(wsBinding, TRANSPORT_JMS_QUALIFIED_INTENT);
         
         String uri;
         
@@ -224,19 +212,6 @@
         wsBinding.setURI(uri);
     }
     
-    private void engageModules() throws AxisFault {
-        if ( wsBinding instanceof PolicySetAttachPoint ) {
-            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
-            if ( policiedBinding.getPolicySets().size() > 0 ) {
-                //TODO: need to verify if one of the policies are concerned with security
-                AxisModule m = new AxisModule("rampart");
-                m.setFileName(wsBinding.getClass().getClassLoader().getResource("rampart-1.2.mar"));
-                configContext.getAxisConfiguration().addModule(m);
-                configContext.getAxisConfiguration().engageModule(m, configContext.getAxisConfiguration());
-            }
-        }
-    }
-
     public void start() {
 
         // TODO: if <binding.ws> specifies the WSDL service then should create a
@@ -678,24 +653,6 @@
         return wsBinding;
     }
     
-    private PolicySet getPolicySet(QName intentName){
-        PolicySet returnPolicySet = null;
-        
-        if ( wsBinding instanceof PolicySetAttachPoint ) {
-            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding; 
-            for ( PolicySet policySet : policiedBinding.getPolicySets() ) {
-                for (Intent intent : policySet.getProvidedIntents()){
-                    if ( intent.getName().equals(intentName) ){
-                        returnPolicySet = policySet;
-                        break;
-                    }
-                }
-            }
-        }
-        
-        return returnPolicySet;
-    } 
-    
     private void setupPolicyHandlers(List<PolicyHandler> policyHandlers, ConfigurationContext
configContext)  {
         for ( PolicyHandler aHandler : policyHandlers ) {
             aHandler.setUp(configContext);
@@ -720,52 +677,6 @@
     }
      
     
-    private void deployRampartModule()  throws DeploymentException, AxisFault {
-    	ClassLoader tccl = (ClassLoader) org.apache.axis2.java.security.AccessController
-        .doPrivileged(new PrivilegedAction() {
-            public Object run() {
-                return Thread.currentThread().getContextClassLoader();
-            }
-        });
-
-
-        AxisModule module = new AxisModule();
-        module.setParent(configContext.getAxisConfiguration());
-		String moduleName = "rampart-1.2";
-		URL moduleurl = TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/rampart-1.2.mar");
-		module.setName(moduleName);
-		ClassLoader deploymentClassloader = Utils.createClassLoader(new URL[]{moduleurl},
-													tccl,
-													true,
-													(File)configContext.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
-													
-		module.setModuleClassLoader(deploymentClassloader);
-		populateModule(module, moduleurl,configContext.getAxisConfiguration());
-		module.setFileName(moduleurl);
-		TuscanyAxisConfigurator.addNewModule(module, configContext.getAxisConfiguration());
-		org.apache.axis2.util.Utils.calculateDefaultModuleVersion(
-				configContext.getAxisConfiguration().getModules(), configContext.getAxisConfiguration());
-    }
-    
-    private void populateModule(AxisModule module, URL moduleUrl, AxisConfiguration axisConfig)
throws DeploymentException {
-        try {
-            ClassLoader classLoadere = module.getModuleClassLoader();
-            InputStream moduleStream = classLoadere.getResourceAsStream("META-INF/module.xml");
-            if (moduleStream == null) {
-                moduleStream = classLoadere.getResourceAsStream("meta-inf/module.xml");
-            }
-            if (moduleStream == null) {
-                throw new DeploymentException(
-                        Messages.getMessage(
-                                DeploymentErrorMsgs.MODULE_XML_MISSING, moduleUrl.toString()));
-            }
-            ModuleBuilder moduleBuilder = new ModuleBuilder(moduleStream, module, axisConfig);
-            moduleBuilder.populateModule();
-        } catch (IOException e) {
-            throw new DeploymentException(e);
-        }
-    }
-    
     private void fillQoSContext(Message message, MessageContext axis2MsgCtx) {
         if ( axis2MsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS) != null &&
             axis2MsgCtx.getProperty(WSHandlerConstants.RECV_RESULTS) instanceof Vector )
{

Added: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java?rev=659420&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
(added)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
Thu May 22 21:37:44 2008
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentAttachPoint;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class AxisPolicyHelper {
+
+    public static final String XMLNS_SCA_1_0 = "http://www.osoa.org/xmlns/sca/1.0";
+    public static final QName AUTHENTICATION_INTENT = new QName(XMLNS_SCA_1_0, "authentication");
+    public static final QName CONFIDENTIALITY_INTENT = new QName(XMLNS_SCA_1_0, "confidentiality");
+    public static final QName INTEGRITY_INTENT = new QName(XMLNS_SCA_1_0, "integrity");
+    public static final QName MTOM_INTENT = new QName(XMLNS_SCA_1_0, "MTOM");
+    public static final QName SOAP12_INTENT = new QName(XMLNS_SCA_1_0, "soap12");
+
+    public static PolicySet getPolicySet(Binding wsBinding, QName intentName) {
+        PolicySet returnPolicySet = null;
+
+        if (wsBinding instanceof PolicySetAttachPoint) {
+            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)wsBinding;
+            for (PolicySet policySet : policiedBinding.getPolicySets()) {
+                for (Intent intent : policySet.getProvidedIntents()) {
+                    if (intent.getName().equals(intentName)) {
+                        returnPolicySet = policySet;
+                        break;
+                    }
+                }
+            }
+        }
+
+        return returnPolicySet;
+    }
+
+    public static boolean isIntentRequired(Binding wsBinding, QName intent) {
+        if (wsBinding instanceof IntentAttachPoint) {
+            List<Intent> intents = ((IntentAttachPoint)wsBinding).getRequiredIntents();
+            for (Intent i : intents) {
+                if (intent.equals(i.getName())) {
+                    return true;
+                }
+            }
+        }
+        return getPolicySet(wsBinding, intent) != null;
+    }
+
+    public static boolean isRampartRequired(Binding wsBinding) {
+        return isIntentRequired(wsBinding, AUTHENTICATION_INTENT) || isIntentRequired(wsBinding,
INTEGRITY_INTENT)
+            || isIntentRequired(wsBinding, CONFIDENTIALITY_INTENT);
+    }
+
+}

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/AxisPolicyHelper.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java?rev=659420&r1=659419&r2=659420&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/TuscanyAxisConfigurator.java
Thu May 22 21:37:44 2008
@@ -23,6 +23,7 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 
@@ -35,7 +36,6 @@
 import org.apache.axis2.deployment.DeploymentException;
 import org.apache.axis2.deployment.ModuleBuilder;
 import org.apache.axis2.deployment.URLBasedAxisConfigurator;
-import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -58,17 +58,28 @@
      */
     /************start of fix *********************************************************************/
     private URL axis2_xml = 
-        TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml");
+        getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml");
     private URL axis2_repository = null;
     private URL rampart_mar_url =
-        TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.mar");
+        getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart-1.3.mar");
     /************** end of fix *************************************************************/
     
-    public TuscanyAxisConfigurator() throws AxisFault {
+    private boolean isRampartRequired;
+    
+    public TuscanyAxisConfigurator(boolean isRampartRequired) throws AxisFault {
         //super(TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml"),

         //      TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/modules/rampart.mar"));
-        super(TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml"),

+        super(getResource("/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml"),

                     null);
+        this.isRampartRequired = isRampartRequired;
+    }
+    
+    private static URL getResource(final String name) {
+        return AccessController.doPrivileged(new PrivilegedAction<URL>() {
+            public URL run() {
+                return TuscanyAxisConfigurator.class.getResource(name);
+            }
+        });
     }
 
     public ConfigurationContext getConfigurationContext() throws AxisFault {
@@ -94,6 +105,9 @@
                 axis2xmlStream = axis2_xml.openStream();
             }
             axisConfig = populateAxisConfiguration(axis2xmlStream);
+            if (isRampartRequired) {
+                axisConfig.addGlobalModuleRef("rampart");
+            }   
             if (axis2_repository == null) {
                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
                 if (axis2repoPara != null) {
@@ -112,7 +126,9 @@
                     try {
                         loadFromClassPath(); 
                     } catch ( Exception e ) {
-                        loadRampartModule();
+                        if (isRampartRequired) {
+                            loadRampartModule();
+                        }
                     }
                 }
                 
@@ -130,7 +146,7 @@
     public void loadRampartModule() throws DeploymentException {
         try {
             ClassLoader deploymentClassLoader =
-                    Utils.createClassLoader(
+                    org.apache.axis2.deployment.util.Utils.createClassLoader(
                             new URL[]{rampart_mar_url},
                             axisConfig.getModuleClassLoader(),
                             true,

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml?rev=659420&r1=659419&r2=659420&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
(original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/engine/config/axis2.xml
Thu May 22 21:37:44 2008
@@ -359,7 +359,9 @@
     -->
 
 	<!-- Added by Tuscany -->
+    <!-- 
     <module ref="rampart"/>
+     -->
     
     <!-- wsp:Policy wsu:Id="UTOverTransport" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
 		<wsp:ExactlyOne>



Mime
View raw message