Title: [995] trunk/servicemix-jsr181/src/main/java/org/servicemix/jsr181: Fix problems (thanks dan) introduced in the previous commit with the jsr181 endpoint overriding the service interface.
Revision
995
Author
gnt
Date
2005-12-02 18:21:06 -0500 (Fri, 02 Dec 2005)

Log Message

Fix problems (thanks dan) introduced in the previous commit with the jsr181 endpoint overriding the service interface.

Modified Paths

Diff

Modified: trunk/servicemix-jsr181/src/main/java/org/servicemix/jsr181/Jsr181Endpoint.java (994 => 995)

--- trunk/servicemix-jsr181/src/main/java/org/servicemix/jsr181/Jsr181Endpoint.java	2005-12-02 21:27:09 UTC (rev 994)
+++ trunk/servicemix-jsr181/src/main/java/org/servicemix/jsr181/Jsr181Endpoint.java	2005-12-02 23:21:06 UTC (rev 995)
@@ -172,14 +172,6 @@
             Class cl = Class.forName(pojoClass);
             pojo = cl.newInstance();
         }
-        // Auto determine service interface
-        Class serviceInterface;
-        Class[] interfaces = pojo.getClass().getInterfaces();
-        if (interfaces != null && interfaces.length == 1) {
-            serviceInterface = interfaces[0];
-        } else {
-            serviceInterface = pojo.getClass();
-        }
         // Determine annotations
         WebAnnotations wa = null;
         String selectedAnnotations = null;
@@ -217,7 +209,13 @@
         // Create factory
         XFire xfire = getXFire();
         ObjectServiceFactory factory = null;
+        Class serviceClass = pojo.getClass();
         if (wa == null) {
+            // Auto determine service interface
+            Class[] interfaces = pojo.getClass().getInterfaces();
+            if (interfaces != null && interfaces.length == 1) {
+                serviceClass = interfaces[0];
+            }
             factory = new ObjectServiceFactory(xfire.getTransportManager(),
                                                new AegisBindingProvider(tm));
         } else if (selectedAnnotations.equals("java5") && selectedTypeMapping.equals("jaxb2")) {
@@ -239,7 +237,7 @@
         String svcNamespace = (service != null) ? service.getNamespaceURI() : null;
         Map props = new HashMap();
         props.put(ObjectServiceFactory.PORT_TYPE, interfaceName);
-        xfireService = factory.create(serviceInterface, svcLocalName, svcNamespace, props);
+        xfireService = factory.create(serviceClass, svcLocalName, svcNamespace, props);
         xfireService.setInvoker(new BeanInvoker(getPojo()));
         xfire.getServiceRegistry().register(xfireService);
         xfire.getTransportManager().disableAll(xfireService);

Modified: trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQNotificationBroker.java (994 => 995)

--- trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQNotificationBroker.java	2005-12-02 21:27:09 UTC (rev 994)
+++ trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/ActiveMQNotificationBroker.java	2005-12-02 23:21:06 UTC (rev 995)
@@ -63,7 +63,7 @@
  * 
  * @version $Revision$
  */
[EMAIL PROTECTED]
[EMAIL PROTECTED](endpointInterface = "org.servicemix.wspojo.notification.NotificationBroker")
 public class ActiveMQNotificationBroker implements NotificationBroker {
 
     private ActiveMQPublisherRegistrationManager publisherManager = new ActiveMQPublisherRegistrationManager();

Modified: trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java (994 => 995)

--- trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java	2005-12-02 21:27:09 UTC (rev 994)
+++ trunk/servicemix-wsnotification/src/main/java/org/servicemix/ws/notification/JBINotificationBroker.java	2005-12-02 23:21:06 UTC (rev 995)
@@ -44,7 +44,7 @@
  * 
  * @version $Revision$
  */
[EMAIL PROTECTED]
[EMAIL PROTECTED](endpointInterface = "org.servicemix.wspojo.notification.NotificationBroker")
 public class JBINotificationBroker extends ActiveMQNotificationBroker implements ComponentLifeCycle {
 	
     private static final transient Log log = LogFactory.getLog(JBINotificationBroker.class);

Reply via email to