cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amicha...@apache.org
Subject svn commit: r884725 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom: AtomPushBean.java AtomPushEngineConfigurator.java
Date Thu, 26 Nov 2009 23:45:02 GMT
Author: amichalec
Date: Thu Nov 26 23:45:01 2009
New Revision: 884725

URL: http://svn.apache.org/viewvc?rev=884725&view=rev
Log:
Align spring config for AtomPub

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushBean.java?rev=884725&r1=884724&r2=884725&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushBean.java
Thu Nov 26 23:45:01 2009
@@ -31,9 +31,9 @@
 import org.apache.cxf.jaxrs.ext.logging.atom.deliverer.Deliverer;
 
 /**
- * Bean used to configure {@link AtomPushHandler JUL handler} with Spring instead of properties
file. Next to
- * configuration of handler, Spring bean offers simple configuration of associated loggers
that share ATOM
- * push-style handler.
+ * Bean used to configure {@link AtomPushHandler JUL handler} with Spring instead of properties
file. See
+ * {@link AtomPushHandler} class for detailed description of parameters. Next to configuration
of handler,
+ * Spring bean offers simple configuration of associated loggers that share ATOM push-style
handler.
  * <p>
  * General rules:
  * <ul>
@@ -83,7 +83,6 @@
  *   &lt;/bean&gt;
  * </pre>
  */
-// TODO add support for conversion setup (output, entries, logs, format)
 public final class AtomPushBean {
 
     private AtomPushEngineConfigurator conf = new AtomPushEngineConfigurator();
@@ -219,6 +218,33 @@
     }
 
     /**
+     * Conversion output type: "feed" or "entry".
+     */
+    public void setOutput(String output) {
+        checkInit();
+        Validate.notNull(output, "output is null");
+        conf.setOutput(output);
+    }
+
+    /**
+     * Multiplicity of subelement of output: "one" or "many".
+     */
+    public void setMultiplicity(String multiplicity) {
+        checkInit();
+        Validate.notNull(multiplicity, "multiplicity is null");
+        conf.setMultiplicity(multiplicity);
+    }
+
+    /**
+     * Entry data format: "content" or "extension".
+     */
+    public void setFormat(String format) {
+        checkInit();
+        Validate.notNull(format, "format is null");
+        conf.setFormat(format);
+    }
+
+    /**
      * Initializes bean; creates ATOM push handler based on current properties state, and
attaches handler to
      * logger(s).
      */

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java?rev=884725&r1=884724&r2=884725&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java
Thu Nov 26 23:45:01 2009
@@ -100,6 +100,7 @@
     public AtomPushEngine createEngine() {
         Deliverer d = deliverer;
         Converter c = converter;
+        int batch = parseInt(batchSize, 1, 1);
         if (d == null) {
             if (delivererUrl != null) {
                 if (delivererClass != null) {
@@ -120,15 +121,14 @@
                 Multiplicity mul = parseEnum(multiplicity, Multiplicity.ONE);
                 Format form = parseEnum(format, Format.CONTENT);
                 c = new StandardConverter(out, mul, form);
+                if (retryPause != null) {
+                    int timeout = parseInt(retryTimeout, 0, 0);
+                    int pause = parseInt(retryPauseTime, 1, 30);
+                    boolean linear = !retryPause.equalsIgnoreCase("exponential");
+                    d = new RetryingDeliverer(d, timeout, pause, linear);
+                }
             }
         }
-        int batch = parseInt(batchSize, 1, 1);
-        if (retryPause != null) {
-            int timeout = parseInt(retryTimeout, 0, 0);
-            int pause = parseInt(retryPauseTime, 1, 30);
-            boolean linear = !retryPause.equalsIgnoreCase("exponential");
-            d = new RetryingDeliverer(d, timeout, pause, linear);
-        }
         AtomPushEngine engine = new AtomPushEngine();
         engine.setDeliverer(d);
         engine.setConverter(c);



Mime
View raw message