camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r961759 - /camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java
Date Thu, 08 Jul 2010 13:16:55 GMT
Author: jstrachan
Date: Thu Jul  8 13:16:54 2010
New Revision: 961759

URL: http://svn.apache.org/viewvc?rev=961759&view=rev
Log:
made it easier to reuse the CamelResourceConfig class, letting you pass in the packages as
a constructor

Modified:
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java?rev=961759&r1=961758&r2=961759&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/util/CamelResourceConfig.java
Thu Jul  8 13:16:54 2010
@@ -34,13 +34,17 @@ import org.apache.camel.web.resources.Co
 public class CamelResourceConfig extends PackagesResourceConfig {
 
     public CamelResourceConfig() {
-        super(createProperties());
+        this("org.apache.camel.web");
     }
 
-    protected static Map<String, Object> createProperties() {
+    public CamelResourceConfig(String packages) {
+        super(createProperties(packages));
+    }
+
+    protected static Map<String, Object> createProperties(String packages) {
         Map<String, Object> properties = new HashMap<String, Object>();
 
-        properties.put(PackagesResourceConfig.PROPERTY_PACKAGES, getResourcePackages());
+        properties.put(PackagesResourceConfig.PROPERTY_PACKAGES, packages);
 
         WadlGeneratorConfig config = WadlGeneratorConfig
                 .generator(WadlGeneratorApplicationDoc.class)
@@ -63,8 +67,4 @@ public class CamelResourceConfig extends
         m.put("dot", MediaType.valueOf(Constants.DOT_MIMETYPE));
         return m;
     }
-
-    protected static String getResourcePackages() {
-        return "org.apache.camel.web";
-    }
 }
\ No newline at end of file



Mime
View raw message