cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1360412 - in /cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw: ./ handlers/
Date Wed, 11 Jul 2012 21:29:18 GMT
Author: sergeyb
Date: Wed Jul 11 21:29:18 2012
New Revision: 1360412

URL: http://svn.apache.org/viewvc?rev=1360412&view=rev
Log:
[DOSGI-111] Using the calling bundle context to find the custom resources

Modified:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandler.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java (original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/Constants.java Wed
Jul 11 21:29:18 2012
@@ -62,7 +62,7 @@ public class Constants {
     public static final String WS_WSDL_SERVICE_NAMESPACE =  WS_CONFIG_TYPE + ".service.ns";
     public static final String WS_WSDL_SERVICE_NAME =  WS_CONFIG_TYPE + ".service.name";
     public static final String WS_WSDL_PORT_NAME =  WS_CONFIG_TYPE + ".port.name";
-    public static final String WS_WSDL_LOCATION =  WS_CONFIG_TYPE + ".location";
+    public static final String WS_WSDL_LOCATION =  WS_CONFIG_TYPE + ".wsdl.location";
     // Rest
     public static final String RS_CONFIG_TYPE = PROVIDER_PREFIX + ".rs";
     public static final String RS_ADDRESS_PROPERTY = RS_CONFIG_TYPE + ".address";

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/AbstractPojoConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -110,12 +110,13 @@ public abstract class AbstractPojoConfig
         return appliedIntents.toArray(new String[0]);
     }
 
-    protected void setWsdlProperties(ServerFactoryBean factory, BundleContext dswContext,

-    		Map sd, boolean wsdlType) {
+    protected void setWsdlProperties(ServerFactoryBean factory,
+                                     BundleContext callingContext,  
+                                     Map sd, boolean wsdlType) {
     	String location = OsgiUtils.getProperty(sd, wsdlType ? Constants.WSDL_LOCATION : Constants.WS_WSDL_LOCATION);
     	if (location != null) {
-    		URL wsdlURL = dswContext.getBundle().getResource(location);
-	        if (wsdlURL != null) {
+    		URL wsdlURL = callingContext.getBundle().getResource(location);
+                if (wsdlURL != null) {
 	            factory.setWsdlURL(wsdlURL.toString());
 	        }
 	        QName serviceName = getServiceQName(null, sd, 

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -157,7 +157,7 @@ public class HttpServiceConfigurationTyp
         
         addWsInterceptorsFeaturesProps(factory, callingContext, sd);
         
-        setWsdlProperties(factory, dswContext, sd, false);
+        setWsdlProperties(factory, callingContext, sd, false);
         
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSHttpServiceConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.dosgi.dsw.handlers;
 
+import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
@@ -72,7 +73,14 @@ public class JaxRSHttpServiceConfigurati
             factory.setProviders(providers);
         }
         addRsInterceptorsFeaturesProps(factory, callingContext, sd);
-        
+        String location = OsgiUtils.getProperty(sd, Constants.RS_WADL_LOCATION);
+    	if (location != null) {
+    		URL wadlURL = callingContext.getBundle().getResource(location);
+                if (wadlURL != null) {
+	            factory.setDocLocation(wadlURL.toString());
+                }
+    	}        
+
         String address = constructAddress(dswContext, contextRoot);
 
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/JaxRSPojoConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.dosgi.dsw.handlers;
 
+import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -147,7 +148,10 @@ public class JaxRSPojoConfigurationTypeH
 
         String location = OsgiUtils.getProperty(sd, Constants.RS_WADL_LOCATION);
     	if (location != null) {
-    		factory.setDocLocation(location);
+    		URL wadlURL = callingContext.getBundle().getResource(location);
+                if (wadlURL != null) {
+	            factory.setDocLocation(wadlURL.toString());
+                }
     	}
         
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/PojoConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -119,7 +119,7 @@ public class PojoConfigurationTypeHandle
         factory.setServiceBean(serviceBean);
 
         addWsInterceptorsFeaturesProps(factory, callingContext, sd);
-        setWsdlProperties(factory, dswContext, sd, false);
+        setWsdlProperties(factory, callingContext, sd, false);
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {
             String[] intents = applyIntents(dswContext, callingContext, factory.getFeatures(),
factory, sd);

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java?rev=1360412&r1=1360411&r2=1360412&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/WsdlConfigurationTypeHandler.java
Wed Jul 11 21:29:18 2012
@@ -152,7 +152,7 @@ public class WsdlConfigurationTypeHandle
 
         addWsInterceptorsFeaturesProps(factory, callingContext, sd);
         
-        setWsdlProperties(factory, dswContext, sd, true);
+        setWsdlProperties(factory, callingContext, sd, true);
         if (bus != null) {
         	factory.setBus(bus);
         }



Mime
View raw message