cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From unrealji...@apache.org
Subject svn commit: r447692 - in /incubator/cxf/trunk/jca/src: main/java/org/apache/cxf/jca/cxf/ main/java/org/apache/cxf/jca/servant/ test/java/org/apache/cxf/jca/cxf/ test/java/org/apache/cxf/jca/servant/ test/java/org/apache/cxf/jca/servant/resources/
Date Tue, 19 Sep 2006 02:43:24 GMT
Author: unrealjiang
Date: Mon Sep 18 19:43:23 2006
New Revision: 447692

URL: http://svn.apache.org/viewvc?view=rev&rev=447692
Log:
CXF-80 add jca inound support

Added:
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java   (with props)
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java   (with props)
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties   (with props)
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl   (with props)
Modified:
    incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
    incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java

Modified: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java?view=diff&rev=447692&r1=447691&r2=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java (original)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/cxf/JCABusFactory.java Mon Sep 18 19:43:23 2006
@@ -18,51 +18,51 @@
  */
 package org.apache.cxf.jca.cxf;
 
-// import java.io.File;
-// import java.io.IOException;
-// import java.io.InputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 //import java.lang.reflect.Method;
-// import java.lang.reflect.Proxy;
-// import java.net.URL;
+import java.lang.reflect.Proxy;
+import java.net.URL;
 import java.util.ArrayList;
-// import java.util.Enumeration;
-// import java.util.Iterator;
+import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.List;
-// import java.util.Map;
-// import java.util.Properties;
-// import java.util.StringTokenizer;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
 import java.util.logging.Logger;
 
 import javax.naming.InitialContext;
-// import javax.naming.NamingException;
+import javax.naming.NamingException;
 import javax.resource.ResourceException;
-// import javax.wsdl.Binding;
-// import javax.wsdl.Definition;
-// import javax.wsdl.Port;
-// import javax.wsdl.PortType;
-// import javax.wsdl.Service;
-// import javax.wsdl.extensions.ExtensibilityElement;
-// import javax.wsdl.extensions.soap.SOAPAddress;
-// import javax.wsdl.factory.WSDLFactory;
-// import javax.wsdl.xml.WSDLReader;
-// import javax.xml.namespace.QName;
+import javax.wsdl.Binding;
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
 import javax.xml.ws.Endpoint;
-// import org.xml.sax.InputSource;
+import org.xml.sax.InputSource;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
-// import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.jaxws.EndpointImpl;
 //import org.apache.cxf.endpoint.EndpointImpl;
 //import org.apache.cxf.jaxws.EndpointRegistry;
 import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
 import org.apache.cxf.jca.core.resourceadapter.UriHandlerInit;
-//import org.apache.cxf.jca.core.servant.CXFConnectEJBServant;
-//import org.apache.cxf.jca.core.servant.EJBServant;
-// import org.apache.cxf.tools.util.ProcessorUtil;
+import org.apache.cxf.jca.servant.CXFConnectEJBServant;
+import org.apache.cxf.jca.servant.EJBServant;
+import org.apache.cxf.tools.util.ProcessorUtil;
 //import org.apache.cxf.ws.addressing.EndpointReferenceType;
 //import org.apache.cxf.wsdl.EndpointReferenceUtils;
 
-// import org.xmlsoap.schemas.wsdl.http.AddressType;
+import org.xmlsoap.schemas.wsdl.http.AddressType;
 
 
 public class JCABusFactory {
@@ -76,7 +76,7 @@
     private ClassLoader appserverClassLoader;
     private ManagedConnectionFactoryImpl mcf;
     private Object raBootstrapContext;
-//     private String nameSpace;
+    private String nameSpace;
 
     public JCABusFactory(ManagedConnectionFactoryImpl aMcf) {
         this.mcf = aMcf;
@@ -93,7 +93,7 @@
         return busArgs;
     }
 
-    private Bus initBus(ClassLoader loader) throws ResourceException {
+    protected Bus initBus(ClassLoader loader) throws ResourceException {
         try {
             Class busClazz = Class.forName(getBusClassName(), true, loader);
             bf = (org.apache.cxf.BusFactory) busClazz.newInstance();
@@ -120,7 +120,7 @@
             //TODO Check for the managed connection factory properties
             //mcf.validateProperties();            
             bus = initBus(cl);
-//             initialiseServants();
+            initialiseServants();
         } catch (Exception ex) {
             if (ex instanceof ResourceAdapterInternalException) {
                 throw (ResourceException)ex;
@@ -132,7 +132,7 @@
         }
     }
 
-    /*    
+    
     void initialiseServants() throws ResourceException {
         if (isMonitorEJBServicePropertiesEnabled()) {            
             LOG.info("ejb service properties update enabled. ");
@@ -144,7 +144,7 @@
             }
         }
     }
-
+    
     void initialiseServantsFromProperties(Properties ejbServants, boolean abortOnFailure)
         throws ResourceException {
 
@@ -186,7 +186,7 @@
             }
         }
     }
-
+    
     void initialiseServant(String jndiName, String serviceName) throws ResourceException {
         Endpoint ei = null;
         QName serviceQName = null;
@@ -232,12 +232,12 @@
     private Endpoint processWSDL(String jndiName, QName serviceQName, String wsdlLocation, String portName)
         throws Exception {
         Endpoint ei = null;
-        System.out.println("************************************************");
-        System.out.println("              jndiName: " + jndiName);
-        System.out.println("              serviceQName: " + serviceQName.toString());
-        System.out.println("              wsdlLocation: " + wsdlLocation);
-        System.out.println("              portName: " + portName);
-        System.out.println("************************************************");
+//         System.out.println("************************************************");
+//         System.out.println("              jndiName: " + jndiName);
+//         System.out.println("              serviceQName: " + serviceQName.toString());
+//         System.out.println("              wsdlLocation: " + wsdlLocation);
+//         System.out.println("              portName: " + portName);
+//         System.out.println("************************************************");
         URL wsdlUrl = new URL(wsdlLocation);
         WSDLFactory factory = WSDLFactory.newInstance();
         WSDLReader reader = factory.newWSDLReader();
@@ -295,8 +295,9 @@
 //                                                                                 portName);
 
         EJBServant servant = new CXFConnectEJBServant(this, wsdlLocation, jndiName, null);
-        servant.getTargetObject();
 
+        servant.getTargetObject();
+        
         String interfaceClassPackage = ProcessorUtil.parsePackageName(nameSpace, null);
         String interfaceClassString = interfaceClassPackage + "." + portTypeQName.getLocalPart();
         Class seiClass = Class.forName(interfaceClassString);
@@ -466,7 +467,7 @@
         }
         return wloc;
     }
-    */
+    
     
     private String getBusClassName() {
         return System.getProperty("test.bus.class", "org.apache.cxf.bus.CXFBusFactory");
@@ -505,7 +506,7 @@
         this.raBootstrapContext = context;
         init();
     }
-    /*
+    
     class EJBServicePropertiesMonitorRunnable implements Runnable {
         private long previousModificationTime;
         private final int pollIntervalSeconds;
@@ -549,7 +550,7 @@
             return fileModified;
         }
     }
-    */
+
     // for unit test
     protected void setBootstrapContext(Object ctx) {
         raBootstrapContext = ctx;

Added: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java (added)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,85 @@
+/**
+ * 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.cxf.jca.servant;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+
+/**
+ * The base class for all <code>Servant</code> implementations.
+ * A <code>Servant</code> defines the endpoint of an invocation
+ * and is usually used to wrap an instance of a Java class.
+ */
+public abstract class AbstractServant implements InvocationHandler {
+    private final String wsdlLocation;
+    private final Bus theBus;
+
+    /**
+     * Constructs a new <code>Servant</code> with the specified WSDL and Bus.
+     * @param wsdlLoc A string containing the location of the wsdl file.
+     * @param bus The <code>Bus</code> used to register this servant.
+     */
+    public AbstractServant(String wsdlLoc, Bus bus) {
+        wsdlLocation = wsdlLoc;
+        theBus = bus;
+    }
+
+    /**
+     * The method to obtain a reference to the instance
+     * that will be used for an invocation.
+     * @return Object The target of the invocation.
+     * @throws BusException If there is an error getting the target object.
+     */
+    public abstract Object getTargetObject() throws BusException;
+
+
+    /**
+     * Defines the actual invocation methodology.
+     * @param target The <code>Object</code> that is the target object of the invocation.
+     * @param method A <code>Method</code> representing the method being invoked.
+     * @param args An <code>Object[]</code> representing the invocation parameters.
+     * @return Object The return value of the target invocation.
+     * @throws BusException If there is an error invoking the specified method.
+     */
+    public abstract Object invoke(Object target, Method method, Object args[]) throws Throwable;
+
+
+    /**
+     * Return the location of the WSDL file describing the service this
+     * servant implements.
+     *
+     * @return String A string containing the location of the WSDL file
+     * used by this <code>Servant</code>.
+     */
+    public String getWSDLLocation() {
+        return wsdlLocation;
+    }
+
+
+    /**
+     * The <code>Bus</code> ultimately used to register the <code>Servant</code>.
+     * @return Bus The <code>Bus</code> used to register this servant.
+     */
+    public Bus getBus() {
+        return theBus;
+    }
+}

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/AbstractServant.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java (added)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,90 @@
+/**
+ * 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.cxf.jca.servant;
+
+import java.lang.reflect.Method;
+
+import java.util.Properties;
+import java.util.logging.Logger;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.cxf.BusException;
+import org.apache.cxf.jca.cxf.JCABusFactory;
+
+public class CXFConnectEJBServant extends EJBServant {
+    private static final Logger LOG = Logger.getLogger(CXFConnectEJBServant.class.toString());
+
+    final String loginModuleName = "";
+    final String userName = "";
+    final String password = "";
+    InitialContext appserverInitialContext;
+    JCABusFactory jcaBusFactory;
+
+    public CXFConnectEJBServant(JCABusFactory bf, String wsdlLoc, 
+                                    String jndiName, Class sei) throws Exception {
+        super(wsdlLoc, bf.getBus(), jndiName, null);
+        appserverInitialContext = bf.getInitialContext();
+        jcaBusFactory = bf;
+        LOG.info("appserverClassLoader=" + bf.getAppserverClassLoader());
+    }
+
+    public JCABusFactory getBusFactory() {
+        return jcaBusFactory;
+    }
+
+    public Context getInitialContext(Properties props) throws NamingException {
+        //        return super.getInitialContext(props);
+        return appserverInitialContext;
+    }
+
+    public void setInitialContext(InitialContext ic) {
+        this.appserverInitialContext = ic;
+    }
+    
+    public synchronized Object getTargetObject() throws BusException {
+        
+        Object retval = null;
+        ClassLoader original = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(jcaBusFactory.getAppserverClassLoader());
+            retval = super.getTargetObject();
+        } finally {
+            Thread.currentThread().setContextClassLoader(original);
+        }
+
+        LOG.info("target object=" + retval);
+        return retval;
+    }
+
+    public Object invoke(Object target, Method method, Object[] args) throws Throwable {
+        return doInvoke(target, method, args);
+    }
+
+    protected Object doInvoke(Object target, Method method, Object[] args)
+        throws Throwable {
+        LOG.info("CXFConnectEJBServant invoke() in thread: " + Thread.currentThread());
+        Object retval = null;
+        retval = super.invoke(target, method, args);
+        return retval;
+    }
+
+}
+

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/CXFConnectEJBServant.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java (added)
+++ incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,254 @@
+/**
+ * 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.cxf.jca.servant;
+
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import javax.ejb.EJBHome;
+import javax.ejb.EJBObject;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+
+import org.apache.cxf.common.i18n.Message;
+
+/**
+ * This servant is used to dispatch invocations to an EJB.
+ */
+public class EJBServant extends AbstractServant {
+
+
+    
+    /**
+     * Name of the default Initial Context properties file.
+     */
+    public static final String INITIAL_CONTEXT_PROPS_FILE = "initial_context.properties";
+    private static final Logger LOG = Logger.getLogger(EJBServant.class.getName());
+    /**
+     * Properties for Initial Context.
+     */
+    protected Properties props;
+    private EJBObject ejb;
+    private String jndiLookup;
+//     private ClassLoader ejbHomeClassLoader = null;
+
+    /**
+     * Constructor for creating an EJBServant.
+     * @param wsdlLoc wsdl location.
+     * @param bus Bus
+     * @param jndiName JNDI name
+     * @param initialContextProps initial context properties.
+     */
+    public EJBServant(String wsdlLoc, Bus bus, String jndiName, Properties initialContextProps) {
+        super(wsdlLoc, bus);
+        props = initialContextProps;
+        jndiLookup = jndiName;
+    }
+
+    /**
+     * Constructor for creating an EJBServant.
+     * If you use this constructor, initial context properties can be provided
+     * via properties file available in classpath. @see EJBServant#INITIAL_CONTEXT_PROPS_FILE
+     * @param wsdlLoc wsdl location.
+     * @param bus Bus.
+     * @param jndiName JNDI Name.
+     * @throws Exception if there is an error creating servant.
+     */
+    public EJBServant(String wsdlLoc, Bus bus, String jndiName) throws Exception {
+        super(wsdlLoc, bus);
+        props = getContextProperties(jndiName, INITIAL_CONTEXT_PROPS_FILE);
+        jndiLookup = jndiName;
+    }
+
+    /**
+     * Invokes on the operation of the target object with the arguments provided.
+     * @param target Object to be invoked upon.
+     * @param method Method to be invoked.
+     * @param args Object[] arguments.
+     * @return Object the result of dispatching the method. Void.TYPE for void methods.
+     * @throws BusException if there is an errror invoking operation.
+     */
+    public Object invoke(Object target, Method method, Object[] args) throws Throwable {
+//         Object retval = null;
+
+//         ClassLoader original = Thread.currentThread().getContextClassLoader();
+
+//         try {
+//             Thread.currentThread().setContextClassLoader(target.getClass().getClassLoader());
+
+//             try {
+//                 retval = method.invoke(target, args);
+
+//                 if ((retval == null) && method.getReturnType().equals(Void.TYPE)) {
+//                     retval = Void.TYPE;
+//                 }
+//             } catch (InvocationTargetException ite) {
+//                 resetCacheTarget();
+//                 throw new BusException(ite.getCause());
+//             } catch (Exception ex) {
+//                 resetCacheTarget();
+//                 throw new BusException(ex);
+//             }
+//         } finally {
+//             Thread.currentThread().setContextClassLoader(original);
+//         }
+
+//         return retval;
+//     }
+        Object result;
+        Class[] argsClass;
+        try {
+            if (args != null) {
+                argsClass = new Class[args.length];
+                for (int i = 0; i < args.length; i++) {
+                    argsClass[i] = args[i].getClass();
+                }
+            } else {
+                argsClass = null;
+            }
+            Method tMethod = ejb.getClass().getMethod(method.getName(), argsClass);  
+
+            //            result = tMethod.invoke(target, args);
+            result = tMethod.invoke(ejb, args);
+        } catch (InvocationTargetException e) {
+            throw e.getTargetException();
+        } catch (Exception e) {
+            throw new RuntimeException("unexpected invocation exception: " 
+                                       + e.getMessage());
+        }
+        return result;
+    }
+
+
+    synchronized void resetCacheTarget() {
+        ejb = null;
+    }
+
+    public void setProperties(Properties p) {
+        this.props = p;
+    }
+
+    /**
+     * Based on the information from properties.xml, locate the remote object reference
+     * of the target EJB.
+     * @return Object EJBObject created by calling create function on EJBHome.
+     * @throws BusException if there is an error getting Target EJB Object.
+     */
+    public synchronized Object getTargetObject() throws BusException {
+        if (ejb == null) {
+            try {
+
+                Context ejbContext = getInitialContext(props);
+
+                if (ejbContext == null) {
+                    Message mg = new Message("Can't get InitialContext", LOG);
+                    throw new BusException(mg);
+                }
+
+                EJBHome home = getEJBHome(ejbContext, jndiLookup);
+
+//                 ejbHomeClassLoader = home.getClass().getClassLoader();
+
+                Method createMethod = home.getClass().getMethod("create", new Class[0]);
+
+                ejb = (EJBObject) createMethod.invoke(home, new Object[0]);
+                
+            } catch (NamingException e) {
+                throw new BusException(e);
+            } catch (NoSuchMethodException e) {
+                throw new BusException(e);
+            } catch (IllegalAccessException e) {
+                throw new BusException(e);
+            } catch (InvocationTargetException itex) {
+                Throwable thrownException = itex.getTargetException();
+                throw new BusException(thrownException);
+            }
+        }
+
+        return ejb;
+    }
+
+    /**
+     * Get properties for InitialContext. Looks for properties file in the
+     * classpath with either <code>INITIAL_CONTEXT_PROPS_FILE</code> or
+     * <code>jndi name + INITIAL_CONTEXT_PROPS_FILE</code> names.
+     * @param jndiName JNDI Name
+     * @param defaultPropsName name of the default properties file.
+     * @return Properties properties for initial context.
+     * @throws Exception if there is an error getting properties.
+     */
+    
+    protected final Properties getContextProperties(String jndiName, String defaultPropsName)
+        throws Exception {
+
+        InputStream istream = getClass().getClassLoader().getResourceAsStream(jndiName
+                                                                              + "_" + defaultPropsName);
+
+        if (istream == null) {
+            istream = getClass().getClassLoader().getResourceAsStream(defaultPropsName);
+        }
+
+        Properties properties = new Properties();
+
+        if (istream != null) {
+            properties.load(istream);
+            istream.close();
+        } else {
+            LOG.fine("Properties " + defaultPropsName + " or " + jndiName
+                     + defaultPropsName + "  not found in ClassPath");
+        }
+
+        return properties;
+
+    }
+
+    /**
+     * Creates a new Initial Context with the specified properties.
+     * @param props Properties for initial context.
+     * @return Context initial context for EJB lookup.
+     * @throws NamingException if there is an error getting initial context.
+     */
+    public Context getInitialContext(Properties propers) throws NamingException {
+        return new InitialContext(propers);
+    }
+
+    /**
+     * Looksup EJBHome in the context based on the JNDI name.
+     * @param ejbContext Context to be used in lookup of EJB.
+     * @param jndiName JNDI name
+     * @return EJBHome
+     * @throws NamingException if there is an error getting EJBHome.
+     */
+    protected EJBHome getEJBHome(Context ejbContext, String jndiName) throws NamingException {
+        Object obj = ejbContext.lookup(jndiName);
+        return (EJBHome) PortableRemoteObject.narrow(obj, EJBHome.class);
+    }
+//     public ClassLoader getEJBHomeClassLoader() {
+//         return ejbHomeClassLoader;
+//     }
+}

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/main/java/org/apache/cxf/jca/servant/EJBServant.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java?view=diff&rev=447692&r1=447691&r2=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java (original)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/cxf/JCABusFactoryTest.java Mon Sep 18 19:43:23 2006
@@ -19,16 +19,15 @@
 package org.apache.cxf.jca.cxf;
 
 
-// import java.io.File;
-// import java.io.FileNotFoundException;
-// import java.net.MalformedURLException;
-
-// import java.util.Properties;
-//import java.util.ResourceBundle;
-
-//import javax.resource.ResourceException;
-//import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+// import java.util.ResourceBundle;
 
+import javax.resource.ResourceException;
+import javax.xml.namespace.QName;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -36,12 +35,12 @@
 import junit.textui.TestRunner;
 
 
-//import org.apache.cxf.Bus;
-//import org.apache.cxf.BusException;
-//import org.apache.cxf.common.i18n.Message;
-//import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
-//import org.apache.cxf.jca.cxf.test.DummyBus;
-//import org.easymock.classextension.EasyMock;
+import org.apache.cxf.Bus;
+// import org.apache.cxf.BusException;
+// import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.jca.core.resourceadapter.ResourceAdapterInternalException;
+// import org.apache.cxf.jca.cxf.test.DummyBus;
+import org.easymock.classextension.EasyMock;
 
 public class JCABusFactoryTest extends TestCase {
    
@@ -70,85 +69,88 @@
         assertEquals("Wrong Argument. ", args[1],  "a.b.c");        
     }
 
-    /*
-    public void testBusInitGetProps() throws Exception {
-        DummyBus.reset();
-        System.setProperty("test.bus.class", DummyBus.class.getName());
-        ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
+
+//     public void testBusInitGetProps() throws Exception {
+//         DummyBus.reset();
+//         System.setProperty("test.bus.class", DummyBus.class.getName());
+//         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
        
-        assertEquals("bus not yet initialized", DummyBus.getInitializeCount(), 0);
+//         assertEquals("bus not yet initialized", DummyBus.getInitializeCount(), 0);
 
         
-        BusFactory busFactory = new BusFactory(mcf);
-        busFactory.create(null, null);
+//         JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
+//         jcaBusFactory.create(null, null);
 
-        assertEquals("bus initialized ", DummyBus.getInitializeCount(), 1);
+//         assertEquals("bus initialized ", DummyBus.getInitializeCount(), 1);
        
-    }
+//     }
 
-    public void testInitBusThrowsException() throws Exception {
-        DummyBus.reset();
-        System.setProperty("test.bus.class", DummyBus.class.getName());
-        final Exception thrown = new BusException(new Message("tested bus exception!", 
-                                                              (ResourceBundle)null, new Object[]{}));
+//     public void testInitBusThrowsException() throws Exception {
+//         DummyBus.reset();
+//         System.setProperty("test.bus.class", DummyBus.class.getName());
+//         final Exception thrown = new BusException(new Message("tested bus exception!", 
+//                                                               (ResourceBundle)null, new Object[]{}));
 
-        ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
-        try {
-            ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
+//         ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
+//         try {
+//             ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
            
-            BusFactory busFactory = new BusFactory(mcf);
+//             JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
 
-            // do this for MockObject creation
-            Thread.currentThread().setContextClassLoader(busFactory.getClass().getClassLoader());
-            //            DummyBus.setThrowException(true);
+//             // do this for MockObject creation
+//             Thread.currentThread().setContextClassLoader(jcaBusFactory.getClass().getClassLoader());
+//             // DummyBus.setThrowException(true);
             
                        
-            try {
-                busFactory.create(null, null);
-                fail("did not get expected resource exception");
-            } catch (ResourceException re) {
-                assertTrue("cause is set", re.getCause() != null);
-                assertEquals("cause is expected type", thrown.getClass(), re.getCause().getClass());
-            }
+//             try {
+//                 jcaBusFactory.create(null, null);
+//                 fail("did not get expected resource exception");
+//             } catch (ResourceException re) {
+//                 System.out.println("*************************");
+//                 System.out.println(" exception: " + re.getMessage());
+//                 System.out.println("*************************");
+//                 assertTrue("cause is set", re.getCause() != null);
+//                 assertEquals("cause is expected type", thrown.getClass(), re.getCause().getClass());
+//             }
 
-            assertEquals("init was called once", 1, DummyBus.getInitializeCount());
+//             assertEquals("init was called once", 1, DummyBus.getInitializeCount());
 
-        } finally {
-            Thread.currentThread().setContextClassLoader(originalCl);
-        }
-    }
+//         } finally {
+//             Thread.currentThread().setContextClassLoader(originalCl);
+//         }
+//     }
 
-    public void testInitBusSetsThreadContextClassLoader() throws Exception {
-        DummyBus.reset();
-        System.setProperty("test.bus.class", DummyBus.class.getName());
-        ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
-        try {
-            ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
+//     public void testInitBusSetsThreadContextClassLoader() throws Exception {
+//         DummyBus.reset();
+//         System.setProperty("test.bus.class", DummyBus.class.getName());
+//         ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
+//         try {
+//             ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
           
-            BusFactory busFactory = new BusFactory(mcf);
+//             JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
 
-            // do this for MockObject creation
-            Thread.currentThread().setContextClassLoader(busFactory.getClass().getClassLoader());
+//             // do this for MockObject creation
+//             Thread.currentThread().setContextClassLoader(jcaBusFactory.getClass().getClassLoader());
 
-            Class dummyBusClass = Class.forName(DummyBus.class.getName(), true, busFactory.getClass()
-                .getClassLoader());
-            // initialise here while thread context classloader is correct
-            dummyBusClass.newInstance();
+//             Class dummyBusClass = Class.forName(DummyBus.class.getName(), true, jcaBusFactory.getClass()
+//                 .getClassLoader());
+//             // initialise here while thread context classloader is correct
+//             dummyBusClass.newInstance();
 
-            busFactory.create(null, null);
+//             jcaBusFactory.create(null, null);
 
          
-            assertEquals("init was called once", 1, DummyBus.getInitializeCount());
-            assertTrue("loader is correct in init", DummyBus.isCorrectThreadContextClassLoader());
+//             assertEquals("init was called once", 1, DummyBus.getInitializeCount());
+//             assertTrue("loader is correct in init", DummyBus.isCorrectThreadContextClassLoader());
+
+//         } finally {
+//             Thread.currentThread().setContextClassLoader(originalCl);
+//         }
+//     }
 
-        } finally {
-            Thread.currentThread().setContextClassLoader(originalCl);
-        }
-    }
-    */
     // service strings to qname localparts
    
-/*
+
     public void testValidQNameFromString() throws Exception {
         final Object[][] ejbServantServicePorpsTestStrings =
             new Object[][] {{"serviceName", new QName("serviceName")},
@@ -163,21 +165,21 @@
                                 new QName("http://somenamespace", "serviceName")}};
         
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         for (int i = 0; i < ejbServantServicePorpsTestStrings.length; i++) {
             String val = (String)ejbServantServicePorpsTestStrings[i][0];
             QName expected = (QName)ejbServantServicePorpsTestStrings[i][1];
 
-            assertEquals("correct qname from mapping for " + val, expected, busFactory
+            assertEquals("correct qname from mapping for " + val, expected, jcaBusFactory
                 .serviceQNameFromString(val));
         }
     }
 
     public void testInvalidQNameFromString() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         try {
-            busFactory.serviceQNameFromString("a@");
+            jcaBusFactory.serviceQNameFromString("a@");
             fail("expecte ex on invalid format");
         } catch (ResourceException expected) {
             assertTrue(expected.getCause() instanceof java.util.NoSuchElementException);
@@ -197,12 +199,12 @@
                             {"{http://somenamespace}serviceName,portName@http://a?param=1",
                                 "http://a?param=1"}};
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         for (int i = 0; i < ejbServantServicePropsTestStringsWsdlLoc.length; i++) {
             String val = ejbServantServicePropsTestStringsWsdlLoc[i][0];
             String expectedUrl = ejbServantServicePropsTestStringsWsdlLoc[i][1];
 
-            assertEquals("correct wsdlLocation from mapping for " + val, expectedUrl, busFactory
+            assertEquals("correct wsdlLocation from mapping for " + val, expectedUrl, jcaBusFactory
                 .wsdlLocFromString(val));
         }
     }
@@ -220,28 +222,28 @@
                                 "portName2"}};
 
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         for (int i = 0; i < ejbServantServicePropsTestStringsPortName.length; i++) {
             String val = ejbServantServicePropsTestStringsPortName[i][0];
             String expectedUrl = ejbServantServicePropsTestStringsPortName[i][1];
 
-            assertEquals("correct wsdlLocation from mapping for " + val, expectedUrl, busFactory
+            assertEquals("correct wsdlLocation from mapping for " + val, expectedUrl, jcaBusFactory
                 .portNameFromString(val));
         }
     }
 
     public void testInvalidPortNameFromString() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         try {
-            busFactory.portNameFromString("serviceName,");
+            jcaBusFactory.portNameFromString("serviceName,");
             fail("expect ex on invalid format");
         } catch (ResourceException expected) {
             assertTrue(expected.getCause() instanceof java.util.NoSuchElementException);
         }
 
         try {
-            busFactory.portNameFromString("serviceName,@abc");
+            jcaBusFactory.portNameFromString("serviceName,@abc");
             fail("expect ex on invalid format");
         } catch (ResourceException expected) {
             assertTrue("Exception message starts with Empty portName", expected.getMessage()
@@ -249,7 +251,7 @@
         }
 
         try {
-            busFactory.portNameFromString("serviceName,abc,uuu");
+            jcaBusFactory.portNameFromString("serviceName,abc,uuu");
             fail("expect ex on invalid format");
         } catch (ResourceException expected) {
             assertTrue("Exception message starts with portName already set", expected.getMessage()
@@ -259,9 +261,9 @@
 
     public void testLoadNonexistentProperties() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         try {
-            busFactory.loadProperties(new File("/rubbish_name.properties").toURL());
+            jcaBusFactory.loadProperties(new File("/rubbish_name.properties").toURL());
             fail("expect an exception .");
         } catch (ResourceException re) {
             assertTrue("Cause is FileNotFoundException, cause: " + re.getCause(),
@@ -272,11 +274,11 @@
     public void testInvalidMonitorConfigNoPropsURL() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         mcf.setMonitorEJBServiceProperties(Boolean.TRUE);
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         try {
             Bus mockBus = EasyMock.createMock(Bus.class);
-            busFactory.setBus(mockBus);
-            busFactory.initialiseServants();
+            jcaBusFactory.setBus(mockBus);
+            jcaBusFactory.initialiseServants();
             fail("exception expected");
         } catch (ResourceAdapterInternalException re) {
             assertTrue("EJBServiceProperties is not set.", re.getMessage()
@@ -288,54 +290,56 @@
     public void testInitServants() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         //get resource 
-        URL propFile = getClass().getResource("ejb_servants.properties");
+        URL propFile = getClass().getResource("resources/ejb_servants.properties");
         mcf.setEJBServicePropertiesURL(propFile.toString());
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         Bus mockBus = EasyMock.createMock(Bus.class);
 
-        busFactory.setBus((Bus)mockBus);
-        busFactory.initialiseServants();
+        jcaBusFactory.setBus((Bus)mockBus);
+        jcaBusFactory.initialiseServants();
         
     }
-    
+    /*
     public void testAddServantsCache() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
-        Bus bus = Bus.init();
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
+        ClassLoader cl = this.getClass().getClassLoader();
+        Bus bus = jcaBusFactory.initBus(cl);
 
         Properties props = new Properties();
         String wsdlLocation =
             this.getClass().getResource("resources/hello_world.wsdl").toString();
-       
-        props.put("jndiName", "{http://objectweb.org/hello_world_soap_http}SOAPService@"
+
+        System.out.println("  in test wsdlLocation: " + wsdlLocation);
+        props.put("jndiName", "{http://apache.org/hello_world_soap_http}SOAPService@"
                   + wsdlLocation);
 
-        assertTrue("there's no registered servants at beginning", busFactory.getRegisteredServants()
+        assertTrue("there's no registered servants at beginning", jcaBusFactory.getRegisteredServants()
             .isEmpty());
-        busFactory.setBus(bus);
-        busFactory.initialiseServantsFromProperties(props, true);
+        jcaBusFactory.setBus(bus);
+        jcaBusFactory.initialiseServantsFromProperties(props, true);
        
-        javax.xml.ws.Endpoint ep = (javax.xml.ws.Endpoint) busFactory.getRegisteredServants().get(0);
+        javax.xml.ws.Endpoint ep = (javax.xml.ws.Endpoint) jcaBusFactory.getRegisteredServants().get(0);
               
-        assertTrue("registered servant with the expected service name", ((Endpoint)busFactory
+        assertTrue("registered servant with the expected service name", ((javax.xml.ws.Endpoint)jcaBusFactory
             .getRegisteredServants().get(0)).isPublished());
         ep.stop();
-        busFactory.deregisterServants(bus);
+        jcaBusFactory.deregisterServants(bus);
 
-        assertTrue("servants should be deregistered", busFactory.getRegisteredServants().isEmpty());
+        assertTrue("servants should be deregistered", jcaBusFactory.getRegisteredServants().isEmpty());
         bus.shutdown(true);
     }
     
-    
+    */
 //     public void testInitServantsFromPropertiesWithPortName() throws Exception {
 //         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-//         BusFactory busFactory = new BusFactory(mcf);
+//         JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
 //         Bus mockBus = EasyMock.createMock(Bus.class);
-//         busFactory.setBus(mockBus);
+//         jcaBusFactory.setBus(mockBus);
 //         Properties props = new Properties();
 //         props.put("jndiName", "{http://objectweb.org/hello_world_soap_http}SOAPService,SoapPort@file:///");
 //         try {
-//             busFactory.initialiseServantsFromProperties(props, true);
+//             jcaBusFactory.initialiseServantsFromProperties(props, true);
 //         } catch (ResourceException expected) {
 //             assertTrue("reasonable message", expected.toString().indexOf("jndiName") != -1);
 //             assertTrue(expected instanceof ResourceAdapterInternalException);            
@@ -344,14 +348,14 @@
 
     public void testInitServantsFromPropertiesWithMissingWsdlLocInPropertiesAndConfig() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         Bus mockBus = EasyMock.createMock(Bus.class);
-        busFactory.setBus(mockBus);
+        jcaBusFactory.setBus(mockBus);
         final String jndiName = "/a/b";
         try {
             Properties props = new Properties();
             props.put(jndiName, "{http://ns}ServiceA");
-            busFactory.initialiseServantsFromProperties(props, true);
+            jcaBusFactory.initialiseServantsFromProperties(props, true);
             fail("expect ex on missing wsdl loc");
         } catch (ResourceException expected) {
             assertTrue("reasonable message", expected.toString().indexOf(jndiName) != -1);
@@ -362,14 +366,14 @@
      
     public void testInitServantsFromPropertiesWithNoServiceQName() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         Bus bus = EasyMock.createMock(Bus.class);
-        busFactory.setBus(bus);
+        jcaBusFactory.setBus(bus);
         final String jndiName = "/a/b";
         try {
             Properties props = new Properties();
             props.put(jndiName, "");
-            busFactory.initialiseServantsFromProperties(props, true);
+            jcaBusFactory.initialiseServantsFromProperties(props, true);
             fail("expect ex on missing service QName value");
         } catch (ResourceException expected) {
             assertTrue("reasonable message", expected.toString().indexOf(jndiName) != -1);
@@ -378,22 +382,22 @@
 
     public void testInitFromPropsWithInvalidWsdlLocUrls() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
 
         try {
             Properties props = new Properties();
             props.put("/a/b", "{http://ns}ServiceA@unknownprotocol:/a");
-            busFactory.initialiseServantsFromProperties(props, true);
+            jcaBusFactory.initialiseServantsFromProperties(props, true);
             fail("expect ex on unknown protocol");
         } catch (ResourceException expected) {
-            assertTrue("have a busFactorye " + expected.getCause(),
+            assertTrue("have a jcaBusFactorye " + expected.getCause(),
                        expected.getCause() instanceof MalformedURLException);
         }
 
         try {
             Properties props = new Properties();
             props.put("/a/b", "{http://ns}ServiceA@a/b");
-            busFactory.initialiseServantsFromProperties(props, true);
+            jcaBusFactory.initialiseServantsFromProperties(props, true);
 
             fail("expect ex on invalid format, no scheme");
         } catch (ResourceException expected) {
@@ -404,7 +408,7 @@
         try {
             Properties props = new Properties();
             props.put("/a/b", "{http://ns}ServiceA@http://nowhere.plannetx.cupoftea:9090/NoWhere");
-            busFactory.initialiseServantsFromProperties(props, true);
+            jcaBusFactory.initialiseServantsFromProperties(props, true);
 
             fail("expect ex on invalid url, dud host name");
         } catch (ResourceException expected) {
@@ -417,16 +421,17 @@
     
     public void testInitFromPropsDoesNotThrowExceptionWhenSomethingGoesWrong() throws Exception {
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         Bus mockBus = EasyMock.createMock(Bus.class);
-        busFactory.setBus(mockBus);
+        jcaBusFactory.setBus(mockBus);
         Properties props = new Properties();
         props.put("/a/b", "{http://ns}ServiceA@unknownprotocol:/a");
         
-        busFactory.initialiseServantsFromProperties(props, false);
+        jcaBusFactory.initialiseServantsFromProperties(props, false);
            
     }
-    
+
+    /*
     public void testPropertiesMonitorThreadCausesSomeFailures() throws Exception {
         FileChannel in = null;
         FileChannel out = null;
@@ -444,12 +449,12 @@
 
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         mcf.setEJBServicePropertiesURL(testFile.toURI().toURL().toString());
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         Bus mockBus = EasyMock.createMock(Bus.class);
-        busFactory.setBus((Bus)mockBus);
+        jcaBusFactory.setBus((Bus)mockBus);
 
-        BusFactory.EJBServicePropertiesMonitorRunnable propsRunnable =
-            busFactory.new EJBServicePropertiesMonitorRunnable(5);
+        JCABusFactory.EJBServicePropertiesMonitorRunnable propsRunnable =
+            jcaBusFactory.new EJBServicePropertiesMonitorRunnable(5);
         propsRunnable.setContinue(false);        
         propsRunnable.run();
         //do nothing here 
@@ -477,7 +482,7 @@
         
     }
     
-   public void testInitServantsWithBootstrapContextNotNull() throws Exception {
+    public void testInitServantsWithBootstrapContextNotNull() throws Exception {
         System.setProperty("test.bus.class", DummyBus.class.getName());
         ManagedConnectionFactoryImpl mcf = new ManagedConnectionFactoryImpl();
         mcf.setCXFInstallDir(DummyBus.vobRoot());
@@ -485,17 +490,14 @@
 
         assertEquals("bus not yet initialized", DummyBus.initializeCount, 0);
 
-        BusFactory busFactory = new BusFactory(mcf);
+        JCABusFactory jcaBusFactory = new JCABusFactory(mcf);
         BootstrapContext bc = (BootstrapContext)MockObjectFactory.create(BootstrapContext.class);
         assertNotNull("BootstrapContext is not null", bc);
-        busFactory.create(null, bc);
-        assertEquals("BoostrapContext set", busFactory.getBootstrapContext(), bc);
+        jcaBusFactory.create(null, bc);
+        assertEquals("BoostrapContext set", jcaBusFactory.getBootstrapContext(), bc);
         assertEquals("bus initialized ", DummyBus.initializeCount, 1);
     }
-
-   */
-
-  
+*/
    
     public static Test suite() {
         return new TestSuite(JCABusFactoryTest.class);

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,159 @@
+/**
+ * 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.cxf.jca.servant;
+
+//import java.lang.reflect.Method;
+
+import javax.ejb.EJBObject;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.jca.cxf.JCABusFactory;
+import org.apache.cxf.jca.cxf.ManagedConnectionFactoryImpl;
+import org.easymock.classextension.EasyMock;
+
+public class CXFConnectEJBServantTest extends TestCase { 
+  
+    protected CXFConnectEJBServant ejbservant;
+
+    public CXFConnectEJBServantTest(String name) throws Exception {
+        super(name);
+    }
+
+    public void setUp() throws Exception {
+        Bus mockBus = createMockBus();
+        ejbservant = createCXFConnectEJBServant(mockBus);
+    }
+
+    public void tearDown() {
+    }
+
+    public static Test suite() {
+        return new TestSuite(CXFConnectEJBServantTest.class);
+    }
+
+    public static void main(String[] args) {
+        TestRunner.main(new String[]{CXFConnectEJBServantTest.class.getName()});
+    }
+
+    public void testConstructor() throws Exception {
+        assertTrue("constructor works", 
+                   createCXFConnectEJBServant(createMockBus()) instanceof CXFConnectEJBServant);
+    }
+    
+    public void testGetTargetObjectSetsThreadContextClassloader() throws Exception {
+        final ClassLoader cl = EasyMock.createMock(ClassLoader.class);
+        final EJBObject ejb = EasyMock.createMock(EJBObject.class);
+        JCABusFactory rai = EasyMock.createMock(JCABusFactory.class);
+        InitialContext ic = EasyMock.createMock(InitialContext.class);
+        ClassLoader current = Thread.currentThread().getContextClassLoader();
+
+        ic.lookup(EasyMock.isA(String.class));
+        EasyMock.expectLastCall().
+            andReturn(new ThreadContextCheckerHome((Object)ejb, (ClassLoader)current, this)).anyTimes();
+        EasyMock.replay(ic);
+        
+        rai.setBus(null);
+        EasyMock.expectLastCall();
+        rai.getBus();
+        EasyMock.expectLastCall().andReturn(null);
+        rai.getInitialContext();
+        EasyMock.expectLastCall().andReturn(ic);
+        rai.getAppserverClassLoader();
+        EasyMock.expectLastCall().andReturn(cl).andReturn(current);
+        // retrun current classloader for getTargetObject pass
+        EasyMock.replay(rai);
+        
+        
+        EJBServant testServant = createCXFConnectEJBServant(rai, null);
+        
+        
+        assertTrue("thread classloader is not set before call, current=" + current,
+                    !cl.equals(current));
+        
+        Thread.currentThread().setContextClassLoader(current);
+        Object o = testServant.getTargetObject();
+        assertSame("we got back out test object from create, o=" + o,
+                   o, ejb);
+        
+        current = Thread.currentThread().getContextClassLoader();        
+        assertTrue("thread classloader is again not set after call, current=" + current,
+                   !cl.equals(current));       
+        EasyMock.verify(ic);
+        EasyMock.verify(rai);
+       
+    }
+    /*    
+    public void testServantInvoke() throws Exception { 
+
+        Greeter target = new GreeterImpl(); 
+        Method method = target.getClass().getMethod("sayHi", new Class[0]);
+        try {
+            ejbservant.invoke(target, method, new Object[0]);
+            
+            assertTrue("target method invoked", ((GreeterImpl)target).getSayHiCalled());
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+    }
+    */
+    /*
+    public void testServantInvokeThrowBusExceptionIfEJBThrowRuntimeException() throws Exception {
+        final String msg = "jjljljlj";
+        GreeterImpl target = new GreeterImpl();
+        target.mockInvoke = new MockInvoke() {
+                public Object invoke(Object[] args) throws Exception {
+                    throw new NullPointerException(msg);
+                }
+        };
+
+        Method method = target.getClass().getMethod("sayHi", new Class[0]);
+        try {
+            ejbservant.invoke(target, method, new Object[0]);
+            fail("exception expected");
+        } catch (Exception ex) {
+            assertTrue("target method invoked. ex: " + ex, target.sayHiCalled);
+            assertTrue("cause is RuntimeException", ex.getCause() instanceof RuntimeException);
+            assertTrue("exception message contains " + msg, ex.getMessage().indexOf(msg)!=-1);
+        }
+    }
+*/
+    protected Bus createMockBus() {
+        return EasyMock.createMock(Bus.class);
+    }
+
+    protected CXFConnectEJBServant createCXFConnectEJBServant(Bus bus) throws Exception {
+        JCABusFactory bf = new JCABusFactory(new ManagedConnectionFactoryImpl());
+        return createCXFConnectEJBServant(bf, bus);
+    }
+
+    protected CXFConnectEJBServant createCXFConnectEJBServant(JCABusFactory bf, Bus bus) throws Exception {
+        bf.setBus(bus);
+        return new CXFConnectEJBServant(bf, "", "", null);
+    }
+
+}
+
+
+

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/CXFConnectEJBServantTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,23 @@
+/**
+ * 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.cxf.jca.servant;
+
+public interface Greeter extends java.rmi.Remote {
+    String sayHi() throws java.rmi.RemoteException;
+} 

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/Greeter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,55 @@
+/**
+ * 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.cxf.jca.servant;
+
+import java.rmi.RemoteException;
+//import com.iona.mockobject.MockInvoke;
+
+public class GreeterImpl implements Greeter { 
+    private boolean sayHiCalled;
+//    public MockInvoke mockInvoke;
+
+    public GreeterImpl() {
+        sayHiCalled = false;
+//        MockInvoke mockInvoke = null;
+    }
+
+    public boolean getSayHiCalled() {
+        return sayHiCalled;
+    }
+    public void setSayHiCalled(boolean b) {
+        this.sayHiCalled = b;
+    }
+    public String sayHi() throws RemoteException {
+        sayHiCalled = true;
+/*
+        if (mockInvoke instanceof MockInvoke) {
+            try {
+                return (String) ((MockInvoke)mockInvoke).invoke(null);
+            } catch (Throwable t) {
+                if (t instanceof RuntimeException) {
+                    throw (RuntimeException)t;
+                }
+                throw new RuntimeException("unexpected exception in test:" + t, t);
+            }
+        }
+*/
+        return "hi";
+    } 
+}

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/GreeterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java Mon Sep 18 19:43:23 2006
@@ -0,0 +1,64 @@
+/**
+ * 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.cxf.jca.servant;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.EJBHome;
+import javax.ejb.EJBMetaData;
+import javax.ejb.Handle;
+import javax.ejb.HomeHandle;
+import javax.ejb.RemoveException;
+
+import junit.framework.TestCase;
+
+public class ThreadContextCheckerHome implements EJBHome {
+    final Object ejb;
+    final ClassLoader cl;
+    final TestCase test;
+
+    public ThreadContextCheckerHome(Object ejbObj, ClassLoader cLoader, TestCase tCase) {
+        this.ejb = ejbObj;
+        this.cl = cLoader;
+        this.test = tCase;
+    }
+
+    public Object create() throws RemoteException {
+        ClassLoader current = Thread.currentThread().getContextClassLoader();
+        TestCase.assertSame("thread context classloader is set as expected, current=" + current,
+                            current, cl);
+        return ejb;
+    }
+    
+    // default impemenations
+    public void remove(Handle handle) throws RemoteException, RemoveException {
+        // do nothing here
+    }
+    
+    public void remove(Object primaryKey) throws RemoteException, RemoveException {
+        // do nothing here
+    }
+    
+    public EJBMetaData getEJBMetaData() throws RemoteException {
+        return null;
+    }
+    public HomeHandle getHomeHandle() throws RemoteException {
+        return null;
+    }
+}

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/ThreadContextCheckerHome.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties Mon Sep 18 19:43:23 2006
@@ -0,0 +1,2 @@
+java\:/ejbs/A={http://apache.org/services/A/A.wsdl}ServiceA@http://apache.org
+java\:/ejbs/B=ServiceB@http://apache.org

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties Mon Sep 18 19:43:23 2006
@@ -0,0 +1,2 @@
+java\:/ejbs/A={http://apache.org/hello_world_soap_http}SOAPService@file://
+java\:/ejbs/B=ServiceB@http://apache.org
\ No newline at end of file

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/ejb_servants_one_wrong.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl?view=auto&rev=447692
==============================================================================
--- incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl (added)
+++ incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl Mon Sep 18 19:43:23 2006
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http" 
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://apache.org/hello_world_soap_http"
+    xmlns:x1="http://apache.org/hello_world_soap_http/types"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" 
+            xmlns="http://www.w3.org/2001/XMLSchema"
+	    xmlns:tns="http://apache.org/hello_world_soap_http/types"
+            elementFormDefault="qualified">
+	    <simpleType name="MyStringType">
+		<restriction base="string">
+		    <maxLength value="30" />
+		</restriction>
+	    </simpleType>
+
+            <element name="sayHi">
+                <complexType/>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="tns:MyStringType"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeOneWay">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="pingMe">
+                <complexType/>
+            </element>
+            <element name="pingMeResponse">
+                <complexType/>
+            </element>
+            <element name="faultDetail">
+                <complexType>
+                    <sequence>
+                        <element name="minor" type="short"/>
+                        <element name="major" type="short"/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part element="x1:sayHi" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part element="x1:sayHiResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+        <wsdl:part element="x1:greetMe" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+        <wsdl:part element="x1:greetMeResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+        <wsdl:part element="x1:greetMeOneWay" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeRequest">
+        <wsdl:part name="in" element="x1:pingMe"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeResponse">
+        <wsdl:part name="out" element="x1:pingMeResponse"/>
+    </wsdl:message>		
+    <wsdl:message name="pingMeFault">
+        <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+            <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+            <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+        </wsdl:operation> 
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="sayHiRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="greetMeResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeOneWayRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="pingMeFault">
+                <soap:fault name="pingMeFault" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/jca/src/test/java/org/apache/cxf/jca/servant/resources/hello_world.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message