camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r659782 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: component/file/ component/jmx/ component/list/ component/log/ component/seda/ component/timer/ impl/ processor/loadbalancer/
Date Sat, 24 May 2008 09:56:53 GMT
Author: davsclaus
Date: Sat May 24 02:56:52 2008
New Revision: 659782

URL: http://svn.apache.org/viewvc?rev=659782&view=rev
Log:
CAMEL-517: Javadoc polished

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileMessage.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileProducer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXExchange.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/ListPollingConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/TopicLoadBalancer.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileMessage.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileMessage.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileMessage.java
Sat May 24 02:56:52 2008
@@ -18,11 +18,10 @@
 
 import java.io.File;
 
-import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultMessage;
 
 /**
- * A {@link Exchange} for File
+ * A {@link org.apache.camel.Message Message} for File
  *
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileProducer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileProducer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileProducer.java
Sat May 24 02:56:52 2008
@@ -18,7 +18,6 @@
 
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
@@ -26,14 +25,14 @@
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
-import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
- * A {@link Producer} implementation for File
+ * For producing files.
  *
  * @version $Revision$
  */
@@ -51,7 +50,6 @@
     }
 
     public void process(Exchange exchange) throws Exception {
-        // TODO is it really worth using a FileExchange as the core type?
         FileExchange fileExchange = endpoint.createExchange(exchange);
         process(fileExchange);
         ExchangeHelper.copyResults(exchange, fileExchange);
@@ -98,20 +96,8 @@
                 }
             }
         } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    LOG.warn("Failed to close input: " + e, e);
-                }
-            }
-            if (fc != null) {
-                try {
-                    fc.close();
-                } catch (IOException e) {
-                    LOG.warn("Failed to close output: " + e, e);
-                }
-            }
+            ObjectHelper.close(in, file.getName(), LOG);
+            ObjectHelper.close(fc, file.getName(), LOG);
         }
     }
 

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXComponent.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXComponent.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXComponent.java
Sat May 24 02:56:52 2008
@@ -26,7 +26,7 @@
 
 /**
  * The <a href="http://activemq.apache.org/camel/jmx.html">JMX Component</a>
- * for monitoring jmx attributes
+ * for monitoring JMX attributes
  *
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXConsumer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXConsumer.java
Sat May 24 02:56:52 2008
@@ -22,7 +22,7 @@
 import org.apache.camel.impl.DefaultConsumer;
 
 /**
- * Generate an Exchange after getting a JMX Notification
+ * Creates an JMXExchange after getting a JMX Notification
  * 
  * @version $Revision$
  */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXEndpoint.java
Sat May 24 02:56:52 2008
@@ -30,7 +30,7 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * Creates a CounterMonitor for jmx attributes
+ * JMXEndpoint for monitoring JMX attributs using {@link CounterMonitor}.
  *
  * @version $Revision$
  */
@@ -56,21 +56,10 @@
         super(endpointUri);
     }
 
-    /**
-     * @return a Producer
-     * @throws Exception
-     * @see org.apache.camel.Endpoint#createProducer()
-     */
     public Producer<JMXExchange> createProducer() throws Exception {
-        throw new RuntimeException("Not supported");
+        throw new UnsupportedOperationException("Producer not supported");
     }
 
-    /**
-     * @param proc
-     * @return a Consumer
-     * @throws Exception
-     * @see org.apache.camel.Endpoint#createConsumer(org.apache.camel.Processor)
-     */
     public Consumer<JMXExchange> createConsumer(Processor proc) throws Exception {
         ObjectName observedName = new ObjectName(observedObjectName);
         if (name == null) {
@@ -78,6 +67,7 @@
             type = type != null ? type : "UNKNOWN";
             name = mbeanServer.getDefaultDomain() + ":type=CounterMonitor_" + type;
         }
+
         JMXConsumer result = new JMXConsumer(this, proc);
         ourName = new ObjectName(name);
         counterMonitor.setNotify(true);
@@ -87,7 +77,12 @@
         counterMonitor.setDifferenceMode(false);
         counterMonitor.setInitThreshold(threshold);
         counterMonitor.setOffset(offset);
+
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Registering and adding notification listener for [" + counterMonitor
+ "] with name [" + ourName + "]");
+        }
         mbeanServer.registerMBean(counterMonitor, ourName);
+        // TODO: How do we remove the listener?
         mbeanServer.addNotificationListener(ourName, result, null, new Object());
         return result;
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXExchange.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXExchange.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/jmx/JMXExchange.java
Sat May 24 02:56:52 2008
@@ -24,18 +24,12 @@
 import org.apache.camel.impl.DefaultExchange;
 
 /**
- * A {@link Exchange} for a jmx notification
+ * A {@link Exchange} for JMX notification
  *
  * @version $Revision$
  */
 public class JMXExchange extends DefaultExchange {
 
-    /**
-     * Constructor
-     *
-     * @param camelContext
-     * @param pattern
-     */
     public JMXExchange(CamelContext camelContext, ExchangePattern pattern, Notification notification)
{
         super(camelContext, pattern);
         setIn(new JMXMessage(notification));

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListComponent.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListComponent.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListComponent.java
Sat May 24 02:56:52 2008
@@ -22,9 +22,12 @@
 import org.apache.camel.impl.DefaultComponent;
 
 /**
+ * The <a href="http://activemq.apache.org/camel/list.html">List</a> component.
+ *
  * @version $Revision$
  */
 public class ListComponent extends DefaultComponent {
+
     protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws
Exception {
         return new ListEndpoint(uri, this);
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/list/ListEndpoint.java
Sat May 24 02:56:52 2008
@@ -71,7 +71,6 @@
         return loadBalancer;
     }
 
-
     public void addPropertyChangeListener(PropertyChangeListener listener) {
         propertyChangeSupport.addPropertyChangeListener(listener);
     }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/log/LogComponent.java
Sat May 24 02:56:52 2008
@@ -49,6 +49,9 @@
         return new ProcessorEndpoint(uri, this, logger);
     }
 
+    /**
+     * Gets the logging level, will default to use INFO if no level parameter provided.
+     */
     protected LoggingLevel getLoggingLevel(Map parameters) {
         String levelText = getAndRemoveParameter(parameters, "level", String.class, "INFO");
         return LoggingLevel.valueOf(levelText.toUpperCase());

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/ListPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/ListPollingConsumer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/ListPollingConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/ListPollingConsumer.java
Sat May 24 02:56:52 2008
@@ -23,6 +23,7 @@
 import org.apache.camel.impl.PollingConsumerSupport;
 
 /**
+ * @deprecated not used - to be removed in due course
  * @version $Revision$
  */
 public class ListPollingConsumer extends PollingConsumerSupport {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/seda/SedaConsumer.java
Sat May 24 02:56:52 2008
@@ -29,6 +29,8 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
+ * A Consumer for the SEDA component.
+ *
  * @version $Revision$
  */
 public class SedaConsumer extends ServiceSupport implements Consumer, Runnable {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerConsumer.java
Sat May 24 02:56:52 2008
@@ -26,6 +26,8 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
+ * The timer consumer.
+ *
  * @version $Revision$
  */
 public class TimerConsumer extends DefaultConsumer<Exchange> {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultConsumer.java
Sat May 24 02:56:52 2008
@@ -29,6 +29,8 @@
 import org.apache.camel.util.ServiceHelper;
 
 /**
+ * A default consumer useful for implementation inheritance.
+ *
  * @version $Revision$
  */
 public class DefaultConsumer<E extends Exchange> extends ServiceSupport implements
Consumer<E> {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/TopicLoadBalancer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/TopicLoadBalancer.java?rev=659782&r1=659781&r2=659782&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/TopicLoadBalancer.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/loadbalancer/TopicLoadBalancer.java
Sat May 24 02:56:52 2008
@@ -28,6 +28,7 @@
  * @version $Revision$
  */
 public class TopicLoadBalancer extends LoadBalancerSupport {
+
     public void process(Exchange exchange) throws Exception {
         List<Processor> list = getProcessors();
         for (Processor processor : list) {



Mime
View raw message