You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/05/30 17:53:20 UTC

svn commit: r661770 [1/2] - in /ode/branches/APACHE_ODE_1.1: ./ axis2-war/src/test/java/org/apache/ode/axis2/ axis2/src/main/java/org/apache/ode/axis2/ axis2/src/main/java/org/apache/ode/axis2/httpbinding/ axis2/src/test/java/org/apache/ode/axis2/httpb...

Author: mriou
Date: Fri May 30 08:53:19 2008
New Revision: 661770

URL: http://svn.apache.org/viewvc?rev=661770&view=rev
Log:
ODE-295 Integration-Layer configuration

Added:
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/Properties.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpClientHelper.java
      - copied, changed from r661752, ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilder.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/ProxyConf.java
    ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpClientHelperTest.java
      - copied, changed from r661752, ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilderTest.java
    ode/branches/APACHE_ODE_1.1/bpel-store/src/test/resources/integration-layer.properties
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/CollectionUtils.java
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/HierarchiedProperties.java
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/WatchDog.java
    ode/branches/APACHE_ODE_1.1/utils/src/test/java/org/apache/ode/utils/HierarchiedPropertiesTest.java
    ode/branches/APACHE_ODE_1.1/utils/src/test/resources/hierarchied.properties
Removed:
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/AuthenticationHelper.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilder.java
    ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilderTest.java
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/ArrayUtils.java
Modified:
    ode/branches/APACHE_ODE_1.1/Rakefile
    ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java
    ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java
    ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
    ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/Filter.java
    ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/evt/BpelEvent.java
    ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ThrottlingInterceptor.java
    ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/CorrelatorDaoImpl.java
    ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
    ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
    ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
    ode/branches/APACHE_ODE_1.1/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/CorrelatorDaoImpl.java
    ode/branches/APACHE_ODE_1.1/jacob/src/main/java/org/apache/ode/jacob/JacobRunnable.java
    ode/branches/APACHE_ODE_1.1/jacob/src/main/java/org/apache/ode/jacob/vpu/ChannelFactory.java
    ode/branches/APACHE_ODE_1.1/jacob/src/main/java/org/apache/ode/jacob/vpu/ExecutionQueueImpl.java
    ode/branches/APACHE_ODE_1.1/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/ObjectPrinter.java
    ode/branches/APACHE_ODE_1.1/utils/src/main/java/org/apache/ode/utils/fs/FileWatchDog.java
    ode/branches/APACHE_ODE_1.1/utils/src/test/java/org/apache/ode/utils/wsdl/WsdlUtilsTest.java

Modified: ode/branches/APACHE_ODE_1.1/Rakefile
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/Rakefile?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/Rakefile (original)
+++ ode/branches/APACHE_ODE_1.1/Rakefile Fri May 30 08:53:19 2008
@@ -132,7 +132,7 @@
   define "axis2" do
     compile.with projects("bpel-api", "bpel-connector", "bpel-dao", "bpel-epr", "bpel-runtime",
       "scheduler-simple", "bpel-schemas", "bpel-store", "utils"),
-      AXIOM, AXIS2_ALL, COMMONS.logging, COMMONS.collections, COMMONS.httpclient, DERBY, GERONIMO.kernel, GERONIMO.transaction,
+      AXIOM, AXIS2_ALL, COMMONS.lang, COMMONS.logging, COMMONS.collections, COMMONS.httpclient, DERBY, GERONIMO.kernel, GERONIMO.transaction,
       JAVAX.activation, JAVAX.servlet, JAVAX.stream, JAVAX.transaction, JENCKS, WSDL4J, WS_COMMONS.xml_schema,
       XMLBEANS
 
@@ -464,7 +464,7 @@
 
   desc "ODE Utils"
   define "utils" do
-    compile.with COMMONS.logging, COMMONS.pool, COMMONS.httpclient, COMMONS.codec, LOG4J, XERCES, JAVAX.stream, WSDL4J
+    compile.with COMMONS.collections, COMMONS.logging, COMMONS.pool, COMMONS.httpclient, COMMONS.codec, LOG4J, XERCES, JAVAX.stream, WSDL4J
 	test.exclude "*TestResources"
     package :jar
   end

Modified: ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java Fri May 30 08:53:19 2008
@@ -3,6 +3,7 @@
 /**
  * Tests that a fault thrown by a called service can be caught and is properly
  * structured so that an assign on a fault sub-element will succeed.
+ *
  * @author Matthieu Riou <mr...@apache.org>
  */
 public class ServiceFaultCatchTest extends Axis2TestBase {

Modified: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java Fri May 30 08:53:19 2008
@@ -78,7 +78,7 @@
             throw new ContextException("Cannot find definition for service " + initialPartnerEndpoint.serviceName
                                        + " in the context of process "+processId);
         }
-        return _server.createExternalService(wsdl, initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName, pconf);
+        return _server.createExternalService(pconf, initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName);
     }
 
 }

Modified: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java Fri May 30 08:53:19 2008
@@ -312,7 +312,7 @@
     public ODEService createService(ProcessConf pconf, QName serviceName, String portName) throws AxisFault {
         destroyService(serviceName, portName);
         AxisService axisService = ODEAxisService.createService(_axisConfig, pconf, serviceName, portName);
-        ODEService odeService = new ODEService(axisService, pconf.getDefinitionForService(serviceName), serviceName, portName, _server, _txMgr);
+        ODEService odeService = new ODEService(axisService, pconf, serviceName, portName, _server, _txMgr);
 
         _services.put(serviceName, portName, odeService);
 
@@ -328,18 +328,19 @@
         return odeService;
     }
 
-    public ExternalService createExternalService(Definition def, QName serviceName, String portName, ProcessConf pconf) throws ContextException {
+    public ExternalService createExternalService(ProcessConf pconf, QName serviceName, String portName) throws ContextException {
         ExternalService extService = (ExternalService) _externalServices.get(serviceName);
         if (extService != null)
             return extService;
 
+        Definition def = pconf.getDefinitionForService(serviceName);
         try {
             if (WsdlUtils.useHTTPBinding(def, serviceName, portName)) {
                 if(__log.isDebugEnabled())__log.debug("Creating HTTP-bound external service " + serviceName);
-                extService = new HttpExternalService(def, serviceName, portName, _executorService, _scheduler, _server);
+                extService = new HttpExternalService(pconf, serviceName, portName, _executorService, _scheduler, _server);
             } else if (WsdlUtils.useSOAPBinding(def, serviceName, portName)) {
                 if(__log.isDebugEnabled())__log.debug("Creating SOAP-bound external service " + serviceName);
-                extService = new SoapExternalService(def, serviceName, portName, _executorService, _axisConfig, _scheduler, _server, pconf);
+                extService = new SoapExternalService(pconf, serviceName, portName, _executorService, _axisConfig, _scheduler, _server);
             }
         } catch (Exception ex) {
             __log.error("Could not create external service.", ex);

Modified: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEService.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEService.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/ODEService.java Fri May 30 08:53:19 2008
@@ -36,6 +36,7 @@
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.iapi.ProcessConf;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.GUID;
 import org.apache.ode.utils.Namespaces;
@@ -56,32 +57,34 @@
 /**
  * A running service, encapsulates the Axis service, its receivers and our
  * receivers as well.
+ *
  * @author Matthieu Riou <mriou at apache dot org>
  */
 public class ODEService {
 
     private static final Log __log = LogFactory.getLog(ODEService.class);
-    public static final int TIMEOUT = 2 * 60 * 1000;
 
     private AxisService _axisService;
     private BpelServer _server;
     private TransactionManager _txManager;
+    private ProcessConf _pconf;
     private Definition _wsdlDef;
     private QName _serviceName;
     private String _portName;
     private WSAEndpoint _serviceRef;
     private SoapMessageConverter _converter;
 
-    public ODEService(AxisService axisService, Definition def, QName serviceName, String portName, BpelServer server,
+    public ODEService(AxisService axisService, ProcessConf pconf, QName serviceName, String portName, BpelServer server,
                       TransactionManager txManager) throws AxisFault {
         _axisService = axisService;
         _server = server;
         _txManager = txManager;
-        _wsdlDef = def;
+        _pconf = pconf;
+        _wsdlDef = pconf.getDefinitionForService(serviceName);
         _serviceName = serviceName;
         _portName = portName;
         _serviceRef = EndpointFactory.convertToWSA(createServiceRef(genEPRfromWSDL(_wsdlDef, serviceName, portName)));
-        _converter = new SoapMessageConverter(def, serviceName, portName);
+        _converter = new SoapMessageConverter(_wsdlDef, serviceName, portName);
 
     }
 
@@ -143,7 +146,7 @@
         if (odeMex.getOperation().getOutput() != null) {
             // Waits for the response to arrive
             try {
-                responseFuture.get(TIMEOUT, TimeUnit.MILLISECONDS);
+                responseFuture.get(getTimeout(), TimeUnit.MILLISECONDS);
             } catch (Exception e) {
                 String errorMsg = "Timeout or execution error when waiting for response to MEX "
                         + odeMex + " " + e.toString();
@@ -211,6 +214,21 @@
         return result;
     }
 
+    /**
+     * do not store the value so it can be dynamically updated
+     */
+    private long getTimeout() {
+        String timeout = (String) _pconf.getProperties(_serviceName.getLocalPart(), _portName).get(Properties.PROP_MEX_TIMEOUT);
+        if (timeout != null) {
+            try {
+                return Long.parseLong(timeout);
+            } catch (NumberFormatException e) {
+                if(__log.isWarnEnabled()) __log.warn("Mal-formatted Property: ["+ Properties.PROP_MEX_TIMEOUT+"="+timeout+"] Default value ("+Properties.DEFAULT_MEX_TIMEOUT+") will be used");
+            }
+        }
+        return Properties.DEFAULT_MEX_TIMEOUT;
+    }
+
     private void onResponse(MyRoleMessageExchange mex, MessageContext msgContext) throws AxisFault {
         switch (mex.getStatus()) {
             case FAULT:
@@ -276,7 +294,7 @@
         // The callback endpoint is going to be the same as the target
         // endpoint in this case, except that it is updated with session
         // information (if available).
-        if (odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID)!= null) {
+        if (odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID) != null) {
             _serviceRef.setSessionId(odeMex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID));
             msgContext.setProperty("callbackSessionEndpoint", _serviceRef);
         }
@@ -290,6 +308,7 @@
     /**
      * Return the service-ref element that will be used to represent this
      * endpoint.
+     *
      * @return my service endpoint
      */
     public EndpointReference getMyServiceRef() {
@@ -299,10 +318,8 @@
     /**
      * Get the EPR of this service from the WSDL.
      *
-     * @param name
-     *            service name
-     * @param portName
-     *            port name
+     * @param name     service name
+     * @param portName port name
      * @return XML representation of the EPR
      */
     public static Element genEPRfromWSDL(Definition wsdlDef, QName name, String portName) {

Added: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/Properties.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/Properties.java?rev=661770&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/Properties.java (added)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/Properties.java Fri May 30 08:53:19 2008
@@ -0,0 +1,247 @@
+/*
+ * 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.ode.axis2;
+
+import org.apache.axis2.Constants;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.transport.http.HttpTransportProperties;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpVersion;
+import org.apache.commons.httpclient.ProtocolException;
+import org.apache.commons.httpclient.params.DefaultHttpParams;
+import org.apache.commons.httpclient.params.HttpConnectionParams;
+import org.apache.commons.httpclient.params.HttpMethodParams;
+import org.apache.commons.httpclient.params.HttpParams;
+import org.apache.commons.httpclient.params.HttpClientParams;
+import org.apache.commons.httpclient.params.HostParams;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.List;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
+ */
+public class Properties {
+
+    /**
+     * Property used to define how long (in miiliseconds) the message will wait for a response. Default value is {@link #DEFAULT_MEX_TIMEOUT}
+     */
+    public static final String PROP_MEX_TIMEOUT = "mex.timeout";
+    // its default value
+    public static final int DEFAULT_MEX_TIMEOUT = 2 * 60 * 1000;
+
+
+    public static final String PROP_HTTP_CONNECTION_TIMEOUT = HttpConnectionParams.CONNECTION_TIMEOUT;
+    public static final String PROP_HTTP_SOCKET_TIMEOUT = HttpMethodParams.SO_TIMEOUT;
+    public static final String PROP_HTTP_PROTOCOL_VERSION = HttpMethodParams.PROTOCOL_VERSION;
+    public static final String PROP_HTTP_HEADER_PREFIX = "http.default-headers.";
+    public static final String PROP_HTTP_PROXY_PREFIX = "http.proxy.";
+    public static final String PROP_HTTP_PROXY_HOST = PROP_HTTP_PROXY_PREFIX + "host";
+    public static final String PROP_HTTP_PROXY_PORT = PROP_HTTP_PROXY_PREFIX + "port";
+    public static final String PROP_HTTP_PROXY_DOMAIN = PROP_HTTP_PROXY_PREFIX + "domain";
+    public static final String PROP_HTTP_PROXY_USER = PROP_HTTP_PROXY_PREFIX + "user";
+    public static final String PROP_HTTP_PROXY_PASSWORD = PROP_HTTP_PROXY_PREFIX + "password";
+
+    // Httpclient specific
+    public static final String PROP_HTTP_MAX_REDIRECTS = HttpClientParams.MAX_REDIRECTS;
+
+    // Axis2-specific
+    public static final String PROP_HTTP_PROTOCOL_ENCODING = "http.protocol.encoding";
+    public static final String PROP_HTTP_REQUEST_CHUNK = "http.request.chunk";
+    public static final String PROP_HTTP_REQUEST_GZIP = "http.request.gzip";
+    public static final String PROP_HTTP_ACCEPT_GZIP = "http.accept.gzip";
+
+
+    protected static final Log log = LogFactory.getLog(Properties.class);
+
+    public static Object[] getProxyAndHeaders(Map<String, String> properties) {
+        ArrayList<Header> headers = null; // /!\ Axis2 requires an ArrayList (not a List implementation)
+        HttpTransportProperties.ProxyProperties proxy = null;
+        for (Map.Entry<String, String> e : properties.entrySet()) {
+            final String k = e.getKey();
+            final String v = e.getValue();
+            if (k.startsWith(PROP_HTTP_HEADER_PREFIX)) {
+                if (headers == null) headers = new ArrayList<Header>();
+                // extract the header name
+                String name = k.substring(PROP_HTTP_HEADER_PREFIX.length());
+                headers.add(new Header(name, v));
+            } else if (k.startsWith(PROP_HTTP_PROXY_PREFIX)) {
+                if (proxy == null) proxy = new HttpTransportProperties.ProxyProperties();
+
+                if (PROP_HTTP_PROXY_HOST.equals(k)) proxy.setProxyName(v);
+                else if (PROP_HTTP_PROXY_PORT.equals(k)) proxy.setProxyPort(Integer.parseInt(v));
+                else if (PROP_HTTP_PROXY_DOMAIN.equals(k)) proxy.setDomain(v);
+                else if (PROP_HTTP_PROXY_USER.equals(k)) proxy.setUserName(v);
+                else if (PROP_HTTP_PROXY_PASSWORD.equals(k)) proxy.setPassWord(v);
+                else if (log.isWarnEnabled())
+                    log.warn("Unknown proxy properties [" + k + "]. " + PROP_HTTP_PROXY_PREFIX + " is a refix reserved for proxy properties.");
+            }
+        }
+        if (proxy != null) {
+            String host = proxy.getProxyHostName();
+            if (host == null || host.length() == 0) {
+                // disable proxy if the host is not null
+                proxy=null;
+                if(log.isDebugEnabled()) log.debug("Proxy host is null. Proxy will not be taken into account.");
+            }
+        }
+
+        return new Object[]{proxy, headers};
+    }
+
+    public static class Axis2 {
+
+        public static Options translate(Map<String, String> properties) {
+            return translate(properties, new Options());
+        }
+
+        public static Options translate(Map<String, String> properties, Options options) {
+            if (log.isDebugEnabled()) log.debug("Translating IL Properties for Axis2");
+            if (properties.isEmpty()) return options;
+            if (properties.containsKey(PROP_HTTP_CONNECTION_TIMEOUT)) {
+                final String value = properties.get(PROP_HTTP_CONNECTION_TIMEOUT);
+                try {
+                    options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.valueOf(value));
+                } catch (NumberFormatException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + Properties.PROP_HTTP_CONNECTION_TIMEOUT + "=" + value + "] Property will be skipped.");
+                }
+            }
+            if (properties.containsKey(PROP_HTTP_SOCKET_TIMEOUT)) {
+                final String value = properties.get(PROP_HTTP_SOCKET_TIMEOUT);
+                try {
+                    options.setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf(value));
+                } catch (NumberFormatException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + Properties.PROP_HTTP_SOCKET_TIMEOUT + "=" + value + "] Property will be skipped.");
+                }
+            }
+            if (properties.containsKey(PROP_HTTP_PROTOCOL_ENCODING)) {
+                options.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, properties.get(PROP_HTTP_PROTOCOL_ENCODING));
+            }
+            if (properties.containsKey(PROP_HTTP_PROTOCOL_VERSION)) {
+                options.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, properties.get(PROP_HTTP_PROTOCOL_VERSION));
+            }
+            if (properties.containsKey(PROP_HTTP_REQUEST_CHUNK)) {
+                options.setProperty(HTTPConstants.CHUNKED, properties.get(PROP_HTTP_REQUEST_CHUNK));
+            }
+            if (properties.containsKey(PROP_HTTP_REQUEST_GZIP)) {
+                options.setProperty(HTTPConstants.MC_GZIP_REQUEST, properties.get(PROP_HTTP_REQUEST_GZIP));
+            }
+            if (properties.containsKey(PROP_HTTP_ACCEPT_GZIP)) {
+                options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, properties.get(PROP_HTTP_ACCEPT_GZIP));
+            }
+            if (properties.containsKey(PROP_HTTP_MAX_REDIRECTS)) {
+                if (log.isWarnEnabled()) log.warn("Property Not Supported: " + PROP_HTTP_MAX_REDIRECTS);
+            }
+
+            // iterate through the properties to get Headers & Proxy information
+            Object[] o = getProxyAndHeaders(properties);
+            HttpTransportProperties.ProxyProperties proxy = (HttpTransportProperties.ProxyProperties) o[0];
+            ArrayList<Header> headers = (ArrayList<Header>) o[1]; // /!\ Axis2 requires an ArrayList (not a List implementation)
+            if (headers != null && !headers.isEmpty()) options.setProperty(HTTPConstants.HTTP_HEADERS, headers);
+            if (proxy != null) options.setProperty(HTTPConstants.PROXY, proxy);
+
+            return options;
+        }
+    }
+
+
+    public static class HttpClient {
+        public static HttpParams translate(Map<String, String> properties) {
+            return translate(properties, new DefaultHttpParams());
+        }
+
+        public static HttpParams translate(Map<String, String> properties, HttpParams p) {
+            if (log.isDebugEnabled()) log.debug("Translating IL Properties for HttpClient. Properties size="+properties.size());
+            if (properties.isEmpty()) return p;
+
+            // initialize the collection of headers
+            p.setParameter(HostParams.DEFAULT_HEADERS, new ArrayList());
+
+            if (properties.containsKey(PROP_HTTP_CONNECTION_TIMEOUT)) {
+                final String value = properties.get(PROP_HTTP_CONNECTION_TIMEOUT);
+                try {
+                    p.setParameter(HttpConnectionParams.CONNECTION_TIMEOUT, Integer.valueOf(value));
+                } catch (NumberFormatException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + Properties.PROP_HTTP_CONNECTION_TIMEOUT + "=" + value + "] Property will be skipped.");
+                }
+            }
+            if (properties.containsKey(PROP_HTTP_SOCKET_TIMEOUT)) {
+                final String value = properties.get(PROP_HTTP_SOCKET_TIMEOUT);
+                try {
+                    p.setParameter(HttpMethodParams.SO_TIMEOUT, Integer.valueOf(value));
+                } catch (NumberFormatException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + Properties.PROP_HTTP_SOCKET_TIMEOUT + "=" + value + "] Property will be skipped.");
+                }
+            }
+            if (properties.containsKey(PROP_HTTP_PROTOCOL_ENCODING)) {
+                p.setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, properties.get(PROP_HTTP_PROTOCOL_ENCODING));
+            }
+            if (properties.containsKey(PROP_HTTP_PROTOCOL_VERSION)) {
+                try {
+                    p.setParameter(HttpMethodParams.PROTOCOL_VERSION, HttpVersion.parse(properties.get(PROP_HTTP_PROTOCOL_VERSION)));
+                } catch (ProtocolException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + PROP_HTTP_PROTOCOL_VERSION + "]", e);
+                }
+            }
+            if (properties.containsKey(PROP_HTTP_REQUEST_CHUNK)) {
+                // see org.apache.commons.httpclient.methods.EntityEnclosingMethod.setContentChunked()
+                p.setBooleanParameter(PROP_HTTP_REQUEST_CHUNK, Boolean.parseBoolean(properties.get(PROP_HTTP_REQUEST_CHUNK)));
+            }
+            if (properties.containsKey(PROP_HTTP_REQUEST_GZIP)) {
+                if (log.isWarnEnabled()) log.warn("Property Not Supported: " + PROP_HTTP_REQUEST_GZIP);
+            }
+
+            if (Boolean.parseBoolean(properties.get(PROP_HTTP_ACCEPT_GZIP))) {
+                // append gzip to the list of accepted encoding
+                ((Collection) p.getParameter(HostParams.DEFAULT_HEADERS)).add(new Header("Accept-Encoding", "gzip"));
+            }
+
+            if (properties.containsKey(PROP_HTTP_MAX_REDIRECTS)) {
+                final String value = properties.get(PROP_HTTP_MAX_REDIRECTS);
+                try {
+                    p.setParameter(HttpClientParams.MAX_REDIRECTS, Integer.valueOf(value));
+                } catch (NumberFormatException e) {
+                    if (log.isWarnEnabled())
+                        log.warn("Mal-formatted Property: [" + Properties.PROP_HTTP_MAX_REDIRECTS + "=" + value + "] Property will be skipped.");
+                }
+            }
+
+            Object[] o = getProxyAndHeaders(properties);
+            HttpTransportProperties.ProxyProperties proxy = (HttpTransportProperties.ProxyProperties) o[0];
+            Collection headers = (Collection) o[1];
+            if (headers != null && !headers.isEmpty())
+                ((Collection) p.getParameter(HostParams.DEFAULT_HEADERS)).addAll(headers);
+            if (proxy != null) p.setParameter(PROP_HTTP_PROXY_PREFIX, proxy);
+
+            return p;
+        }
+
+    }
+}

Modified: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/SoapExternalService.java Fri May 30 08:53:19 2008
@@ -21,6 +21,7 @@
 
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
+import java.util.Map;
 import java.io.File;
 import java.io.InputStream;
 
@@ -56,6 +57,8 @@
 import org.apache.ode.il.OMUtils;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.Namespaces;
+import org.apache.ode.utils.WatchDog;
+import org.apache.ode.utils.CollectionUtils;
 import org.apache.ode.utils.fs.FileWatchDog;
 import org.apache.ode.utils.wsdl.Messages;
 import org.apache.ode.utils.uuid.UUID;
@@ -77,6 +80,7 @@
 
     private static final int EXPIRE_SERVICE_CLIENT = 30000;
 
+    private static ThreadLocal<CachedOptions> _cachedOptions = new ThreadLocal<CachedOptions>();
     private static ThreadLocal<CachedServiceClient> _cachedClients = new ThreadLocal<CachedServiceClient>();
 
     private ExecutorService _executorService;
@@ -89,18 +93,17 @@
     private BpelServer _server;
     private ProcessConf _pconf;
 
-    public SoapExternalService(Definition definition, QName serviceName, String portName, ExecutorService executorService,
-                               AxisConfiguration axisConfig, Scheduler sched, BpelServer server, ProcessConf pconf) throws AxisFault {
-        _definition = definition;
+    public SoapExternalService(ProcessConf pconf, QName serviceName, String portName, ExecutorService executorService,
+                               AxisConfiguration axisConfig, Scheduler sched, BpelServer server) throws AxisFault {
+        _definition = pconf.getDefinitionForService(serviceName);
         _serviceName = serviceName;
         _portName = portName;
         _executorService = executorService;
         _axisConfig = axisConfig;
         _sched = sched;
-        _converter = new SoapMessageConverter(definition, serviceName, portName);
+        _converter = new SoapMessageConverter(_definition, serviceName, portName);
         _server = server;
         _pconf = pconf;
-
     }
 
     public void invoke(final PartnerRoleMessageExchange odeMex) {
@@ -121,20 +124,16 @@
                 __log.debug("Message: " + soapEnv);
             }
 
-            Options options = new Options();
-            options.setAction(mctx.getSoapAction());
-            options.setTo(axisEPR);
-            options.setTimeOutInMilliSeconds(60000);
-            options.setExceptionToBeThrownOnSOAPFault(false);
-
-            AuthenticationHelper.setHttpAuthentication(odeMex, options);
-
-            CachedServiceClient cached = getCachedServiceClient();
 
-            final OperationClient operationClient = cached._client.createClient(isTwoWay ? ServiceClient.ANON_OUT_IN_OP
+            ServiceClient client = getCachedServiceClient().client;
+            final OperationClient operationClient = client.createClient(isTwoWay ? ServiceClient.ANON_OUT_IN_OP
                     : ServiceClient.ANON_OUT_ONLY_OP);
-            operationClient.setOptions(options);
             operationClient.addMessageContext(mctx);
+            // this Options can be alter without impacting the ServiceClient options (which is a requirement)
+            Options operationOptions = operationClient.getOptions();
+            operationOptions.setAction(mctx.getSoapAction());
+            operationOptions.setTo(axisEPR);
+
 
             if (isTwoWay) {
                 final String mexId = odeMex.getMessageExchangeId();
@@ -194,19 +193,29 @@
     }
 
     private CachedServiceClient getCachedServiceClient() throws AxisFault {
-        CachedServiceClient cached = _cachedClients.get();
-        if (cached == null) {
-            cached = new CachedServiceClient(new File(_pconf.getBaseURI().resolve(_serviceName.getLocalPart() + ".axis2")), EXPIRE_SERVICE_CLIENT);
-            _cachedClients.set(cached);
+        CachedServiceClient cachedServiceClient = _cachedClients.get();
+        if (cachedServiceClient == null) {
+            cachedServiceClient = new CachedServiceClient(new File(_pconf.getBaseURI().resolve(_serviceName.getLocalPart() + ".axis2")), EXPIRE_SERVICE_CLIENT);
+            _cachedClients.set(cachedServiceClient);
         }
         try {
             // call manually the check procedure
             // we dont want a dedicated thread for that
-            cached.checkAndConfigure();
-        } catch (Exception e) {
-            throw AxisFault.makeFault(e);
+            cachedServiceClient.check();
+        } catch (RuntimeException e) {
+            throw AxisFault.makeFault(e.getCause() != null ? e.getCause() : e);
+        }
+
+        SoapExternalService.CachedOptions cachedOptions = _cachedOptions.get();
+        if (cachedOptions == null) {
+            cachedOptions = new CachedOptions();
+            _cachedOptions.set(cachedOptions);
         }
-        return cached;
+        cachedOptions.check();
+
+        // apply the options to the service client
+        cachedServiceClient.client.setOptions(cachedOptions.options);
+        return cachedServiceClient;
     }
 
     /**
@@ -369,35 +378,39 @@
 
     /**
      * This class wraps a {@link org.apache.axis2.client.ServiceClient} and watches changes (deletions,creations,updates)
-     *  on a  Axis2 service config file named {service-name}.axis2.<p/>
+     * on a  Axis2 service config file named {service-name}.axis2.<p/>
      * The {@link org.apache.axis2.client.ServiceClient} instance is created from the main Axis2 config instance and
-     * this service-specific config file. 
+     * this service-specific config file.
      */
-    class CachedServiceClient extends FileWatchDog {
-        ServiceClient _client;
+    private class CachedServiceClient extends FileWatchDog {
+        ServiceClient client;
 
         protected CachedServiceClient(File file, long delay) {
             super(file, delay);
         }
 
-        protected boolean isInitialized() throws Exception {
-            return _client != null;
+        protected boolean isInitialized() {
+            return client != null;
         }
 
-        protected void init() throws Exception {
-            _client = new ServiceClient(new ConfigurationContext(_axisConfig), null);
+        protected void init() {
+            try {
+                client = new ServiceClient(new ConfigurationContext(_axisConfig), null);
+            } catch (AxisFault axisFault) {
+                throw new RuntimeException(axisFault);
+            }
         }
 
-        protected void doOnUpdate() throws Exception {
+        protected void doOnUpdate() {
             // axis2 service configuration
             // if the config file has been modified (i.e added or updated), re-create a ServiceClient
             // and load the new config.
-            init(); //reset the ServiceClient instance
+            init(); // create a new ServiceClient instance
             try {
                 InputStream ais = file.toURI().toURL().openStream();
                 if (ais != null) {
                     if (__log.isDebugEnabled()) __log.debug("Configuring service " + _serviceName + " using: " + file);
-                    ServiceBuilder builder = new ServiceBuilder(ais, new ConfigurationContext(_client.getAxisConfiguration()), _client.getAxisService());
+                    ServiceBuilder builder = new ServiceBuilder(ais, new ConfigurationContext(client.getAxisConfiguration()), client.getAxisService());
                     builder.populateService(builder.buildOM());
                 }
             } catch (Exception e) {
@@ -406,4 +419,50 @@
         }
     }
 
+    private class CachedOptions extends WatchDog<Map> {
+
+        Options options;
+
+        private CachedOptions() {
+            super(new WatchDog.Mutable<Map>() {
+                // ProcessConf#getProperties(String...) cannot return ull (by contract)
+                public boolean exists() {
+                    return true;
+                }
+
+                public boolean hasChangedSince(Map since) {
+                    Map latest = lastModified();  // cannot be null but better be prepared
+                    // check if mappings are equal
+                    return !CollectionUtils.equals(latest, since);
+                }
+
+                public Map lastModified() {
+                    return _pconf.getProperties(_serviceName.getLocalPart(), _portName);
+                }
+            });
+        }
+
+        protected boolean isInitialized() {
+            return options != null;
+        }
+
+        protected void init() {
+            options = new Options();
+        }
+
+        protected void doOnUpdate() {
+            init();
+            Map properties = _pconf.getProperties(_serviceName.getLocalPart(), _portName);
+            Properties.Axis2.translate(properties, options);
+
+            // set defaults values
+            options.setExceptionToBeThrownOnSOAPFault(false);
+
+            // this value does NOT override Properties.PROP_HTTP_CONNECTION_TIMEOUT
+            // nor Properties.PROP_HTTP_SOCKET_TIMEOUT.
+            // it will be applied only if the laters are not set.
+            options.setTimeOutInMilliSeconds(60000);
+        }
+    }
+
 }

Copied: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpClientHelper.java (from r661752, ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilder.java)
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpClientHelper.java?p2=ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpClientHelper.java&p1=ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilder.java&r1=661752&r2=661770&rev=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilder.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpClientHelper.java Fri May 30 08:53:19 2008
@@ -19,66 +19,76 @@
 
 package org.apache.ode.axis2.httpbinding;
 
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.GetMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.URI;
+import org.apache.commons.httpclient.URIException;
 import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
 import org.apache.commons.httpclient.methods.DeleteMethod;
-import org.apache.commons.httpclient.methods.PutMethod;
-import org.apache.commons.httpclient.methods.ExpectContinueMethod;
 import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.PutMethod;
+import org.apache.commons.httpclient.methods.RequestEntity;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.commons.httpclient.params.HttpParams;
+import org.apache.commons.httpclient.params.HostParams;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.axis2.Properties;
+import org.apache.ode.axis2.util.URLEncodedTransformer;
+import org.apache.ode.axis2.util.UrlReplacementTransformer;
 import org.apache.ode.bpel.epr.MutableEndpoint;
+import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
 import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.Namespaces;
-import org.apache.ode.utils.stl.CollectionsX;
-import org.apache.ode.utils.wsdl.*;
 import org.apache.ode.utils.wsdl.Messages;
-import org.apache.ode.axis2.util.UrlReplacementTransformer;
-import org.apache.ode.axis2.util.URLEncodedTransformer;
+import org.apache.ode.utils.wsdl.WsdlUtils;
+import org.apache.axis2.transport.http.HttpTransportProperties;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
-import javax.wsdl.Operation;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
 import javax.wsdl.BindingOperation;
 import javax.wsdl.Message;
+import javax.wsdl.Operation;
 import javax.wsdl.Part;
-import javax.wsdl.BindingInput;
-import javax.wsdl.Binding;
 import javax.wsdl.extensions.http.HTTPOperation;
-import javax.wsdl.extensions.http.HTTPBinding;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
 import javax.xml.namespace.QName;
 import java.io.UnsupportedEncodingException;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Collection;
 
-import com.ibm.wsdl.PartImpl;
-import com.ibm.wsdl.util.StringUtils;
-
-/**
- * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
- */
-public class HttpMethodBuilder {
+public class HttpClientHelper {
 
     private static final String CONTENT_TYPE_TEXT_XML = "text/xml";
-    private static final Log log = LogFactory.getLog(HttpMethodBuilder.class);
+    private static final Log log = LogFactory.getLog(HttpClientHelper.class);
 
     protected static final org.apache.ode.utils.wsdl.Messages msgs = Messages.getMessages(Messages.class);
     protected Binding binding;
 
-    public HttpMethodBuilder(Binding binding) {
+    public HttpClientHelper(Binding binding) {
         this.binding = binding;
     }
 
+    public void configure(HostConfiguration hostConfig, HttpState state, URI targetURI, HttpParams params) throws URIException {
+        if (log.isDebugEnabled()) log.debug("Configuring http client...");
+        // proxy configuration
+        if (ProxyConf.isProxyEnabled(params, targetURI.getHost())) {
+            if (log.isDebugEnabled()) log.debug("ProxyConf");
+            ProxyConf.configure(hostConfig, state, (HttpTransportProperties.ProxyProperties) params.getParameter(Properties.PROP_HTTP_PROXY_PREFIX));
+        }
+
+        // security
+        // ...
 
-    public HttpMethod buildHttpMethod(PartnerRoleMessageExchange odeMex) throws UnsupportedEncodingException {
+    }
+
+    public HttpMethod buildHttpMethod(PartnerRoleMessageExchange odeMex, HttpParams params) throws UnsupportedEncodingException {
         Operation operation = odeMex.getOperation();
         BindingOperation bindingOperation = binding.getBindingOperation(operation.getName(), operation.getInput().getName(), operation.getOutput().getName());
 
@@ -97,7 +107,7 @@
         String verb = WsdlUtils.resolveVerb(binding, bindingOperation);
 
         // build the http method itself
-        HttpMethod method = prepareHttpMethod(bindingOperation, verb, partElements, url);
+        HttpMethod method = prepareHttpMethod(bindingOperation, verb, partElements, url, params);
         return method;
     }
 
@@ -113,7 +123,15 @@
         return partValues;
     }
 
-    protected HttpMethod prepareHttpMethod(BindingOperation bindingOperation, String verb, Map<String, Element> partValues, final String rootUri) throws UnsupportedEncodingException {
+    /**
+     * create and initialize the http method.
+     * Http Headers that may been passed in the params are not set in this method.
+     * Headers will be automatically set by HttpClient.
+     * See usages of HostParams.DEFAULT_HEADERS
+     * See org.apache.commons.httpclient.HttpMethodDirector#executeMethod(org.apache.commons.httpclient.HttpMethod)
+     */
+    protected HttpMethod prepareHttpMethod(BindingOperation bindingOperation, String verb, Map<String, Element> partValues,
+                                           final String rootUri, HttpParams params) throws UnsupportedEncodingException {
         if (log.isDebugEnabled()) log.debug("Preparing http request...");
         // convenience variables...
         BindingInput bindingInput = bindingOperation.getBindingInput();
@@ -155,7 +173,6 @@
             } else if ("DELETE".equalsIgnoreCase(verb)) {
                 method = new DeleteMethod();
             }
-
             if (useUrlEncoded) {
                 queryPath = encodedParams;
             }
@@ -174,7 +191,7 @@
 
             // some body-building...
             if (useUrlEncoded) {
-                requestEntity = new StringRequestEntity(encodedParams, PostMethod.FORM_URL_ENCODED_CONTENT_TYPE, "UTF-8");
+                requestEntity = new StringRequestEntity(encodedParams, PostMethod.FORM_URL_ENCODED_CONTENT_TYPE, method.getParams().getContentCharset());
             } else if (contentType.endsWith(CONTENT_TYPE_TEXT_XML)) {
                 // assumption is made that there is a single part
                 // validation steps in the constructor must warranty that
@@ -192,14 +209,18 @@
             }
 
             // cast safely, PUT and POST are subclasses of EntityEnclosingMethod
-            ((EntityEnclosingMethod) method).setRequestEntity(requestEntity);
+            final EntityEnclosingMethod enclosingMethod = (EntityEnclosingMethod) method;
+            enclosingMethod.setRequestEntity(requestEntity);
+            enclosingMethod.setContentChunked(params.getBooleanParameter(Properties.PROP_HTTP_REQUEST_CHUNK, false));
 
         } else {
             // should not happen because of HttpBindingValidator, but never say never
             throw new IllegalArgumentException("Unsupported HTTP method: " + verb);
         }
 
-        // Settings common to all methods
+        // link params together
+        method.getParams().setDefaults(params);
+
         String completeUri = rootUri + (rootUri.endsWith("/") || relativeUri.startsWith("/") ? "" : "/") + relativeUri;
         method.setPath(completeUri); // assumes that the path is properly encoded (URL safe).
         method.setQueryString(queryPath);

Modified: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpExternalService.java Fri May 30 08:53:19 2008
@@ -19,20 +19,24 @@
 
 package org.apache.ode.axis2.httpbinding;
 
-import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.URIException;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.params.HttpParams;
+import org.apache.commons.httpclient.params.HttpClientParams;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.axis2.ExternalService;
 import org.apache.ode.axis2.ODEService;
+import org.apache.ode.axis2.Properties;
 import org.apache.ode.bpel.epr.EndpointFactory;
 import org.apache.ode.bpel.epr.WSAEndpoint;
 import org.apache.ode.bpel.iapi.BpelServer;
 import org.apache.ode.bpel.iapi.EndpointReference;
 import org.apache.ode.bpel.iapi.MessageExchange;
 import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.ProcessConf;
 import org.apache.ode.bpel.iapi.Scheduler;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.Namespaces;
@@ -52,6 +56,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 
@@ -64,24 +69,26 @@
     private static final Log log = LogFactory.getLog(HttpExternalService.class);
     private static final Messages msgs = Messages.getMessages(Messages.class);
 
-    private MultiThreadedHttpConnectionManager connections = new MultiThreadedHttpConnectionManager();
+    private MultiThreadedHttpConnectionManager connections;
 
     protected ExecutorService executorService;
     protected Scheduler scheduler;
     protected BpelServer server;
+    protected ProcessConf pconf;
     protected QName serviceName;
     protected String portName;
 
-    protected HttpMethodBuilder methodBuilder;
+    protected HttpClientHelper clientHelper;
     protected WSAEndpoint endpointReference;
 
-    public HttpExternalService(Definition definition, QName serviceName, String portName, ExecutorService executorService, Scheduler scheduler, BpelServer server) {
+    public HttpExternalService(ProcessConf pconf, QName serviceName, String portName, ExecutorService executorService, Scheduler scheduler, BpelServer server) {
         this.portName = portName;
         this.serviceName = serviceName;
         this.executorService = executorService;
         this.scheduler = scheduler;
         this.server = server;
-
+        this.pconf = pconf;
+        Definition definition = pconf.getDefinitionForService(serviceName);
         Service serviceDef = definition.getService(serviceName);
         if (serviceDef == null)
             throw new IllegalArgumentException(msgs.msgServiceDefinitionNotFound(serviceName));
@@ -105,7 +112,8 @@
             throw new IllegalArgumentException(msgs.msgPortDefinitionNotFound(serviceName, portName));
         endpointReference = EndpointFactory.convertToWSA(ODEService.createServiceRef(eprElmt));
 
-        methodBuilder = new HttpMethodBuilder(binding);
+        clientHelper = new HttpClientHelper(binding);
+        connections = new MultiThreadedHttpConnectionManager();
     }
 
     public String getPortName() {
@@ -127,16 +135,28 @@
     public void invoke(PartnerRoleMessageExchange odeMex) {
         if (log.isDebugEnabled()) log.debug("Preparing " + getClass().getSimpleName() + " invocation...");
         try {
+            // don't make this map a class attribute, so we always get the latest version
+            final Map<String, String> properties = pconf.getProperties(serviceName.getLocalPart(), portName);
+            final HttpParams params = Properties.HttpClient.translate(properties);
+
             // build the http method
-            final HttpMethod method = methodBuilder.buildHttpMethod(odeMex);
-            // this callable encapsulate the http method execution and the process of the response
+            final HttpMethod method = clientHelper.buildHttpMethod(odeMex, params);
+
+            // create a client
+            HttpClient client = new HttpClient(connections);
+            // don't forget to wire params so that IL properties are passed around
+            client.getParams().setDefaults(params);
+
+            clientHelper.configure(client.getHostConfiguration(), client.getState(), method.getURI(), params);
+
+            // this callable encapsulates the http method execution and the process of the response
             final Callable executionCallable;
 
             // execute it
             boolean isTwoWay = odeMex.getMessageExchangePattern() == org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;
             if (isTwoWay) {
                 // two way
-                executionCallable = new HttpExternalService.TwoWayCallable(method, odeMex.getMessageExchangeId(), odeMex.getOperation());
+                executionCallable = new HttpExternalService.TwoWayCallable(client, method, odeMex.getMessageExchangeId(), odeMex.getOperation());
                 scheduler.registerSynchronizer(new Scheduler.Synchronizer() {
                     public void afterCompletion(boolean success) {
                         // If the TX is rolled back, then we don't send the request.
@@ -151,36 +171,44 @@
                 odeMex.replyAsync();
             } else {
                 // one way, just execute and forget
-                executionCallable = new HttpExternalService.OneWayCallable(method, odeMex.getMessageExchangeId(), odeMex.getOperation());
+                executionCallable = new HttpExternalService.OneWayCallable(client, method, odeMex.getMessageExchangeId(), odeMex.getOperation());
                 executorService.submit(executionCallable);
                 odeMex.replyOneWayOk();
             }
         } catch (UnsupportedEncodingException e) {
+            String errmsg = "The HTTP encoding returned isn't supported " + odeMex;
+            log.error(errmsg, e);
+            odeMex.replyWithFailure(MessageExchange.FailureType.FORMAT_ERROR, errmsg, null);
+        } catch (URIException e) {
             String errmsg = "Error sending message to " + getClass().getSimpleName() + " for ODE mex " + odeMex;
             log.error(errmsg, e);
             odeMex.replyWithFailure(MessageExchange.FailureType.FORMAT_ERROR, errmsg, null);
+        } catch (Exception e) {
+            String errmsg = "Unknown HTTP call error for ODE mex " + odeMex;
+            log.error(errmsg, e);
+            odeMex.replyWithFailure(MessageExchange.FailureType.OTHER, errmsg, null);
         }
-
     }
 
-
     private class OneWayCallable implements Callable<Void> {
         HttpMethod method;
         String mexId;
         Operation operation;
+        HttpClient client;
 
-        public OneWayCallable(HttpMethod method, String mexId, Operation operation) {
+        public OneWayCallable(org.apache.commons.httpclient.HttpClient client, HttpMethod method, String mexId, Operation operation) {
             this.method = method;
             this.mexId = mexId;
             this.operation = operation;
+            this.client = client;
         }
 
         public Void call() throws Exception {
             try {
                 // simply execute the http method
-                HttpClient client = new HttpClient(connections);
                 if (log.isDebugEnabled())
                     log.debug("Executing http request : " + method.getName() + " " + method.getURI());
+
                 final int statusCode = client.executeMethod(method);
                 // invoke getResponseBody to force the loading of the body 
                 // Actually the processResponse may happen in a separate thread and
@@ -215,19 +243,21 @@
             try {
                 // log the URI since the engine may have moved on while this One Way request was executing
                 if (statusCode >= 400) {
-                    if (log.isWarnEnabled()) log.warn("OneWay http request ["+method.getURI()+"] failed with status: " + method.getStatusLine());
+                    if (log.isWarnEnabled())
+                        log.warn("OneWay http request [" + method.getURI() + "] failed with status: " + method.getStatusLine());
                 } else {
-                    if (log.isDebugEnabled()) log.debug("OneWay http request ["+method.getURI()+"] status: " + method.getStatusLine());
+                    if (log.isDebugEnabled())
+                        log.debug("OneWay http request [" + method.getURI() + "] status: " + method.getStatusLine());
                 }
             } catch (URIException e) {
-                if(log.isDebugEnabled()) log.debug(e);
+                if (log.isDebugEnabled()) log.debug(e);
             }
         }
     }
 
     private class TwoWayCallable extends OneWayCallable {
-        public TwoWayCallable(HttpMethod method, String mexId, Operation operation) {
-            super(method, mexId, operation);
+        public TwoWayCallable(org.apache.commons.httpclient.HttpClient client, HttpMethod method, String mexId, Operation operation) {
+            super(client, method, mexId, operation);
         }
 
         public void processResponse(final int statusCode) {

Added: ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/ProxyConf.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/ProxyConf.java?rev=661770&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/ProxyConf.java (added)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/main/java/org/apache/ode/axis2/httpbinding/ProxyConf.java Fri May 30 08:53:19 2008
@@ -0,0 +1,109 @@
+/*
+ * 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.ode.axis2.httpbinding;
+
+import org.apache.axis2.transport.http.HttpTransportProperties;
+import org.apache.commons.httpclient.Credentials;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.NTCredentials;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.URIException;
+import org.apache.commons.httpclient.auth.AuthScope;
+import org.apache.commons.httpclient.params.HttpParams;
+import org.apache.ode.axis2.Properties;
+
+
+/**
+ * The purpose of this class is to configure proxy for HttpClient.
+ */
+public class ProxyConf {
+
+
+    // these properties are java system properties
+    // see http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html
+    public static final String HTTP_PROXY_HOST = "http.proxyHost";
+    public static final String HTTP_PROXY_PORT = "http.proxyPort";
+    public static final String HTTP_NON_PROXY_HOSTS = "http.nonProxyHosts";
+
+    public static void configure(HostConfiguration hostConfig, HttpState state, HttpTransportProperties.ProxyProperties proxyProperties) {
+        String proxyHost = proxyProperties.getProxyHostName();
+        int proxyPort = proxyProperties.getProxyPort();
+
+        //Setting credentials
+        String userName = proxyProperties.getUserName();
+        String password = proxyProperties.getPassWord();
+        String domain = proxyProperties.getDomain();
+
+        Credentials proxyCred;
+        if (userName != null && password != null && domain != null) {
+            proxyCred = new NTCredentials(userName, password, proxyHost, domain);
+        } else if (userName != null) {
+            proxyCred = new UsernamePasswordCredentials(userName, password);
+        } else {
+            proxyCred = new UsernamePasswordCredentials("", "");
+        }
+
+        //Using Java Networking Properties
+        String host = System.getProperty(HTTP_PROXY_HOST);
+        if (host != null) {
+            proxyHost = host;
+            proxyCred = new UsernamePasswordCredentials("", "");
+        }
+        String port = System.getProperty(HTTP_PROXY_PORT);
+        if (port != null) {
+            proxyPort = Integer.parseInt(port);
+        }
+        state.setProxyCredentials(AuthScope.ANY, proxyCred);
+        hostConfig.setProxy(proxyHost, proxyPort);
+    }
+
+    /**
+     * @return true if a proxy is set in the params, or in the system property "http.proxyHost"
+     * and the host is not mentionnned in the system property "http.nonProxyHosts"  
+     * @see Properties#PROP_HTTP_PROXY_PREFIX
+     */
+    public static boolean isProxyEnabled(HttpParams params, String targetHost) throws URIException {
+        // from IL properties
+        boolean isSet = params.isParameterSet(Properties.PROP_HTTP_PROXY_PREFIX);
+        // from Java Networking Properties
+        isSet |= System.getProperty(HTTP_PROXY_HOST) != null;
+
+        boolean isNonProxyHost = isNonProxyHost(targetHost);
+        return isSet && !isNonProxyHost;
+    }
+
+    /**
+     *
+     * @return true if the targetHost is mentionned in the system properties "http.nonProxyHosts"
+     * @see http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html
+     */
+    public static boolean isNonProxyHost(String targetHost) {
+        String nonProxyHosts = System.getProperty(HTTP_NON_PROXY_HOSTS);
+        if (nonProxyHosts != null) {
+            String[] splitted = nonProxyHosts.split("\\|");
+            for (int i = 0; i < splitted.length; i++) {
+                if (targetHost.matches(splitted[i])) return true;
+            }
+        }
+        return false;
+    }
+}
+

Copied: ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpClientHelperTest.java (from r661752, ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilderTest.java)
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpClientHelperTest.java?p2=ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpClientHelperTest.java&p1=ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilderTest.java&r1=661752&r2=661770&rev=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpMethodBuilderTest.java (original)
+++ ode/branches/APACHE_ODE_1.1/axis2/src/test/java/org/apache/ode/axis2/httpbinding/HttpClientHelperTest.java Fri May 30 08:53:19 2008
@@ -21,6 +21,7 @@
 
 import junit.framework.TestCase;
 import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.params.DefaultHttpParams;
 import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.ode.bpel.epr.MutableEndpoint;
@@ -29,6 +30,7 @@
 import org.apache.ode.bpel.iapi.Message;
 import org.apache.ode.bpel.iapi.PartnerRoleChannel;
 import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
+import org.apache.ode.bpel.iapi.ProcessConf;
 import org.apache.ode.utils.DOMUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -52,15 +54,15 @@
 /**
  * @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
  */
-public class HttpMethodBuilderTest extends TestCase {
+public class HttpClientHelperTest extends TestCase {
 
     protected Definition definition;
 
-    protected HttpMethodBuilder deliciousBuilder;
+    protected HttpClientHelper deliciousBuilder;
     protected Binding deliciousBinding;
     protected Port deliciousPort;
 
-    protected HttpMethodBuilder dummyBuilder;
+    protected HttpClientHelper dummyBuilder;
     protected Port dummyPort;
     protected Binding dummyBinding;
 
@@ -75,12 +77,12 @@
         Service deliciousService = definition.getService(new QName("http://ode/bpel/unit-test.wsdl", "DeliciousService"));
         deliciousPort = deliciousService.getPort("TagHttpPort");
         deliciousBinding = deliciousPort.getBinding();
-        deliciousBuilder = new HttpMethodBuilder(deliciousBinding);
+        deliciousBuilder = new HttpClientHelper(deliciousBinding);
 
         Service dummyService = definition.getService(new QName("http://ode/bpel/unit-test.wsdl", "DummyService"));
         dummyPort = dummyService.getPort("DummyServiceHttpport");
         dummyBinding = dummyPort.getBinding();
-        dummyBuilder = new HttpMethodBuilder(dummyBinding);
+        dummyBuilder = new HttpClientHelper(dummyBinding);
 
     }
 
@@ -101,7 +103,7 @@
         odeMex.op = deliciousBinding.getBindingOperation("getTag", null, null).getOperation();
         odeMex.req = new MockMessage(msgEl);
         odeMex.epr = new MockEPR(uri);
-        HttpMethod httpMethod = deliciousBuilder.buildHttpMethod(odeMex);
+        HttpMethod httpMethod = deliciousBuilder.buildHttpMethod(odeMex, new DefaultHttpParams());
 
 
         assertTrue("GET".equalsIgnoreCase(httpMethod.getName()));
@@ -122,7 +124,7 @@
         odeMex.req = new MockMessage(msgEl);
         odeMex.epr = new MockEPR(uri);
         try {
-            HttpMethod httpMethod = deliciousBuilder.buildHttpMethod(odeMex);
+            HttpMethod httpMethod = deliciousBuilder.buildHttpMethod(odeMex, new DefaultHttpParams());
             fail("IllegalArgumentException expected because message element is empty.");
         } catch (IllegalArgumentException e) {
             // expected behavior
@@ -148,7 +150,7 @@
         odeMex.op = dummyBinding.getBindingOperation("hello", null, null).getOperation();
         odeMex.req = new MockMessage(msgEl);
         odeMex.epr = new MockEPR(uri);
-        HttpMethod httpMethod = dummyBuilder.buildHttpMethod(odeMex);
+        HttpMethod httpMethod = dummyBuilder.buildHttpMethod(odeMex, new DefaultHttpParams());
         assertTrue("POST".equalsIgnoreCase(httpMethod.getName()));
         assertEquals("Generated URI does not match", expectedUri, httpMethod.getURI().toString());
 

Modified: ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java Fri May 30 08:53:19 2008
@@ -23,7 +23,7 @@
 import java.util.HashMap;
 import java.util.List;
 
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 
 /**
  * <p>
@@ -173,7 +173,7 @@
         buf.append("setId=");
         buf.append(_csetId);
         buf.append(", values=");
-        buf.append(ArrayUtils.makeCollection(ArrayList.class, _keyValues));
+        buf.append(CollectionUtils.makeCollection(ArrayList.class, _keyValues));
         buf.append('}');
 
         return buf.toString();

Modified: ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/Filter.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/Filter.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/Filter.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/common/Filter.java Fri May 30 08:53:19 2008
@@ -19,7 +19,7 @@
 
 package org.apache.ode.bpel.common;
 
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.apache.ode.utils.stl.CollectionsX;
 import org.apache.ode.utils.stl.UnaryFunction;
@@ -133,7 +133,7 @@
 
   private Collection<String> getFilterKeysStr() {
     return CollectionsX.transform(new ArrayList<String>(),
-        ArrayUtils.makeCollection(ArrayList.class , getFilterKeys()),
+        CollectionUtils.makeCollection(ArrayList.class , getFilterKeys()),
         new UnaryFunction<FKEY,String>() {
           public String apply(FKEY x) {
             return x.name();

Modified: ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/evt/BpelEvent.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/evt/BpelEvent.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/evt/BpelEvent.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/evt/BpelEvent.java Fri May 30 08:53:19 2008
@@ -18,7 +18,7 @@
  */
 package org.apache.ode.bpel.evt;
 
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 
 import java.io.Serializable;
 import java.lang.reflect.Method;
@@ -66,7 +66,7 @@
             if (method.getName().startsWith("get") && method.getParameterTypes().length == 0) {
                 try {
                     String field = method.getName().substring(3);
-                    Object value = method.invoke(this, ArrayUtils.EMPTY_OBJECT_ARRAY);
+                    Object value = method.invoke(this, CollectionUtils.EMPTY_OBJECT_ARRAY);
                     if (value == null) {
                         continue;
                     }

Modified: ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java Fri May 30 08:53:19 2008
@@ -24,6 +24,7 @@
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
@@ -110,7 +111,7 @@
      * Get the deployment properties. 
      * @return
      */
-    Map<QName, Node> getProperties();
+    Map<QName, Node> getDeploymentProperties();
 
     /**
      * Gets the name of the package into which the process is deployed.
@@ -155,5 +156,11 @@
     List<Element> getExtensionElement(QName qname);
 
     boolean isEventEnabled(List<String> scopeNames, BpelEvent.TYPE type);
-    
+
+    /**
+     * Must not return null values.
+     * @param path
+     * @return
+     */
+    public Map<String, String> getProperties(String... path);
 }

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java Fri May 30 08:53:19 2008
@@ -37,7 +37,7 @@
 import org.apache.ode.bpel.pmapi.ManagementException;
 import org.apache.ode.bpel.pmapi.ProcessingException;
 import org.apache.ode.bpel.runtime.breaks.BreakpointImpl;
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 import org.apache.ode.utils.msg.MessageBundle;
 
 import javax.xml.namespace.QName;
@@ -102,7 +102,7 @@
     }
 
     void addGlobalBreakpoint(Breakpoint breakpoint){
-        Collection<Breakpoint> c = ArrayUtils.makeCollection(ArrayList.class, _globalBreakPoints);
+        Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class, _globalBreakPoints);
         c.add(breakpoint);
         _globalBreakPoints = c.toArray(new Breakpoint[c.size()]);
     }
@@ -113,7 +113,7 @@
             bpArr = new Breakpoint[]{breakpoint};
         }
         else{
-            Collection<Breakpoint> c = ArrayUtils.makeCollection(ArrayList.class, bpArr);
+            Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class, bpArr);
             c.add(breakpoint);
             bpArr = c.toArray(new Breakpoint[c.size()]);
         }
@@ -121,7 +121,7 @@
     }
 
     void removeGlobalBreakpoint(Breakpoint breakpoint){
-        Collection<Breakpoint> c = ArrayUtils.makeCollection(ArrayList.class, _globalBreakPoints);
+        Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class, _globalBreakPoints);
         c.remove(breakpoint);
         _globalBreakPoints = c.toArray(new Breakpoint[c.size()]);
     }
@@ -129,7 +129,7 @@
     void removeBreakpoint(Long pid, Breakpoint breakpoint){
         Breakpoint[] bpArr = _instanceBreakPoints.get(pid);
         if(bpArr != null){
-            Collection<Breakpoint> c = ArrayUtils.makeCollection(ArrayList.class, bpArr);
+            Collection<Breakpoint> c = CollectionUtils.makeCollection(ArrayList.class, bpArr);
             c.remove(breakpoint);
             bpArr = c.toArray(new Breakpoint[c.size()]);
             if(bpArr.length == 0) {

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MyRoleMessageExchangeImpl.java Fri May 30 08:53:19 2008
@@ -42,8 +42,8 @@
 
 class MyRoleMessageExchangeImpl extends MessageExchangeImpl implements MyRoleMessageExchange {
 
+
     private static final Log __log = LogFactory.getLog(MyRoleMessageExchangeImpl.class);
-    public static final int TIMEOUT = 2 * 60 * 1000;
 
     private static Map<String, ResponseCallback> _waitingCallbacks =
             new ConcurrentHashMap<String, ResponseCallback>();

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java Fri May 30 08:53:19 2008
@@ -41,7 +41,7 @@
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.runtime.InvalidProcessException;
 import org.apache.ode.bpel.runtime.PROCESS;
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 import org.apache.ode.utils.ObjectPrinter;
 import org.apache.ode.utils.msg.MessageBundle;
 import org.w3c.dom.Element;
@@ -125,7 +125,7 @@
         String partnerSessionId = mex.getProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID);
         if (__log.isDebugEnabled()) {
             __log.debug("INPUTMSG: " + correlatorId + ": MSG RCVD keys="
-                    + ArrayUtils.makeCollection(HashSet.class, keys) + " mySessionId=" + mySessionId
+                    + CollectionUtils.makeCollection(HashSet.class, keys) + " mySessionId=" + mySessionId
                     + " partnerSessionId=" + partnerSessionId);
         }
 

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java Fri May 30 08:53:19 2008
@@ -740,7 +740,7 @@
 
         TProcessProperties properties = info.addNewProperties();
         if (custom.includeProcessProperties()) {
-            for (Map.Entry<QName, Node> propEntry : pconf.getProperties().entrySet()) {
+            for (Map.Entry<QName, Node> propEntry : pconf.getDeploymentProperties().entrySet()) {
                 TProcessProperties.Property tprocProp = properties.addNewProperty();
                 tprocProp.setName(new QName(propEntry.getKey().getNamespaceURI(), propEntry.getKey().getLocalPart()));
                 Node propNode = tprocProp.getDomNode();

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ThrottlingInterceptor.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ThrottlingInterceptor.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ThrottlingInterceptor.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/intercept/ThrottlingInterceptor.java Fri May 30 08:53:19 2008
@@ -57,7 +57,7 @@
      * @return value of the property, or <code>null</code> if not set
      */
     private String getSimpleProperty(QName propertyName, InterceptorContext ic) {
-        Map<QName, Node> props =  ic.getProcessConf().getProperties();
+        Map<QName, Node> props =  ic.getProcessConf().getDeploymentProperties();
         for (Map.Entry<QName, Node> prop : props.entrySet()) {
             if (prop.getKey().equals(propertyName))
                 return ((Text)prop.getValue()).getWholeText();

Modified: ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/CorrelatorDaoImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/CorrelatorDaoImpl.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/CorrelatorDaoImpl.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-runtime/src/main/java/org/apache/ode/bpel/memdao/CorrelatorDaoImpl.java Fri May 30 08:53:19 2008
@@ -25,7 +25,7 @@
 import org.apache.ode.bpel.dao.MessageExchangeDAO;
 import org.apache.ode.bpel.dao.MessageRouteDAO;
 import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.utils.ArrayUtils;
+import org.apache.ode.utils.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -58,7 +58,7 @@
         }
         for (Iterator i = _messages.iterator(); i.hasNext();) {
             MsgQueueEntry mqe = (MsgQueueEntry)i.next();
-            Set<CorrelationKey> keyset = (Set<CorrelationKey>)ArrayUtils.makeCollection(HashSet.class, mqe.keys);
+            Set<CorrelationKey> keyset = (Set<CorrelationKey>) CollectionUtils.makeCollection(HashSet.class, mqe.keys);
             if ((key == null) || keyset.contains(key)) {
                 i.remove();
                 return mqe.message;
@@ -93,7 +93,7 @@
     public void enqueueMessage(MessageExchangeDAO mex, CorrelationKey[] keys) {
         if (__log.isDebugEnabled()) {
             __log.debug("enqueueProcessInvocation: data=" + mex + " keys="
-                    + ArrayUtils.makeCollection(ArrayList.class, keys));
+                    + CollectionUtils.makeCollection(ArrayList.class, keys));
         }
 
         MsgQueueEntry mqe = new MsgQueueEntry(mex, keys);

Modified: ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java?rev=661770&r1=661769&r2=661770&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java (original)
+++ ode/branches/APACHE_ODE_1.1/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java Fri May 30 08:53:19 2008
@@ -59,6 +59,8 @@
  */
 class DeploymentUnitDir  {
 
+    static final String IL_PROPERTIES_FILE = "integration-layer.properties";
+
     private static Log __log = LogFactory.getLog(DeploymentUnitDir.class);
 
     private String _name;
@@ -200,6 +202,10 @@
         return _duDirectory;
     }
 
+    public File getILPropertyFile(){
+        return new File(getDeployDir(), IL_PROPERTIES_FILE);
+    }
+
     public DeployDocument getDeploymentDescriptor() {
         if (_dd == null) {
             File ddLocation = new File(_duDirectory, "deploy.xml");