You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/10/16 15:23:26 UTC

svn commit: r464481 - in /incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http: HttpComponent.java HttpEndpoint.java HttpExternalEndpoint.java HttpResolvedEndpoint.java

Author: gnodet
Date: Mon Oct 16 06:23:25 2006
New Revision: 464481

URL: http://svn.apache.org/viewvc?view=rev&rev=464481
Log:
Reuse ExternalEndpoint and ResolvedEndpoint from servicemix-common

Removed:
    incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpExternalEndpoint.java
    incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpResolvedEndpoint.java
Modified:
    incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
    incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java

Modified: incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java?view=diff&rev=464481&r1=464480&r2=464481
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java (original)
+++ incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpComponent.java Mon Oct 16 06:23:25 2006
@@ -17,7 +17,6 @@
 package org.apache.servicemix.http;
 
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -34,6 +33,7 @@
 import org.apache.servicemix.common.DefaultComponent;
 import org.apache.servicemix.common.Deployer;
 import org.apache.servicemix.common.Endpoint;
+import org.apache.servicemix.common.ResolvedEndpoint;
 import org.apache.servicemix.common.ServiceUnit;
 import org.apache.servicemix.common.xbean.BaseXBeanDeployer;
 import org.apache.servicemix.http.jetty.JCLLogger;
@@ -51,6 +51,10 @@
  */
 public class HttpComponent extends DefaultComponent {
 
+    public final static String EPR_URI = "urn:servicemix:http";
+    public final static QName EPR_SERVICE = new QName(EPR_URI, "HttpComponent");
+    public final static String EPR_NAME = "epr";
+    
     static {
         JCLLogger.init();
     }
@@ -178,7 +182,7 @@
     }
     
     protected QName getEPRServiceName() {
-        return HttpResolvedEndpoint.EPR_SERVICE;
+        return EPR_SERVICE;
     }
     
     protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
@@ -252,7 +256,11 @@
      * @see javax.jbi.component.Component#resolveEndpointReference(org.w3c.dom.DocumentFragment)
      */
     public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
-        return HttpResolvedEndpoint.resolveEndpoint(epr);
+        ServiceEndpoint ep = ResolvedEndpoint.resolveEndpoint(epr, EPR_URI, EPR_NAME, EPR_SERVICE, "http:");
+        if (ep == null) {
+            ep = ResolvedEndpoint.resolveEndpoint(epr, EPR_URI, EPR_NAME, EPR_SERVICE, "https:");
+        }
+        return ep;
     }
 
     protected List getConfiguredEndpoints() {

Modified: incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java?view=diff&rev=464481&r1=464480&r2=464481
==============================================================================
--- incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java (original)
+++ incubator/servicemix/trunk/servicemix-http/src/main/java/org/apache/servicemix/http/HttpEndpoint.java Mon Oct 16 06:23:25 2006
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.servicemix.common.ExchangeProcessor;
+import org.apache.servicemix.common.ExternalEndpoint;
 import org.apache.servicemix.common.ManagementSupport;
 import org.apache.servicemix.http.processors.ConsumerProcessor;
 import org.apache.servicemix.http.processors.ProviderProcessor;
@@ -263,7 +264,12 @@
     }
 
     protected ServiceEndpoint createExternalEndpoint() {
-        return new HttpExternalEndpoint(this);
+        return new ExternalEndpoint(HttpComponent.EPR_URI, 
+                                    HttpComponent.EPR_NAME,
+                                    getLocationURI(),
+                                    getEndpoint(),
+                                    getService(),
+                                    getInterfaceName());
     }
 
     public AuthenticationService getAuthenticationService() {