Author: jmesnil
Date: 2009-12-09 13:01:48 -0500 (Wed, 09 Dec 2009)
New Revision: 8644
Modified:
trunk/src/main/org/hornetq/core/client/MessageHandler.java
trunk/src/main/org/hornetq/core/client/SessionFailureListener.java
trunk/src/main/org/hornetq/core/remoting/FailureListener.java
Log:
HORNETQ-186: fill in Javadocs for core API
Modified: trunk/src/main/org/hornetq/core/client/MessageHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/MessageHandler.java 2009-12-09 17:34:17 UTC
(rev 8643)
+++ trunk/src/main/org/hornetq/core/client/MessageHandler.java 2009-12-09 18:01:48 UTC
(rev 8644)
@@ -15,12 +15,21 @@
/**
*
- * A MessageHandler
+ * A MessageHandler is used to receive message <em>asynchronously</em>.
*
+ * To receive messages asynchronously, a MessageHandler is set on a ClientConsumer.
+ * Every time the consumer will receive a message, it will call the handler's {@code
onMessage()}�method.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
+ * @see ClientConsumer#setMessageHandler(MessageHandler)
*/
public interface MessageHandler
{
+ /**
+ * Notifies the MessageHandler that a message has been received.
+ *
+ * @param message a message
+ */
void onMessage(ClientMessage message);
}
Modified: trunk/src/main/org/hornetq/core/client/SessionFailureListener.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/SessionFailureListener.java 2009-12-09 17:34:17
UTC (rev 8643)
+++ trunk/src/main/org/hornetq/core/client/SessionFailureListener.java 2009-12-09 18:01:48
UTC (rev 8644)
@@ -17,13 +17,18 @@
import org.hornetq.core.remoting.FailureListener;
/**
- * A SessionFailureListener
+ * A SessionFailureListener notifies the client when a failure occured on the session.
*
- * @author Tim Fox
- *
- *
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
public interface SessionFailureListener extends FailureListener
{
+ /**
+ * Notifies that a connection has failed due to the specified exception.
+ * <br>
+ * This method is called <em>before the session attempts to
reconnect/failover</em>.
+ *
+ * @param exception exception which has caused the connection to fail
+ */
void beforeReconnect(HornetQException exception);
}
Modified: trunk/src/main/org/hornetq/core/remoting/FailureListener.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/FailureListener.java 2009-12-09 17:34:17 UTC
(rev 8643)
+++ trunk/src/main/org/hornetq/core/remoting/FailureListener.java 2009-12-09 18:01:48 UTC
(rev 8644)
@@ -17,7 +17,7 @@
/**
*
- * A FailureListener
+ * A FailureListener notifies the user when a connection failure occured.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
@@ -25,5 +25,10 @@
*/
public interface FailureListener
{
- void connectionFailed(HornetQException me);
+ /**
+ * Notifies that a connection has failed due to the specified exception.
+ *
+ * @param exception exception which has caused the connection to fail
+ */
+ void connectionFailed(HornetQException exception);
}
Show replies by date