JBoss hornetq SVN: r8637 - trunk/src/main/org/hornetq/core/client.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-12-09 06:48:23 -0500 (Wed, 09 Dec 2009)
New Revision: 8637
Modified:
trunk/src/main/org/hornetq/core/client/ClientProducer.java
Log:
ClientProducer javadocs
Modified: trunk/src/main/org/hornetq/core/client/ClientProducer.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientProducer.java 2009-12-09 11:22:17 UTC (rev 8636)
+++ trunk/src/main/org/hornetq/core/client/ClientProducer.java 2009-12-09 11:48:23 UTC (rev 8637)
@@ -18,22 +18,43 @@
import org.hornetq.utils.SimpleString;
/**
+ * A ClientProducer is ised to send messages to a specific address. Messages are then routed on the server to any queues
+ * that are bound to the address. A ClientProducer can either be created with a specific address in mind or with none.
+ * With the latter the address must be provided using the appropriate send() method. <br><br>
+ *
+ * The sending semantics can change depending on what blocking semantics are set via {@link ClientSessionFactory#setBlockOnDurableSend(boolean)}
+ * and {@link org.hornetq.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)} . If set to true
+ * then for each message type, durable and non durable respectively, any exceptions such as the address not existing or
+ * security exceptions will be thrown at the time of send. Alternatively if set to false then exceptions will only be
+ * logged on the server. <br><br>
+ *
+ * The send rate can also be controlled via {@link ClientSessionFactory#setProducerMaxRate(int)}
+ * and the {@link org.hornetq.core.client.ClientSessionFactory#setProducerWindowSize(int)}. <br><br>
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
*/
public interface ClientProducer
{
/**
- * Return the address where messages will be sent to.
- * The address can be <code>null</code> if the ClientProducer
- * was creating without specifying an address with {@link ClientSession#createProducer()}.
+ * Returns the address where messages will be sent.
+ *
+ * <br><br>The address can be <code>null</code> if the ClientProducer
+ *
+ * was creating without specifying an address, that is by using {@link ClientSession#createProducer()}.
*
* @return the address where messages will be sent
*/
SimpleString getAddress();
/**
- * Send a message.
+ * Sends a message to an address.
+ *
+ * specified in {@link ClientSession#createProducer(String)} or similar methods.
+ *
+ * <br><br>This will block until confirmation that the message has reached the server has been received if
+ * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
+ * are set to <code>true</code> for the specified message type.
*
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
@@ -41,8 +62,12 @@
void send(Message message) throws HornetQException;
/**
- * Send a message to the specified address instead of the ClientProducer's address.
- *
+ * Sends a message to the specified address instead of the ClientProducer's address.
+ *
+ * <br><br>This will block until confirmation that the message has reached the server has been received if
+ * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
+ * are set to true for the specified message type.
+ *
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
@@ -50,8 +75,12 @@
void send(SimpleString address, Message message) throws HornetQException;
/**
- * Send a message to the specified address instead of the ClientProducer's address.
- *
+ * Sends a message to the specified address instead of the ClientProducer's address.
+ *
+ * <br><br>This will block until confirmation that the message has reached the server has been received if
+ * {@link ClientSessionFactory#setBlockOnDurableSend(boolean)} or {@link org.hornetq.core.client.ClientSessionFactory#setBlockOnNonDurableSend(boolean)}
+ * are set to true for the specified message type.
+ *
* @param address the address where the message will be sent
* @param message the message to send
* @throws HornetQException if an exception occurs while sending the message
@@ -59,37 +88,37 @@
void send(String address, Message message) throws HornetQException;
/**
- * Close the ClientProducer.
+ * Closes the ClientProducer. If already closed nothing is done.
*
* @throws HornetQException if an exception occurs while closing the producer
*/
void close() throws HornetQException;
/**
- * Return whether the producer is closed or not.
+ * Returns whether the producer is closed or not.
*
* @return <code>true</code> if the producer is closed, <code>false</code> else
*/
boolean isClosed();
/**
- * Return whether the producer will block when sending <em>durable</em> messages.
+ * Returns whether the producer will block when sending <em>durable</em> messages.
*
* @return <code>true</code> if the producer blocks when sending durable, <code>false</code> else
*/
boolean isBlockOnDurableSend();
/**
- * Return whether the producer will block when sending <em>non-durable</em> messages.
+ * Returns whether the producer will block when sending <em>non-durable</em> messages.
*
* @return <code>true</code> if the producer blocks when sending non-durable, <code>false</code> else
*/
boolean isBlockOnNonDurableSend();
/**
- * Return the producer maximum rate.
+ * Returns the maximum rate at which a ClientProducer can send messages per second.
*
- * @return the producer maximum rate
+ * @return the producers maximum rate
*/
int getMaxRate();
}
15 years, 1 month
JBoss hornetq SVN: r8636 - trunk/src/main/org/hornetq/core/client.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 06:22:17 -0500 (Wed, 09 Dec 2009)
New Revision: 8636
Modified:
trunk/src/main/org/hornetq/core/client/ClientMessage.java
Log:
HORNETQ-186: fill in Javadocs for core API
* documented ClientMessage API
Modified: trunk/src/main/org/hornetq/core/client/ClientMessage.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientMessage.java 2009-12-09 11:00:04 UTC (rev 8635)
+++ trunk/src/main/org/hornetq/core/client/ClientMessage.java 2009-12-09 11:22:17 UTC (rev 8636)
@@ -21,7 +21,7 @@
/**
*
- * A ClientMessage
+ * A ClientMessage represents a message sent and/or received by HornetQ.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
@@ -29,31 +29,80 @@
*/
public interface ClientMessage extends Message
{
+ /**
+ * Returns the number of times this message was delivered.
+ */
int getDeliveryCount();
+ /**
+ * Set the delivery count for this message.
+ *
+ * This method is not meant to be called by HornetQ clients.
+ *
+ * @param deliveryCount message delivery count
+ */
void setDeliveryCount(int deliveryCount);
+ /**
+ * Acknowledge reception of this message.
+ *
+ * If the session responsible to acknowledge this message has {@code autoCommitAcks}
+ * set to {@code true}, the transaction will automatically commit the current transaction.
+ * Otherwise, this acknwoledgement will not be committed until the client commits the session transaction.
+ *
+ * @throws HornetQException if an error occured while acknowledging the message.
+ *
+ * @see ClientSession#isAutoCommitAcks()
+ */
void acknowledge() throws HornetQException;
+ /**
+ * Return the size (in bytes) of this message's body
+ */
int getBodySize();
- // FIXME - these are only used for large messages - they should be moved elsewhere
-
- /** Sets the OutputStream that will receive the content of a message received in a non blocking way
- * @throws HornetQException */
+ /**
+ * Sets the OutputStream that will receive the content of a message received in a non blocking way.
+ *
+ * This method is used for large message and is not meant to be called directly by HornetQ clients.
+ *
+ * @deprecated
+ * @throws HornetQException
+ */
void setOutputStream(OutputStream out) throws HornetQException;
- /** Save the content of the message to the OutputStream. It will block until the entire content is transfered to the OutputStream. */
+ /**
+ * Saves the content of the message to the OutputStream.
+ * It will block until the entire content is transfered to the OutputStream.
+ *
+ * This method is used for large message and is not meant to be called directly by HornetQ clients.
+ *
+ * @deprecated
+ * @throws HornetQException
+ */
void saveToOutputStream(OutputStream out) throws HornetQException;
/**
* Wait the outputStream completion of the message.
+ *
+ * This method is used for large message and is not meant to be called directly by HornetQ clients.
+ *
* @param timeMilliseconds - 0 means wait forever
* @return true if it reached the end
* @throws HornetQException
+
+ * @deprecated
*/
boolean waitOutputStreamCompletion(long timeMilliseconds) throws HornetQException;
+ /**
+ * Sets the body's IntputStream.
+ *
+ * This method is used for large message and is not meant to be called directly by HornetQ clients.
+ *
+ * @deprecated
+ * @throws HornetQException
+ */
void setBodyInputStream(InputStream bodyInputStream);
}
15 years, 1 month
JBoss hornetq SVN: r8635 - trunk/src/main/org/hornetq/core/buffers.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 06:00:04 -0500 (Wed, 09 Dec 2009)
New Revision: 8635
Modified:
trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java
Log:
HORNETQ-186: fill in Javadocs for core API
* documented HornetQBuffer API (pasting doc from netty's awesome javadoc)
Modified: trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java 2009-12-09 10:26:01 UTC (rev 8634)
+++ trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java 2009-12-09 11:00:04 UTC (rev 8635)
@@ -38,193 +38,1050 @@
*/
ChannelBuffer channelBuffer();
+ /**
+ * Returns the number of bytes this buffer can contain.
+ */
int capacity();
+ /**
+ * Returns the {@code readerIndex} of this buffer.
+ */
int readerIndex();
+ /**
+ * Sets the {@code readerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code readerIndex} is
+ * less than {@code 0} or
+ * greater than {@code this.writerIndex}
+ */
void readerIndex(int readerIndex);
+ /**
+ * Returns the {@code writerIndex} of this buffer.
+ */
int writerIndex();
+ /**
+ * Sets the {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code writerIndex} is
+ * less than {@code this.readerIndex} or
+ * greater than {@code this.capacity}
+ */
void writerIndex(int writerIndex);
+ /**
+ * Sets the {@code readerIndex} and {@code writerIndex} of this buffer
+ * in one shot. This method is useful when you have to worry about the
+ * invocation order of {@link #readerIndex(int)} and {@link #writerIndex(int)}
+ * methods. For example, the following code will fail:
+ *
+ * <pre>
+ * // Create a buffer whose readerIndex, writerIndex and capacity are
+ * // 0, 0 and 8 respectively.
+ * ChannelBuffer buf = ChannelBuffers.buffer(8);
+ *
+ * // IndexOutOfBoundsException is thrown because the specified
+ * // readerIndex (2) cannot be greater than the current writerIndex (0).
+ * buf.readerIndex(2);
+ * buf.writerIndex(4);
+ * </pre>
+ *
+ * The following code will also fail:
+ *
+ * <pre>
+ * // Create a buffer whose readerIndex, writerIndex and capacity are
+ * // 0, 8 and 8 respectively.
+ * ChannelBuffer buf = ChannelBuffers.wrappedBuffer(new byte[8]);
+ *
+ * // readerIndex becomes 8.
+ * buf.readLong();
+ *
+ * // IndexOutOfBoundsException is thrown because the specified
+ * // writerIndex (4) cannot be less than the current readerIndex (8).
+ * buf.writerIndex(4);
+ * buf.readerIndex(2);
+ * </pre>
+ *
+ * By contrast, {@link #setIndex(int, int)} guarantees that it never
+ * throws an {@link IndexOutOfBoundsException} as long as the specified
+ * indexes meet basic constraints, regardless what the current index
+ * values of the buffer are:
+ *
+ * <pre>
+ * // No matter what the current state of the buffer is, the following
+ * // call always succeeds as long as the capacity of the buffer is not
+ * // less than 4.
+ * buf.setIndex(2, 4);
+ * </pre>
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code readerIndex} is less than 0,
+ * if the specified {@code writerIndex} is less than the specified
+ * {@code readerIndex} or if the specified {@code writerIndex} is
+ * greater than {@code this.capacity}
+ */
void setIndex(int readerIndex, int writerIndex);
+ /**
+ * Returns the number of readable bytes which is equal to
+ * {@code (this.writerIndex - this.readerIndex)}.
+ */
int readableBytes();
+ /**
+ * Returns the number of writable bytes which is equal to
+ * {@code (this.capacity - this.writerIndex)}.
+ */
int writableBytes();
+ /**
+ * Returns {@code true}
+ * if and only if {@code (this.writerIndex - this.readerIndex)} is greater
+ * than {@code 0}.
+ */
boolean readable();
+ /**
+ * Returns {@code true}
+ * if and only if {@code (this.capacity - this.writerIndex)} is greater
+ * than {@code 0}.
+ */
boolean writable();
+ /**
+ * Sets the {@code readerIndex} and {@code writerIndex} of this buffer to
+ * {@code 0}.
+ * This method is identical to {@link #setIndex(int, int) setIndex(0, 0)}.
+ * <p>
+ * Please note that the behavior of this method is different
+ * from that of NIO buffer, which sets the {@code limit} to
+ * the {@code capacity} of the buffer.
+ */
void clear();
+ /**
+ * Marks the current {@code readerIndex} in this buffer. You can
+ * reposition the current {@code readerIndex} to the marked
+ * {@code readerIndex} by calling {@link #resetReaderIndex()}.
+ * The initial value of the marked {@code readerIndex} is {@code 0}.
+ */
void markReaderIndex();
+ /**
+ * Repositions the current {@code readerIndex} to the marked
+ * {@code readerIndex} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the current {@code writerIndex} is less than the marked
+ * {@code readerIndex}
+ */
void resetReaderIndex();
+ /**
+ * Marks the current {@code writerIndex} in this buffer. You can
+ * reposition the current {@code writerIndex} to the marked
+ * {@code writerIndex} by calling {@link #resetWriterIndex()}.
+ * The initial value of the marked {@code writerIndex} is {@code 0}.
+ */
void markWriterIndex();
+ /**
+ * Repositions the current {@code writerIndex} to the marked
+ * {@code writerIndex} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the current {@code readerIndex} is greater than the marked
+ * {@code writerIndex}
+ */
void resetWriterIndex();
+ /**
+ * Discards the bytes between the 0th index and {@code readerIndex}.
+ * It moves the bytes between {@code readerIndex} and {@code writerIndex}
+ * to the 0th index, and sets {@code readerIndex} and {@code writerIndex}
+ * to {@code 0} and {@code oldWriterIndex - oldReaderIndex} respectively.
+ * <p>
+ * Please refer to the class documentation for more detailed explanation.
+ */
void discardReadBytes();
- byte getByte(int index);
+ /**
+ * Gets a byte at the specified absolute {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
+ byte getByte(int index);
+ /**
+ * Gets an unsigned byte at the specified absolute {@code index} in this
+ * buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
short getUnsignedByte(int index);
+ /**
+ * Gets a 16-bit short integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
short getShort(int index);
+ /**
+ * Gets an unsigned 16-bit short integer at the specified absolute
+ * {@code index} in this buffer. This method does not modify
+ * {@code readerIndex} or {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
int getUnsignedShort(int index);
- int getInt(int index);
+ /**
+ * Gets a 32-bit integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ int getInt(int index);
- long getUnsignedInt(int index);
+ /**
+ * Gets an unsigned 32-bit integer at the specified absolute {@code index}
+ * in this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
+ long getUnsignedInt(int index);
- long getLong(int index);
+ /**
+ * Gets a 64-bit long integer at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
+ long getLong(int index);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index} until the destination becomes
+ * non-writable. This method is basically same with
+ * {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code writerIndex} of the destination by the
+ * number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.writableBytes} is greater than
+ * {@code this.capacity}
+ */
void getBytes(int index, HornetQBuffer dst);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}. This method is basically same
+ * with {@link #getBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code writerIndex} of the destination by the
+ * number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code length} is greater than {@code dst.writableBytes}
+ */
void getBytes(int index, HornetQBuffer dst, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of both the source (i.e. {@code this}) and the destination.
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.capacity}
+ */
void getBytes(int index, HornetQBuffer dst, int dstIndex, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.length} is greater than
+ * {@code this.capacity}
+ */
void getBytes(int index, byte[] dst);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of this buffer.
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.length}
+ */
void getBytes(int index, byte[] dst, int dstIndex, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the specified absolute {@code index} until the destination's position
+ * reaches its limit.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer while the destination's {@code position} will be increased.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + dst.remaining()} is greater than
+ * {@code this.capacity}
+ */
void getBytes(int index, ByteBuffer dst);
+ /**
+ * Gets a char at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
char getChar(int index);
+ /**
+ * Gets a float at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
float getFloat(int index);
+ /**
+ * Gets a double at the specified absolute {@code index} in
+ * this buffer. This method does not modify {@code readerIndex} or
+ * {@code writerIndex} of this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
double getDouble(int index);
+ /**
+ * Sets the specified byte at the specified absolute {@code index} in this
+ * buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 1} is greater than {@code this.capacity}
+ */
void setByte(int index, byte value);
+ /**
+ * Sets the specified 16-bit short integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
void setShort(int index, short value);
+ /**
+ * Sets the specified 32-bit integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
void setInt(int index, int value);
+ /**
+ * Sets the specified 64-bit long integer at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
void setLong(int index, long value);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index} until the destination becomes
+ * unreadable. This method is basically same with
+ * {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code readerIndex} of the source buffer by
+ * the number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.readableBytes} is greater than
+ * {@code this.capacity}
+ */
void setBytes(int index, HornetQBuffer src);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index}. This method is basically same
+ * with {@link #setBytes(int, HornetQBuffer, int, int)}, except that this
+ * method increases the {@code readerIndex} of the source buffer by
+ * the number of the transferred bytes while
+ * {@link #getBytes(int, HornetQBuffer, int, int)} does not.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * the source buffer (i.e. {@code this}).
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code length} is greater than {@code src.readableBytes}
+ */
void setBytes(int index, HornetQBuffer src, int length);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex}
+ * of both the source (i.e. {@code this}) and the destination.
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code srcIndex + length} is greater than
+ * {@code src.capacity}
+ */
void setBytes(int index, HornetQBuffer src, int srcIndex, int length);
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.length} is greater than
+ * {@code this.capacity}
+ */
void setBytes(int index, byte[] src);
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the specified absolute {@code index}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0},
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code index + length} is greater than
+ * {@code this.capacity}, or
+ * if {@code srcIndex + length} is greater than {@code src.length}
+ */
void setBytes(int index, byte[] src, int srcIndex, int length);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the specified absolute {@code index} until the source buffer's position
+ * reaches its limit.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * if {@code index + src.remaining()} is greater than
+ * {@code this.capacity}
+ */
void setBytes(int index, ByteBuffer src);
+ /**
+ * Sets the specified char at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 2} is greater than {@code this.capacity}
+ */
void setChar(int index, char value);
+ /**
+ * Sets the specified float at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 4} is greater than {@code this.capacity}
+ */
void setFloat(int index, float value);
+ /**
+ * Sets the specified double at the specified absolute
+ * {@code index} in this buffer.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code index} is less than {@code 0} or
+ * {@code index + 8} is greater than {@code this.capacity}
+ */
void setDouble(int index, double value);
+ /**
+ * Gets a byte at the current {@code readerIndex} and increases
+ * the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
byte readByte();
+ /**
+ * Gets an unsigned byte at the current {@code readerIndex} and increases
+ * the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
short readUnsignedByte();
+ /**
+ * Gets a 16-bit short integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
short readShort();
- int readUnsignedShort();
+ /**
+ * Gets an unsigned 16-bit short integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
+ int readUnsignedShort();
- int readInt();
+ /**
+ * Gets a 32-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
+ int readInt();
- long readUnsignedInt();
+ /**
+ * Gets an unsigned 32-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
+ long readUnsignedInt();
- long readLong();
+ /**
+ * Gets a 64-bit integer at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 8}
+ */
+ long readLong();
+ /**
+ * Gets a char at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 2}
+ */
char readChar();
+ /**
+ * Gets a float at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 4}
+ */
float readFloat();
+ /**
+ * Gets a double at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 8}
+ */
double readDouble();
+ /**
+ * Gets a boolean at the current {@code readerIndex}
+ * and increases the {@code readerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.readableBytes} is less than {@code 1}
+ */
+ boolean readBoolean();
+
+ /**
+ * Gets a SimpleString (potentially {@code null}) at the current {@code readerIndex}
+ */
+ SimpleString readNullableSimpleString();
+
+ /**
+ * Gets a String (potentially {@code null}) at the current {@code readerIndex}
+ */
+ String readNullableString();
+
+ /**
+ * Gets a non-null SimpleString at the current {@code readerIndex}
+ */
+ SimpleString readSimpleString();
+
+ /**
+ * Gets a non-null String at the current {@code readerIndex}
+ */
+ String readString();
+
+ /**
+ * Gets a UTF-8 String at the current {@code readerIndex}
+ */
+ String readUTF();
+
+ /**
+ * Transfers this buffer's data to a newly created buffer starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ * The returned buffer's {@code readerIndex} and {@code writerIndex} are
+ * {@code 0} and {@code length} respectively.
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @return the newly created buffer which contains the transferred bytes
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
HornetQBuffer readBytes(int length);
+ /**
+ * Returns a new slice of this buffer's sub-region starting at the current
+ * {@code readerIndex} and increases the {@code readerIndex} by the size
+ * of the new slice (= {@code length}).
+ *
+ * @param length the size of the new slice
+ *
+ * @return the newly created slice
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
HornetQBuffer readSlice(int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} until the destination becomes
+ * non-writable, and increases the {@code readerIndex} by the number of the
+ * transferred bytes. This method is basically same with
+ * {@link #readBytes(HornetQBuffer, int, int)}, except that this method
+ * increases the {@code writerIndex} of the destination by the number of
+ * the transferred bytes while {@link #readBytes(HornetQBuffer, int, int)}
+ * does not.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.writableBytes} is greater than
+ * {@code this.readableBytes}
+ */
void readBytes(HornetQBuffer dst);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}). This method
+ * is basically same with {@link #readBytes(HornetQBuffer, int, int)},
+ * except that this method increases the {@code writerIndex} of the
+ * destination by the number of the transferred bytes (= {@code length})
+ * while {@link #readBytes(HornetQBuffer, int, int)} does not.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes} or
+ * if {@code length} is greater than {@code dst.writableBytes}
+ */
void readBytes(HornetQBuffer dst, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code length} is greater than {@code this.readableBytes}, or
+ * if {@code dstIndex + length} is greater than
+ * {@code dst.capacity}
+ */
void readBytes(HornetQBuffer dst, int dstIndex, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code dst.length}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.length} is greater than {@code this.readableBytes}
+ */
void readBytes(byte[] dst);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} and increases the {@code readerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param dstIndex the first index of the destination
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code dstIndex} is less than {@code 0},
+ * if {@code length} is greater than {@code this.readableBytes}, or
+ * if {@code dstIndex + length} is greater than {@code dst.length}
+ */
void readBytes(byte[] dst, int dstIndex, int length);
+ /**
+ * Transfers this buffer's data to the specified destination starting at
+ * the current {@code readerIndex} until the destination's position
+ * reaches its limit, and increases the {@code readerIndex} by the
+ * number of the transferred bytes.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code dst.remaining()} is greater than
+ * {@code this.readableBytes}
+ */
void readBytes(ByteBuffer dst);
+ /**
+ * Increases the current {@code readerIndex} by the specified
+ * {@code length} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.readableBytes}
+ */
void skipBytes(int length);
- void writeByte(byte value);
+ /**
+ * Sets the specified byte at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 1} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 1}
+ */
+ void writeByte(byte value);
+ /**
+ * Sets the specified 16-bit short integer at the current
+ * {@code writerIndex} and increases the {@code writerIndex} by {@code 2}
+ * in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 2}
+ */
void writeShort(short value);
- void writeInt(int value);
+ /**
+ * Sets the specified 32-bit integer at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 4}
+ */
+ void writeInt(int value);
- void writeLong(long value);
+ /**
+ * Sets the specified 64-bit long integer at the current
+ * {@code writerIndex} and increases the {@code writerIndex} by {@code 8}
+ * in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 8}
+ */
+ void writeLong(long value);
+ /**
+ * Sets the specified char at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 2} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 2}
+ */
void writeChar(char chr);
+ /**
+ * Sets the specified float at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 4} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 4}
+ */
void writeFloat(float value);
+ /**
+ * Sets the specified double at the current {@code writerIndex}
+ * and increases the {@code writerIndex} by {@code 8} in this buffer.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code this.writableBytes} is less than {@code 8}
+ */
void writeDouble(double value);
+ /**
+ * Sets the specified boolean at the current {@code writerIndex}
+ */
+ void writeBoolean(boolean val);
+
+ /**
+ * Sets the specified SimpleString (potentially {@code null}) at the current {@code writerIndex}
+ */
+ void writeNullableSimpleString(SimpleString val);
+
+ /**
+ * Sets the specified String (potentially {@code null}) at the current {@code writerIndex}
+ */
+ void writeNullableString(String val);
+
+ /**
+ * Sets the specified non-null SimpleString at the current {@code writerIndex}
+ */
+ void writeSimpleString(SimpleString val);
+
+ /**
+ * Sets the specified non-null String at the current {@code writerIndex}
+ */
+ void writeString(String val);
+
+ /**
+ * Sets the specified UTF-8 String at the current {@code writerIndex}
+ */
+
+ void writeUTF(String utf);
+
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}). This method
+ * is basically same with {@link #writeBytes(HornetQBuffer, int, int)},
+ * except that this method increases the {@code readerIndex} of the source
+ * buffer by the number of the transferred bytes (= {@code length}) while
+ * {@link #writeBytes(HornetQBuffer, int, int)} does not.
+ *
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code length} is greater than {@code this.writableBytes} or
+ * if {@code length} is greater then {@code src.readableBytes}
+ */
void writeBytes(HornetQBuffer src, int length);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code srcIndex + length} is greater than
+ * {@code src.capacity}, or
+ * if {@code length} is greater than {@code this.writableBytes}
+ */
void writeBytes(HornetQBuffer src, int srcIndex, int length);
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code src.length}).
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code src.length} is greater than {@code this.writableBytes}
+ */
void writeBytes(byte[] src);
+ /**
+ * Transfers the specified source array's data to this buffer starting at
+ * the current {@code writerIndex} and increases the {@code writerIndex}
+ * by the number of the transferred bytes (= {@code length}).
+ *
+ * @param srcIndex the first index of the source
+ * @param length the number of bytes to transfer
+ *
+ * @throws IndexOutOfBoundsException
+ * if the specified {@code srcIndex} is less than {@code 0},
+ * if {@code srcIndex + length} is greater than
+ * {@code src.length}, or
+ * if {@code length} is greater than {@code this.writableBytes}
+ */
void writeBytes(byte[] src, int srcIndex, int length);
+ /**
+ * Transfers the specified source buffer's data to this buffer starting at
+ * the current {@code writerIndex} until the source buffer's position
+ * reaches its limit, and increases the {@code writerIndex} by the
+ * number of the transferred bytes.
+ *
+ * @throws IndexOutOfBoundsException
+ * if {@code src.remaining()} is greater than
+ * {@code this.writableBytes}
+ */
void writeBytes(ByteBuffer src);
+ /**
+ * Returns a copy of this buffer's readable bytes. Modifying the content
+ * of the returned buffer or this buffer does not affect each other at all.
+ * This method is identical to {@code buf.copy(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ *
+ */
HornetQBuffer copy();
+ /**
+ * Returns a copy of this buffer's sub-region. Modifying the content of
+ * the returned buffer or this buffer does not affect each other at all.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
HornetQBuffer copy(int index, int length);
+ /**
+ * Returns a slice of this buffer's readable bytes. Modifying the content
+ * of the returned buffer or this buffer affects each other's content
+ * while they maintain separate indexes and marks. This method is
+ * identical to {@code buf.slice(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
HornetQBuffer slice();
+ /**
+ * Returns a slice of this buffer's sub-region. Modifying the content of
+ * the returned buffer or this buffer affects each other's content while
+ * they maintain separate indexes and marks.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
HornetQBuffer slice(int index, int length);
+ /**
+ * Returns a buffer which shares the whole region of this buffer.
+ * Modifying the content of the returned buffer or this buffer affects
+ * each other's content while they maintain separate indexes and marks.
+ * This method is identical to {@code buf.slice(0, buf.capacity())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
HornetQBuffer duplicate();
+ /**
+ * Converts this buffer's readable bytes into a NIO buffer. The returned
+ * buffer might or might not share the content with this buffer, while
+ * they have separate indexes and marks. This method is identical to
+ * {@code buf.toByteBuffer(buf.readerIndex(), buf.readableBytes())}.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
ByteBuffer toByteBuffer();
+ /**
+ * Converts this buffer's sub-region into a NIO buffer. The returned
+ * buffer might or might not share the content with this buffer, while
+ * they have separate indexes and marks.
+ * This method does not modify {@code readerIndex} or {@code writerIndex} of
+ * this buffer.
+ */
ByteBuffer toByteBuffer(int index, int length);
-
- boolean readBoolean();
-
- SimpleString readNullableSimpleString();
-
- String readNullableString();
-
- SimpleString readSimpleString();
-
- String readString();
-
- String readUTF();
-
- void writeBoolean(boolean val);
-
- void writeNullableSimpleString(SimpleString val);
-
- void writeNullableString(String val);
-
- void writeSimpleString(SimpleString val);
-
- void writeString(String val);
-
- void writeUTF(String utf);
}
15 years, 1 month
JBoss hornetq SVN: r8634 - trunk/src/main/org/hornetq/core/journal/impl.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-12-09 05:26:01 -0500 (Wed, 09 Dec 2009)
New Revision: 8634
Modified:
trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-241
Modified: trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-12-09 10:24:09 UTC (rev 8633)
+++ trunk/src/main/org/hornetq/core/journal/impl/TimedBuffer.java 2009-12-09 10:26:01 UTC (rev 8634)
@@ -115,7 +115,7 @@
callbacks = new ArrayList<IOAsyncTask>();
- this.timeout = timeout;
+ this.timeout = timeout;
}
public synchronized void start()
@@ -137,6 +137,15 @@
logRatesTimer.scheduleAtFixedRate(logRatesTimerTask, 2000, 2000);
}
+
+ //Need to start with the spin limiter acquired
+ try
+ {
+ spinLimiter.acquire();
+ }
+ catch (InterruptedException ignore)
+ {
+ }
started = true;
}
@@ -240,13 +249,6 @@
{
delayFlush = false;
- if (buffer.writerIndex() == 0)
- {
- // More bytes have been added so the timer flush thread can resume
-
- spinLimiter.release();
- }
-
bytes.encode(buffer);
callbacks.add(callback);
@@ -263,6 +265,13 @@
//
// flush();
// }
+
+ if (buffer.writerIndex() == 0)
+ {
+ // More bytes have been added so the timer flush thread can resume
+
+ spinLimiter.release();
+ }
}
}
15 years, 1 month
JBoss hornetq SVN: r8633 - in trunk/src/main/org/hornetq/core: client and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 05:24:09 -0500 (Wed, 09 Dec 2009)
New Revision: 8633
Modified:
trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java
trunk/src/main/org/hornetq/core/buffers/HornetQBuffers.java
trunk/src/main/org/hornetq/core/client/ClientConsumer.java
trunk/src/main/org/hornetq/core/client/ClientRequestor.java
trunk/src/main/org/hornetq/core/client/ClientSession.java
trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java
Log:
HORNETQ-186: fill in Javadocs for core API
* fixed javadoc tense
Modified: trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/buffers/HornetQBuffer.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -32,7 +32,7 @@
public interface HornetQBuffer
{
/**
- * Return the underlying Netty's ChannelBuffer
+ * Returns the underlying Netty's ChannelBuffer
*
* @return the underlying Netty's ChannelBuffer
*/
Modified: trunk/src/main/org/hornetq/core/buffers/HornetQBuffers.java
===================================================================
--- trunk/src/main/org/hornetq/core/buffers/HornetQBuffers.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/buffers/HornetQBuffers.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -27,7 +27,7 @@
public class HornetQBuffers
{
/**
- * Create a <em>self-expanding</em> HornetQBuffer with the given initial size
+ * Creates a <em>self-expanding</em> HornetQBuffer with the given initial size
*
* @param size the initial size of the created HornetQBuffer
* @return a self-expanding HornetQBuffer starting with the given size
@@ -38,7 +38,7 @@
}
/**
- * Create a <em>self-expanding</em> HornetQBuffer filled with the given byte array
+ * Creates a <em>self-expanding</em> HornetQBuffer filled with the given byte array
*
* @param bytes the created buffer will be initially filled with this byte array
* @return a self-expanding HornetQBuffer filled with the given byte array
@@ -53,7 +53,7 @@
}
/**
- * Create a HornetQBuffer wrapping the underlying NIO ByteBuffer
+ * Creates a HornetQBuffer wrapping the underlying NIO ByteBuffer
*
* The position on this buffer won't affect the position on the inner buffer
*
@@ -70,7 +70,7 @@
}
/**
- * Create a HornetQBuffer wrapping the underlying byte array
+ * Creates a HornetQBuffer wrapping the underlying byte array
*
* @param underlying the underlying byte array
* @return a HornetQBuffer wrapping the underlying byte array
@@ -81,7 +81,7 @@
}
/**
- * Create a <em>fixed</em> HornetQBuffer of the given size
+ * Creates a <em>fixed</em> HornetQBuffer of the given size
*
* @param size the size of the created HornetQBuffer
* @return a fixed HornetQBuffer with the given size
Modified: trunk/src/main/org/hornetq/core/client/ClientConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientConsumer.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/client/ClientConsumer.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -79,7 +79,7 @@
ClientMessage receiveImmediate() throws HornetQException;
/**
- * Return the MessageHandler associated to this consumer.
+ * Returns the MessageHandler associated to this consumer.
*
* Calling this method on a closed consumer will throw a HornetQException.
*
@@ -90,7 +90,7 @@
MessageHandler getMessageHandler() throws HornetQException;
/**
- * Set the MessageHandler for this consumer to consume messages asynchronously.
+ * Sets the MessageHandler for this consumer to consume messages asynchronously.
*
* Calling this method on a closed consumer will throw a HornetQException.
*
@@ -100,7 +100,7 @@
void setMessageHandler(MessageHandler handler) throws HornetQException;
/**
- * Close the consumer.
+ * Closes the consumer.
*
* Once this consumer is closed, it can not receive messages, whether synchronously or asynchronously.
*
@@ -109,14 +109,14 @@
void close() throws HornetQException;
/**
- * Return whether the consumer is closed or not.
+ * Returns whether the consumer is closed or not.
*
* @return <code>true</code> if this consumer is closed, <code>false</code> else
*/
boolean isClosed();
/**
- * Return the last exception thrown by a call to this consumer's MessageHandler
+ * Returns the last exception thrown by a call to this consumer's MessageHandler.
*
* @return the last exception thrown by a call to this consumer's MessageHandler or <code>null</code>
*/
Modified: trunk/src/main/org/hornetq/core/client/ClientRequestor.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientRequestor.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/client/ClientRequestor.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -67,7 +67,7 @@
}
/**
- * Send a message to the request address and wait indefinitely for a reply.
+ * Sends a message to the request address and wait indefinitely for a reply.
* The temporary queue is used for the REPLYTO_HEADER_NAME, and only one reply per request is expected
*
* @param request the message to send
@@ -80,7 +80,7 @@
}
/**
- * Send a message to the request address and wait for the given timeout for a reply.
+ * Sends a message to the request address and wait for the given timeout for a reply.
* The temporary queue is used for the REPLYTO_HEADER_NAME, and only one reply per request is expected
*
* @param request the message to send
@@ -96,7 +96,7 @@
}
/**
- * Close the ClientRequestor and its session.
+ * Closes the ClientRequestor and its session.
*
* @throws Exception if an exception occurs while closing the ClientRequestor
*/
Modified: trunk/src/main/org/hornetq/core/client/ClientSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientSession.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/client/ClientSession.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -39,14 +39,14 @@
public interface BindingQuery
{
/**
- * Return <code>true</code> if the binding exists, <code>false</code> else.
+ * Returns <code>true</code> if the binding exists, <code>false</code> else.
*
* @return <code>true</code> if the binding exists, <code>false</code> else
*/
boolean isExists();
/**
- * Return the names of the queues bound to the binding.
+ * Returns the names of the queues bound to the binding.
*
* @return the names of the queues bound to the binding
*/
@@ -61,42 +61,42 @@
public interface QueueQuery
{
/**
- * Return <code>true</code> if the queue exists, <code>false</code> else.
+ * Returns <code>true</code> if the queue exists, <code>false</code> else.
*
* @return <code>true</code> if the queue exists, <code>false</code> else
*/
boolean isExists();
/**
- * Return <code>true</code> if the queue is durable, <code>false</code> else.
+ * Returns <code>true</code> if the queue is durable, <code>false</code> else.
*
* @return <code>true</code> if the queue is durable, <code>false</code> else
*/
boolean isDurable();
/**
- * Return the number of consumers attached to the queue.
+ * Returns the number of consumers attached to the queue.
*
* @return the number of consumers attached to the queue
*/
int getConsumerCount();
/**
- * Return the number of messages in the queue.
+ * Returns the number of messages in the queue.
*
* @return the number of messages in the queue
*/
int getMessageCount();
/**
- * Return the queue's filter string (or <code>null</code> if the queue has no filter).
+ * Returns the queue's filter string (or <code>null</code> if the queue has no filter).
*
* @return the queue's filter string (or <code>null</code> if the queue has no filter)
*/
SimpleString getFilterString();
/**
- * Return the address that the queue is bound to.
+ * Returns the address that the queue is bound to.
*
* @return the address that the queue is bound to
*/
@@ -106,7 +106,7 @@
// Lifecycle operations ------------------------------------------
/**
- * Start the session.
+ * Starts the session.
* The session must be started before ClientConsumers created by the session can consume messages from the queue.
*
* @throws HornetQException if an exception occurs while starting the session
@@ -114,7 +114,7 @@
void start() throws HornetQException;
/**
- * Stop the session.
+ * Stops the session.
* ClientConsumers created by the session can not consume messages when the session is stopped.
*
* @throws HornetQException if an exception occurs while stopping the session
@@ -122,28 +122,28 @@
void stop() throws HornetQException;
/**
- * Close the session.
+ * Closes the session.
*
* @throws HornetQException if an exception occurs while closing the session
*/
void close() throws HornetQException;
/**
- * Indicate if the session is closed or not.
+ * Returns whether the session is closed or not.
*
* @return <code>true</code> if the session is closed, <code>false</code> else
*/
boolean isClosed();
/**
- * Add a FailureListener to the session which is notified if a failure occurs on the session.
+ * Adds a FailureListener to the session which is notified if a failure occurs on the session.
*
* @param listener the listener to add
*/
void addFailureListener(SessionFailureListener listener);
/**
- * Remove a FailureListener to the session.
+ * Removes a FailureListener to the session.
*
* @param listener the listener to remove
* @return <code>true</code> if the listener was removed, <code>false</code> else
@@ -160,7 +160,7 @@
// Queue Operations ----------------------------------------------
/**
- * Create a <em>non-temporary</em> queue.
+ * Creates a <em>non-temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -170,7 +170,7 @@
void createQueue(SimpleString address, SimpleString queueName, boolean durable) throws HornetQException;
/**
- * Create a <em>non-temporary</em> queue.
+ * Creates a <em>non-temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -180,7 +180,7 @@
void createQueue(String address, String queueName, boolean durable) throws HornetQException;
/**
- * Create a <em>non-temporary</em> queue <em>non-durable</em> queue.
+ * Creates a <em>non-temporary</em> queue <em>non-durable</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -189,7 +189,7 @@
void createQueue(String address, String queueName) throws HornetQException;
/**
- * Create a <em>non-temporary</em> queue.
+ * Creates a <em>non-temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -200,7 +200,7 @@
void createQueue(SimpleString address, SimpleString queueName, SimpleString filter, boolean durable) throws HornetQException;
/**
- * Create a <em>non-temporary</em>queue.
+ * Creates a <em>non-temporary</em>queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -211,7 +211,7 @@
void createQueue(String address, String queueName, String filter, boolean durable) throws HornetQException;
/**
- * Create a <em>temporary</em> queue.
+ * Creates a <em>temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -220,7 +220,7 @@
void createTemporaryQueue(SimpleString address, SimpleString queueName) throws HornetQException;
/**
- * Create a <em>temporary</em> queue.
+ * Creates a <em>temporary</em> queue.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -229,7 +229,7 @@
void createTemporaryQueue(String address, String queueName) throws HornetQException;
/**
- * Create a <em>temporary</em> queue with a filter.
+ * Creates a <em>temporary</em> queue with a filter.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -239,7 +239,7 @@
void createTemporaryQueue(SimpleString address, SimpleString queueName, SimpleString filter) throws HornetQException;
/**
- * Create a <em>temporary</em> queue with a filter.
+ * Creates a <em>temporary</em> queue with a filter.
*
* @param address the queue will be bound to this address
* @param queueName the name of the queue
@@ -249,7 +249,7 @@
void createTemporaryQueue(String address, String queueName, String filter) throws HornetQException;
/**
- * Delete the queue.
+ * Deletes the queue.
*
* @param queueName the name of the queue to delete
* @throws HornetQException if there is no queue for the given name or if the queue has consumers
@@ -257,7 +257,7 @@
void deleteQueue(SimpleString queueName) throws HornetQException;
/**
- * Delete the queue.
+ * Deletes the queue.
*
* @param queueName the name of the queue to delete
* @throws HornetQException if there is no queue for the given name or if the queue has consumers
@@ -267,7 +267,7 @@
// Consumer Operations -------------------------------------------
/**
- * Create a ClientConsumer to consume message from the queue with the given name.
+ * Creates a ClientConsumer to consume message from the queue with the given name.
*
* @param queueName name of the queue to consume messages from
* @return a ClientConsumer
@@ -276,7 +276,7 @@
ClientConsumer createConsumer(SimpleString queueName) throws HornetQException;
/**
- * Create a ClientConsumer to consume messages from the queue with the given name.
+ * Creates a ClientConsumer to consume messages from the queue with the given name.
*
* @param queueName name of the queue to consume messages from
* @return a ClientConsumer
@@ -285,7 +285,7 @@
ClientConsumer createConsumer(String queueName) throws HornetQException;
/**
- * Create a ClientConsumer to consume messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
*
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
@@ -295,7 +295,7 @@
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter) throws HornetQException;
/**
- * Create a ClientConsumer to consume messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume messages matching the filter from the queue with the given name.
*
* @param queueName name of the queue to consume messages from
* @param filter only messages which match this filter will be consumed
@@ -305,7 +305,7 @@
ClientConsumer createConsumer(String queueName, String filter) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -319,7 +319,7 @@
ClientConsumer createConsumer(SimpleString queueName, boolean browseOnly) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -333,7 +333,7 @@
ClientConsumer createConsumer(String queueName, boolean browseOnly) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -348,7 +348,7 @@
ClientConsumer createConsumer(String queueName, String filter, boolean browseOnly) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -363,7 +363,7 @@
ClientConsumer createConsumer(SimpleString queueName, SimpleString filter, boolean browseOnly) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -384,7 +384,7 @@
boolean browseOnly) throws HornetQException;
/**
- * Create a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
+ * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with the given name.
* If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages from the queue
* but they will not be consumed (the messages will remain in the queue).
* If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume the messages from the queue and
@@ -403,7 +403,7 @@
// Producer Operations -------------------------------------------
/**
- * Create a producer with no default address.
+ * Creates a producer with no default address.
* Address must be specified every time a message is sent
*
* @return a ClientProducer
@@ -413,7 +413,7 @@
ClientProducer createProducer() throws HornetQException;
/**
- * Create a produce which sends messages to the given address
+ * Creates a producer which sends messages to the given address
*
* @param address the address to send messages to
* @return a ClientProducer
@@ -422,7 +422,7 @@
ClientProducer createProducer(SimpleString address) throws HornetQException;
/**
- * Create a produce which sends messages to the given address
+ * Creates a producer which sends messages to the given address
*
* @param address the address to send messages to
* @return a ClientProducer
@@ -431,7 +431,7 @@
ClientProducer createProducer(String address) throws HornetQException;
/**
- * Create a produce which sends messages to the given address
+ * Creates a producer which sends messages to the given address
*
* @param address the address to send messages to
* @param rate the producer rate
@@ -443,7 +443,7 @@
// Message operations --------------------------------------------
/**
- * Create a ClientMessage.
+ * Creates a ClientMessage.
*
* @param durable whether the created message is durable or not
* @return a ClientMessage
@@ -451,7 +451,7 @@
ClientMessage createMessage(boolean durable);
/**
- * Create a ClientMessage.
+ * Creates a ClientMessage.
*
* @param type type of the message
* @param durable whether the created message is durable or not
@@ -460,7 +460,7 @@
ClientMessage createMessage(byte type, boolean durable);
/**
- * Create a ClientMessage with the given HornetQBuffer as its body.
+ * Creates a ClientMessage.
*
* @param durable whether the created message is durable or not
* @param expiration the message expiration
@@ -473,7 +473,7 @@
// Query operations ----------------------------------------------
/**
- * Query information on a queue.
+ * Queries information on a queue.
*
* @param queueName the name of the queue to query
* @return a QueueQuery containing information on the given queue
@@ -483,7 +483,7 @@
QueueQuery queueQuery(SimpleString queueName) throws HornetQException;
/**
- * Query information on a binding.
+ * Queries information on a binding.
*
* @param address the address of the biding to query
* @return a BindingQuery containing information on the binding attached to the given address
@@ -509,21 +509,21 @@
boolean isXA();
/**
- * Commit the current transaction.
+ * Commits the current transaction.
*
* @throws HornetQException if an exception occurs while committing the transaction
*/
void commit() throws HornetQException;
/**
- * Rollback the current transaction.
+ * Rolls back the current transaction.
*
* @throws HornetQException if an exception occurs while rolling back the transaction
*/
void rollback() throws HornetQException;
/**
- * Rollback the current transaction.
+ * Rolls back the current transaction.
*
* @param considerLastMessageAsDelivered the first message on deliveringMessage Buffer is considered as delivered
*
@@ -532,14 +532,14 @@
void rollback(boolean considerLastMessageAsDelivered) throws HornetQException;
/**
- * Return <code>true</code> if the current transaction has been flagged to rollback, <code>false</code> else.
+ * Returns <code>true</code> if the current transaction has been flagged to rollback, <code>false</code> else.
*
* @return <code>true</code> if the current transaction has been flagged to rollback, <code>false</code> else.
*/
boolean isRollbackOnly();
/**
- * Return whether the session will <em>automatically</em> commit its transaction every time a message is sent
+ * Returns whether the session will <em>automatically</em> commit its transaction every time a message is sent
* by a ClientProducer created by this session, <code>false</code> else
*
* @return <code>true</code> if the session <em>automatically</em> commit its transaction every time a message is sent, <code>false</code> else
@@ -547,7 +547,7 @@
boolean isAutoCommitSends();
/**
- * Return whether the session will <em>automatically</em> commit its transaction every time a message is acknowledged
+ * Returns whether the session will <em>automatically</em> commit its transaction every time a message is acknowledged
* by a ClientConsumer created by this session, <code>false</code> else
*
* @return <code>true</code> if the session <em>automatically</em> commit its transaction every time a message is acknowledged, <code>false</code> else
@@ -555,14 +555,14 @@
boolean isAutoCommitAcks();
/**
- * Return whether the ClientConsumer created by the session will <em>block</em> when they acknowledge a message.
+ * Returns whether the ClientConsumer created by the session will <em>block</em> when they acknowledge a message.
*
* @return <code>true</code> if the session's ClientConsumer block when they acknowledge a message, <code>false</code> else
*/
boolean isBlockOnAcknowledge();
/**
- * Set a <code>SendAcknowledgementHandler</code> for this session.
+ * Sets a <code>SendAcknowledgementHandler</code> for this session.
*
* @param handler a SendAcknowledgementHandler
*/
Modified: trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java 2009-12-09 10:13:02 UTC (rev 8632)
+++ trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java 2009-12-09 10:24:09 UTC (rev 8633)
@@ -17,7 +17,6 @@
import org.hornetq.core.config.TransportConfiguration;
import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.message.impl.MessageImpl;
import org.hornetq.core.remoting.Interceptor;
import org.hornetq.utils.Pair;
@@ -32,7 +31,7 @@
public interface ClientSessionFactory
{
/**
- * Create a session with XA transaction semantics.
+ * Creates a session with XA transaction semantics.
*
* @return a ClientSession with XA transaction semantics
*
@@ -41,7 +40,7 @@
ClientSession createXASession() throws HornetQException;
/**
- * Create a <em>transacted</em> session.
+ * Creates a <em>transacted</em> session.
*
* It is up to the client to commit when sending and acknowledging messages.
@@ -54,7 +53,7 @@
/**
- * Create a <em>non-transacted</em> session.
+ * Creates a <em>non-transacted</em> session.
*
* Message sends and acknowledgments are automatically committed by the session. <em>This does not
* mean that messages are automatically acknowledged</em>, only that when messages are acknowledged,
@@ -66,7 +65,7 @@
ClientSession createSession() throws HornetQException;
/**
- * Create a session.
+ * Creates a session.
*
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
@@ -76,7 +75,7 @@
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException;
/**
- * Create a session.
+ * Creates a session.
*
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
@@ -87,9 +86,9 @@
ClientSession createSession(boolean autoCommitSends, boolean autoCommitAcks, int ackBatchSize) throws HornetQException;
/**
- * Create a session.
+ * Creates a session.
*
- * @param xa wether the session support XA transaction semantic or not
+ * @param xa whether the session support XA transaction semantic or not
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @return a ClientSession
@@ -98,13 +97,13 @@
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks) throws HornetQException;
/**
- * Create a session.
+ * Creates a session.
*
* It is possible to <em>pre-acknowledge messages on the server</em> so that the client can avoid additional network trip
* to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages
* can be lost after being pre-acknowledged on the server). Use with caution if your application design permits it.
*
- * @param xa wether the session support XA transaction semantic or not
+ * @param xa whether the session support XA transaction semantic or not
* @param autoCommitSends <code>true</code> to automatically commit message sends, <code>false</code> to commit manually
* @param autoCommitAcks <code>true</code> to automatically commit message acknowledgement, <code>false</code> to commit manually
* @param preAcknowledge <code>true</code> to pre-acknowledge messages on the server, <code>false</code> to let the client acknowledge the messages
@@ -114,7 +113,7 @@
ClientSession createSession(boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws HornetQException;
/**
- * Create an <em>authenticated</em> session.
+ * Creates an <em>authenticated</em> session.
*
* It is possible to <em>pre-acknowledge messages on the server</em> so that the client can avoid additional network trip
* to the server to acknowledge messages. While this increase performance, this does not guarantee delivery (as messages
@@ -138,7 +137,7 @@
int ackBatchSize) throws HornetQException;
/**
- * Return the list of <em>live - backup</em> connectors pairs configured
+ * Returns the list of <em>live - backup</em> connectors pairs configured
* that sessions created by this factory will use to connect
* to HornetQ servers or <code>null</code> if the factory is using discovery group.
*
@@ -150,7 +149,7 @@
List<Pair<TransportConfiguration, TransportConfiguration>> getStaticConnectors();
/**
- * Set the static list of live - backup connectors pairs that sessions created by this factory will use to connect
+ * Sets the static list of live - backup connectors pairs that sessions created by this factory will use to connect
* to HornetQ servers.
*
* The backup configuration (returned by {@link Pair#b}) can be <code>null</code> if there is no
@@ -161,7 +160,7 @@
void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors);
/**
- * Return the period used to check if a client has failed to receive pings from the server.
+ * Returns the period used to check if a client has failed to receive pings from the server.
*
* Period is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}.
*
@@ -170,7 +169,7 @@
long getClientFailureCheckPeriod();
/**
- * Set the period (in milliseconds) used to check if a client has failed to receive pings from the server.
+ * Sets the period (in milliseconds) used to check if a client has failed to receive pings from the server.
*
* Value must be -1 (to disable) or greater than 0.
*
@@ -190,14 +189,14 @@
boolean isCacheLargeMessagesClient();
/**
- * Set wether large messages received by consumers created through this factory will be cached in temporary files or not.
+ * Sets whether large messages received by consumers created through this factory will be cached in temporary files or not.
*
* @param cached <code>true</code> to cache large messages in temporary files, <code>false</code> else
*/
void setCacheLargeMessagesClient(boolean cached);
/**
- * Return the connection <em>time-to-live</em>.
+ * Returns the connection <em>time-to-live</em>.
* This TTL determines how long the server will keep a connection alive in the absence of any data arriving from the client.
*
* Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CONNECTION_TTL}.
@@ -207,7 +206,7 @@
long getConnectionTTL();
/**
- * Set this factory's connections <em>time-to-live</em>.
+ * Sets this factory's connections <em>time-to-live</em>.
*
* Value must be -1 (to disable) or greater or equals to 0.
*
@@ -226,7 +225,7 @@
long getCallTimeout();
/**
- * Set the blocking call timeout.
+ * Sets the blocking call timeout.
*
* Value must be greater or equals to 0
*
@@ -235,7 +234,7 @@
void setCallTimeout(long callTimeout);
/**
- * Return the large message size threshold.
+ * Returns the large message size threshold.
*
* Messages whose size is if greater than this value will be handled as <em>large messages</em>.
*
@@ -246,7 +245,7 @@
int getMinLargeMessageSize();
/**
- * Set the large message size threshold.
+ * Sets the large message size threshold.
*
* Value must be greater than 0.
*
@@ -255,7 +254,7 @@
void setMinLargeMessageSize(int minLargeMessageSize);
/**
- * Return the window size for flow control of the consumers created through this factory.
+ * Returns the window size for flow control of the consumers created through this factory.
*
* Value is in bytes, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CONSUMER_WINDOW_SIZE}.
*
@@ -264,7 +263,7 @@
int getConsumerWindowSize();
/**
- * Set the window size for flow control of the consumers created through this factory.
+ * Sets the window size for flow control of the consumers created through this factory.
*
* Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 (to set the maximum size of the buffer)
*
@@ -273,7 +272,7 @@
void setConsumerWindowSize(int consumerWindowSize);
/**
- * Return the maximum rate of message consumption for consumers created through this factory.
+ * Returns the maximum rate of message consumption for consumers created through this factory.
*
* This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified.
*
@@ -285,7 +284,7 @@
int getConsumerMaxRate();
/**
- * Set the maximum rate of message consumption for consumers created through this factory.
+ * Sets the maximum rate of message consumption for consumers created through this factory.
*
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
*
@@ -294,7 +293,7 @@
void setConsumerMaxRate(int consumerMaxRate);
/**
- * Return the size for the confirmation window of clients using this factory.
+ * Returns the size for the confirmation window of clients using this factory.
*
* Value is in bytes or -1 (to disable the window). Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CONFIRMATION_WINDOW_SIZE}.
*
@@ -303,7 +302,7 @@
int getConfirmationWindowSize();
/**
- * Set the size for the confirmation window buffer of clients using this factory.
+ * Sets the size for the confirmation window buffer of clients using this factory.
*
* Value must be -1 (to disable the window) or greater than 0.
@@ -312,7 +311,7 @@
void setConfirmationWindowSize(int confirmationWindowSize);
/**
- * Return the window size for flow control of the producers created through this factory.
+ * Returns the window size for flow control of the producers created through this factory.
*
* Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection).
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_PRODUCER_WINDOW_SIZE}.
@@ -322,7 +321,7 @@
int getProducerWindowSize();
/**
- * Return the window size for flow control of the producers created through this factory.
+ * Returns the window size for flow control of the producers created through this factory.
*
* Value must be -1 (to disable flow control) or greater than 0.
*
@@ -331,7 +330,7 @@
void setProducerWindowSize(int producerWindowSize);
/**
- * Return the maximum rate of message production for producers created through this factory.
+ * Returns the maximum rate of message production for producers created through this factory.
*
* This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified.
*
@@ -343,7 +342,7 @@
int getProducerMaxRate();
/**
- * Set the maximum rate of message production for producers created through this factory.
+ * Sets the maximum rate of message production for producers created through this factory.
*
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
*
@@ -352,7 +351,7 @@
void setProducerMaxRate(int producerMaxRate);
/**
- * Return whether consumers created through this factory will block while sending message acknowledgements or do it asynchronously.
+ * Returns whether consumers created through this factory will block while sending message acknowledgements or do it asynchronously.
*
* If the consumer are configured to send message acknowledgement asynchronously, you can set a SendAcknowledgementHandler on the ClientSession
* to be notified once the acknowledgement has been handled by the server.
@@ -364,14 +363,14 @@
boolean isBlockOnAcknowledge();
/**
- * Set whether consumers created through this factory will block while sending message acknowledgements or do it asynchronously.
+ * Sets whether consumers created through this factory will block while sending message acknowledgements or do it asynchronously.
*
* @param blockOnAcknowledge <code>true</code> to block when sending message acknowledgements or <code>false</code> to send them asynchronously
*/
void setBlockOnAcknowledge(boolean blockOnAcknowledge);
/**
- * Return whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
+ * Returns whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_BLOCK_ON_DURABLE_SEND}.
*
@@ -380,14 +379,14 @@
boolean isBlockOnDurableSend();
/**
- * Set whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
+ * Sets whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
*
* @param blockOnDurableSend <code>true</code> to block when sending durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnDurableSend(boolean blockOnDurableSend);
/**
- * Return whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
+ * Returns whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}.
*
@@ -396,14 +395,14 @@
boolean isBlockOnNonDurableSend();
/**
- * Set whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
+ * Sets whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
*
* @param blockOnNonDurableSend <code>true</code> to block when sending non-durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnNonDurableSend(boolean blockOnNonDurableSend);
/**
- * Return whether producers created through this factory will automatically
+ * Returns whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
*
* if <code>true</code>, a random unique group ID is created and set on each message for the property
@@ -415,7 +414,7 @@
boolean isAutoGroup();
/**
- * Set whether producers created through this factory will automatically
+ * Sets whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
*
* @param autoGroup <code>true</code> to automatically assign a group ID to each messages sent through this factory, <code>false</code> else
@@ -423,7 +422,7 @@
void setAutoGroup(boolean autoGroup);
/**
- * Return the group ID that will be eventually set on each message for the property {@link org.hornetq.core.message.impl.MessageImpl#HDR_GROUP_ID}.
+ * Returns the group ID that will be eventually set on each message for the property {@link org.hornetq.core.message.impl.MessageImpl#HDR_GROUP_ID}.
*
* Default value is is <code>null</code> and no group ID will be set on the messages.
*
@@ -432,21 +431,21 @@
String getGroupID();
/**
- * Set the group ID that will be set on each message sent through this factory.
+ * Sets the group ID that will be set on each message sent through this factory.
*
* @param groupID the group ID to use
*/
void setGroupID(String groupID);
/**
- * Return whether messages will pre-acknowledged on the server before they are sent to the consumers or not.
+ * Returns whether messages will pre-acknowledged on the server before they are sent to the consumers or not.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_PRE_ACKNOWLEDGE}
*/
boolean isPreAcknowledge();
/**
- * Set to <code>true</code> to pre-acknowledge consumed messages on the server before they are sent to consumers, else set to <code>false</code> to let
+ * Sets to <code>true</code> to pre-acknowledge consumed messages on the server before they are sent to consumers, else set to <code>false</code> to let
* clients acknowledge the message they consume.
*
* @param preAcknowledge <code>true</code> to enable pre-acknowledgement, <code>false</code> else
@@ -454,25 +453,25 @@
void setPreAcknowledge(boolean preAcknowledge);
/**
- * Return the acknowledgements batch size.
+ * Returns the acknowledgements batch size.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_ACK_BATCH_SIZE}.
*
- * @return acknowledgements batch size
+ * @return the acknowledgements batch size
*/
int getAckBatchSize();
/**
- * Return the acknowledgements batch size.
+ * Sets the acknowledgements batch size.
*
* Value must be greater than 0.
*
- * @param ackBatchSize the acknowledgements batch size
+ * @param ackBatchSize acknowledgements batch size
*/
void setAckBatchSize(int ackBatchSize);
/**
- * Return the address to listen to discover which connectors this factory can use.
+ * Returns the address to listen to discover which connectors this factory can use.
* The discovery address must be set to enable this factory to discover HornetQ servers.
*
* @return the address to listen to discover which connectors this factory can use
@@ -480,14 +479,14 @@
String getDiscoveryAddress();
/**
- * Set the address to listen to discover which connectors this factory can use.
+ * Sets the address to listen to discover which connectors this factory can use.
*
- * @param discoveryAddress the address to listen to discover which connectors this factory can use
+ * @param discoveryAddress address to listen to discover which connectors this factory can use
*/
void setDiscoveryAddress(String discoveryAddress);
/**
- * Return the port to listen to discover which connectors this factory can use.
+ * Returns the port to listen to discover which connectors this factory can use.
* The discovery port must be set to enable this factory to discover HornetQ servers.
*
* @return the port to listen to discover which connectors this factory can use
@@ -496,14 +495,14 @@
/**
- * Set the port to listen to discover which connectors this factory can use.
+ * Sets the port to listen to discover which connectors this factory can use.
*
- * @param discoveryPort the port to listen to discover which connectors this factory can use
+ * @param discoveryPort port to listen to discover which connectors this factory can use
*/
void setDiscoveryPort(int discoveryPort);
/**
- * Return the refresh timeout for discovered HornetQ servers.
+ * Returns the refresh timeout for discovered HornetQ servers.
*
* If this factory uses discovery to find HornetQ servers, the list of discovered servers
* will be refreshed according to this timeout.
@@ -515,7 +514,7 @@
long getDiscoveryRefreshTimeout();
/**
- * Set the refresh timeout for discovered HornetQ servers.
+ * Sets the refresh timeout for discovered HornetQ servers.
*
* Value must be greater than 0.
*
@@ -524,7 +523,7 @@
void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout);
/**
- * Return the initial wait timeout if this factory is configured to use discovery.
+ * Returns the initial wait timeout if this factory is configured to use discovery.
*
* Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT}.
*
@@ -533,7 +532,7 @@
long getDiscoveryInitialWaitTimeout();
/**
- * Set the initial wait timeout if this factory is configured to use discovery.
+ * Sets the initial wait timeout if this factory is configured to use discovery.
*
* Value is in milliseconds and must be greater than 0.
*
@@ -542,7 +541,7 @@
void setDiscoveryInitialWaitTimeout(long initialWaitTimeout);
/**
- * Return whether this factory will use global thread pools (shared among all the factories in the same JVM)
+ * Returns whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_USE_GLOBAL_POOLS}.
@@ -552,7 +551,7 @@
boolean isUseGlobalPools();
/**
- * Set whether this factory will use global thread pools (shared among all the factories in the same JVM)
+ * Sets whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
*
* @param useGlobalPools <code>true</code> to let this factory uses global thread pools, <code>false</code> else
@@ -560,16 +559,16 @@
void setUseGlobalPools(boolean useGlobalPools);
/**
- * Return the maximum size of the scheduled thread pool.
+ * Returns the maximum size of the scheduled thread pool.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
*
- * @return maximum size of the scheduled thread pool.
+ * @return the maximum size of the scheduled thread pool.
*/
int getScheduledThreadPoolMaxSize();
/**
- * Set the maximum size of the scheduled thread pool.
+ * Sets the maximum size of the scheduled thread pool.
*
* This setting is relevant only if this factory does not use global pools.
* Value must be greater than 0.
@@ -579,16 +578,16 @@
void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
/**
- * Return the maximum size of the thread pool.
+ * Returns the maximum size of the thread pool.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_THREAD_POOL_MAX_SIZE}.
*
- * @return maximum size of the thread pool.
+ * @return the maximum size of the thread pool.
*/
int getThreadPoolMaxSize();
/**
- * Set the maximum size of the thread pool.
+ * Sets the maximum size of the thread pool.
*
* This setting is relevant only if this factory does not use global pools.
* Value must be -1 (for unlimited thread pool) or greater than 0.
@@ -598,7 +597,7 @@
void setThreadPoolMaxSize(int threadPoolMaxSize);
/**
- * Return the time to retry connections created by this factory after failure.
+ * Returns the time to retry connections created by this factory after failure.
*
* Value is in milliseconds, default is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RETRY_INTERVAL}.
*
@@ -607,7 +606,7 @@
long getRetryInterval();
/**
- * Set the time to retry connections created by this factory after failure.
+ * Sets the time to retry connections created by this factory after failure.
*
* Value must be greater than 0.
*
@@ -616,7 +615,7 @@
void setRetryInterval(long retryInterval);
/**
- * Return the multiplier to apply to successive retry intervals.
+ * Returns the multiplier to apply to successive retry intervals.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
*
@@ -625,7 +624,7 @@
double getRetryIntervalMultiplier();
/**
- * Set the multiplier to apply to successive retry intervals.
+ * Sets the multiplier to apply to successive retry intervals.
*
* Value must be positive.
*
@@ -634,7 +633,7 @@
void setRetryIntervalMultiplier(double retryIntervalMultiplier);
/**
- * Return the maximum retry interval (in the case a retry interval multiplier has been specified).
+ * Returns the maximum retry interval (in the case a retry interval multiplier has been specified).
*
* Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_MAX_RETRY_INTERVAL}.
*
@@ -643,7 +642,7 @@
long getMaxRetryInterval();
/**
- * Set the maximum retry interval.
+ * Sets the maximum retry interval.
*
* Value must be greater than 0.
*
@@ -652,7 +651,7 @@
void setMaxRetryInterval(long maxRetryInterval);
/**
- * Return the maximum number of attempts to retry connection in case of failure.
+ * Returns the maximum number of attempts to retry connection in case of failure.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RECONNECT_ATTEMPTS}.
*
@@ -661,7 +660,7 @@
int getReconnectAttempts();
/**
- * Set the maximum number of attempts to retry connection in case of failure.
+ * Sets the maximum number of attempts to retry connection in case of failure.
*
* Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
*
@@ -670,7 +669,7 @@
void setReconnectAttempts(int reconnectAttempts);
/**
- * Return whether connections created by this factory must failover in case the server they are
+ * Returns whether connections created by this factory must failover in case the server they are
* connected to <em>has normally shut down</em>.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN}.
@@ -680,7 +679,7 @@
boolean isFailoverOnServerShutdown();
/**
- * Set whether connections created by this factory must failover in case the server they are
+ * Sets whether connections created by this factory must failover in case the server they are
* connected to <em>has normally shut down</em>
*
* @param failoverOnServerShutdown <code>true</code> if connections must failover if the server has normally shut down, <code>false</code> else
@@ -688,7 +687,7 @@
void setFailoverOnServerShutdown(boolean failoverOnServerShutdown);
/**
- * Return the class name of the connection load balancing policy.
+ * Returns the class name of the connection load balancing policy.
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME}.
*
@@ -697,7 +696,7 @@
String getConnectionLoadBalancingPolicyClassName();
/**
- * Set the class name of the connection load balancing policy.
+ * Sets the class name of the connection load balancing policy.
*
* Value must be the name of a class implementing {@link ConnectionLoadBalancingPolicy}.
*
@@ -706,7 +705,7 @@
void setConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName);
/**
- * Return the initial size of messages created through this factory.
+ * Returns the initial size of messages created through this factory.
*
* Value is in bytes, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
*
@@ -715,7 +714,7 @@
int getInitialMessagePacketSize();
/**
- * Set the initial size of messages created through this factory.
+ * Sets the initial size of messages created through this factory.
*
* Value must be greater than 0.
*
@@ -724,14 +723,14 @@
void setInitialMessagePacketSize(int size);
/**
- * Add an interceptor which will be executed <em>after packets are received from the server</em>.
+ * Adds an interceptor which will be executed <em>after packets are received from the server</em>.
*
* @param interceptor an Interceptor
*/
void addInterceptor(Interceptor interceptor);
/**
- * Remove an interceptor.
+ * Removes an interceptor.
*
* @param interceptor interceptor to remove
*
@@ -740,7 +739,7 @@
boolean removeInterceptor(Interceptor interceptor);
/**
- * Close this factory and release all its resources
+ * Closes this factory and release all its resources
*/
void close();
15 years, 1 month
JBoss hornetq SVN: r8632 - trunk/src/main/org/hornetq/core/exception.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 05:13:02 -0500 (Wed, 09 Dec 2009)
New Revision: 8632
Modified:
trunk/src/main/org/hornetq/core/exception/HornetQException.java
Log:
HORNETQ-186: fill in Javadocs for core API
* documented HornetQException API
Modified: trunk/src/main/org/hornetq/core/exception/HornetQException.java
===================================================================
--- trunk/src/main/org/hornetq/core/exception/HornetQException.java 2009-12-09 09:52:12 UTC (rev 8631)
+++ trunk/src/main/org/hornetq/core/exception/HornetQException.java 2009-12-09 10:13:02 UTC (rev 8632)
@@ -15,7 +15,7 @@
/**
*
- * A HornetQException
+ * HornetQException is the root exception for HornetQ API.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
@@ -26,66 +26,159 @@
// Error codes -------------------------------------------------
+ /**
+ * Internal error which prevented HornetQ to perform.
+ */
public static final int INTERNAL_ERROR = 000;
+ /**
+ * A packet of unsupported type was received by HornetQ PacketHandler.
+ */
public static final int UNSUPPORTED_PACKET = 001;
+ /**
+ * A client is not able to connect to HornetQ server.
+ */
public static final int NOT_CONNECTED = 002;
+ /**
+ * A client timed out will connecting to HornetQ server.
+ */
public static final int CONNECTION_TIMEDOUT = 003;
+ /**
+ * A client was disconnected from HornetQ server when the server has shut down.
+ */
public static final int DISCONNECTED = 004;
+ /**
+ * A blocking call from a client was unblocked during failover.
+ */
public static final int UNBLOCKED = 005;
+ /**
+ * Unexpected I/O error occured on the server.
+ */
public static final int IO_ERROR = 006;
+ /**
+ * An operation failed because a queue does not exist on the server.
+ */
public static final int QUEUE_DOES_NOT_EXIST = 100;
+ /**
+ * An operation failed because a queue exists on the server.
+ */
public static final int QUEUE_EXISTS = 101;
+ /**
+ * A client operation failed because the calling resource
+ * (ClientSession, ClientProducer, etc.) is closed.
+ */
public static final int OBJECT_CLOSED = 102;
+ /**
+ * An filter expression has not been validated
+ */
public static final int INVALID_FILTER_EXPRESSION = 103;
+ /**
+ * A HornetQ resource is not in a legal state (e.g. calling
+ * ClientConsumer.receive() if a MessageHandler is set)
+ */
public static final int ILLEGAL_STATE = 104;
+ /**
+ * A security problem occured (authentication issues, permission issues,...)
+ */
public static final int SECURITY_EXCEPTION = 105;
+ /**
+ * An operation failed because an address does not exist on the server.
+ */
public static final int ADDRESS_DOES_NOT_EXIST = 106;
+ /**
+ * An operation failed because an address exists on the server.
+ */
public static final int ADDRESS_EXISTS = 107;
+ /**
+ * A incompatibility between HornetQ versions on the client and the server has been detected
+ */
public static final int INCOMPATIBLE_CLIENT_SERVER_VERSIONS = 108;
+ /**
+ * An operation failed because a session exists on the server.
+ */
public static final int SESSION_EXISTS = 109;
+ /**
+ * An problem occurred while manipulating the body of a large message.
+ */
public static final int LARGE_MESSAGE_ERROR_BODY = 110;
+ /**
+ * A transaction was rolled back.
+ */
public static final int TRANSACTION_ROLLED_BACK = 111;
+ /**
+ * The creation of a session was rejected by the server (e.g. if the
+ * server is starting and has not finish to be initialized)
+ */
public static final int SESSION_CREATION_REJECTED = 112;
// Native Error codes ----------------------------------------------
+ /**
+ * A internal error occured in the AIO native code
+ */
public static final int NATIVE_ERROR_INTERNAL = 200;
+ /**
+ * A buffer is invalid in the AIO native code
+ */
public static final int NATIVE_ERROR_INVALID_BUFFER = 201;
+ /**
+ * Alignment error in the AIO native code
+ */
public static final int NATIVE_ERROR_NOT_ALIGNED = 202;
+ /**
+ * AIO has not been properly initialized
+ */
public static final int NATIVE_ERROR_CANT_INITIALIZE_AIO = 203;
+ /**
+ * AIO has not been properly released
+ */
public static final int NATIVE_ERROR_CANT_RELEASE_AIO = 204;
+ /**
+ * A closed file has not be properly reopened
+ */
public static final int NATIVE_ERROR_CANT_OPEN_CLOSE_FILE = 205;
+ /**
+ * An error occured while allocating a queue in AIO native code
+ */
public static final int NATIVE_ERROR_CANT_ALLOCATE_QUEUE = 206;
+ /**
+ * An error occured while pre-allocating a file in AIO native code
+ */
public static final int NATIVE_ERROR_PREALLOCATE_FILE = 208;
+ /**
+ * An error occurred while allocating memory in the AIO native code
+ */
public static final int NATIVE_ERROR_ALLOCATE_MEMORY = 209;
+ /**
+ * AIO is full
+ */
public static final int NATIVE_ERROR_AIO_FULL = 211;
private int code;
15 years, 1 month
JBoss hornetq SVN: r8631 - in trunk: src/main/org/hornetq/core/remoting and 2 other directories.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-12-09 04:52:12 -0500 (Wed, 09 Dec 2009)
New Revision: 8631
Modified:
trunk/examples/core/perf/src/org/hornetq/core/example/PerfBase.java
trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java
trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
trunk/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java
trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
Log:
added flush of confirmations on timer
Modified: trunk/examples/core/perf/src/org/hornetq/core/example/PerfBase.java
===================================================================
--- trunk/examples/core/perf/src/org/hornetq/core/example/PerfBase.java 2009-12-09 09:27:14 UTC (rev 8630)
+++ trunk/examples/core/perf/src/org/hornetq/core/example/PerfBase.java 2009-12-09 09:52:12 UTC (rev 8631)
@@ -437,14 +437,13 @@
{
session.commit();
}
-
+
+ session.close();
+
if (useSendAcks)
{
- // Must close the session first since this flushes the confirmations
- session.close();
-
theLatch.await();
- }
+ }
}
finally
{
Modified: trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java 2009-12-09 09:27:14 UTC (rev 8630)
+++ trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java 2009-12-09 09:52:12 UTC (rev 8631)
@@ -75,4 +75,6 @@
boolean checkDataReceived();
void removeAllChannels();
+
+ void flushConfirmations();
}
Modified: trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-12-09 09:27:14 UTC (rev 8630)
+++ trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-12-09 09:52:12 UTC (rev 8631)
@@ -364,10 +364,11 @@
{
return connection;
}
-
- public void flushConfirmations()
+
+ //Needs to be synchronized since can be called by remoting service timer thread too for timeout flush
+ public synchronized void flushConfirmations()
{
- if (receivedBytes != 0)
+ if (resendCache != null && receivedBytes != 0)
{
receivedBytes = 0;
Modified: trunk/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java 2009-12-09 09:27:14 UTC (rev 8630)
+++ trunk/src/main/org/hornetq/core/remoting/impl/RemotingConnectionImpl.java 2009-12-09 09:52:12 UTC (rev 8631)
@@ -334,6 +334,17 @@
channels.clear();
}
}
+
+ public void flushConfirmations()
+ {
+ synchronized (transferLock)
+ {
+ for (Channel channel: channels.values())
+ {
+ channel.flushConfirmations();
+ }
+ }
+ }
// Buffer Handler implementation
// ----------------------------------------------------
Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2009-12-09 09:27:14 UTC (rev 8630)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2009-12-09 09:52:12 UTC (rev 8631)
@@ -88,7 +88,7 @@
private final ScheduledExecutorService scheduledThreadPool;
- private FailureCheckThread failureCheckThread;
+ private FailureCheckAndFlushThread failureCheckAndFlushThread;
// Static --------------------------------------------------------
@@ -184,9 +184,10 @@
a.start();
}
- failureCheckThread = new FailureCheckThread(RemotingServiceImpl.CONNECTION_TTL_CHECK_INTERVAL);
+ //This thread checks connections that need to be closed, and also flushes confirmations
+ failureCheckAndFlushThread = new FailureCheckAndFlushThread(RemotingServiceImpl.CONNECTION_TTL_CHECK_INTERVAL);
- failureCheckThread.start();
+ failureCheckAndFlushThread.start();
started = true;
}
@@ -220,7 +221,7 @@
return;
}
- failureCheckThread.close();
+ failureCheckAndFlushThread.close();
// We need to stop them accepting first so no new connections are accepted after we send the disconnect message
for (Acceptor acceptor : acceptors)
@@ -451,13 +452,13 @@
}
}
- private final class FailureCheckThread extends Thread
+ private final class FailureCheckAndFlushThread extends Thread
{
private final long pauseInterval;
private volatile boolean closed;
- FailureCheckThread(final long pauseInterval)
+ FailureCheckAndFlushThread(final long pauseInterval)
{
super("hornetq-failure-check-thread");
@@ -493,15 +494,19 @@
for (ConnectionEntry entry : connections.values())
{
+ RemotingConnection conn = entry.connection;
+
+ boolean flush = true;
+
if (entry.ttl != -1)
{
if (now >= entry.lastCheck + entry.ttl)
{
- RemotingConnection conn = entry.connection;
-
if (!conn.checkDataReceived())
{
idsToRemove.add(conn.getID());
+
+ flush = false;
}
else
{
@@ -509,6 +514,14 @@
}
}
}
+
+ if (flush)
+ {
+ //We flush any confirmations on the connection - this prevents idle bridges for example
+ //sitting there with many unacked messages
+
+ conn.flushConfirmations();
+ }
}
for (Object id : idsToRemove)
15 years, 1 month
JBoss hornetq SVN: r8630 - trunk/src/main/org/hornetq/core/client.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 04:27:14 -0500 (Wed, 09 Dec 2009)
New Revision: 8630
Modified:
trunk/src/main/org/hornetq/core/client/ClientConsumer.java
Log:
HORNETQ-186: fill in Javadocs for core API
* documented ClientConsumer API
Modified: trunk/src/main/org/hornetq/core/client/ClientConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientConsumer.java 2009-12-09 08:57:28 UTC (rev 8629)
+++ trunk/src/main/org/hornetq/core/client/ClientConsumer.java 2009-12-09 09:27:14 UTC (rev 8630)
@@ -16,25 +16,109 @@
import org.hornetq.core.exception.HornetQException;
/**
+ * A ClientConsumer receives messages from HornetQ queues.
+ *
+ * Messages can be consumed synchronously by using the <code>receive()</code> methods
+ * which will block until a message is received (or a timeout expires) or asynchronously
+ * by setting a {@link MessageHandler}.
+ *
+ * These 2 types of consumption are exclusive: a ClientConsumer with a MessageHandler set will
+ * throw HornetQException if its <code>receive()</code> methods are called.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
+ *
+ * @see ClientSession#createConsumer(String)
*/
public interface ClientConsumer
{
+ /**
+ * Receives a message from a queue.
+ *
+ * This call will block indefinitely until a message is received.
+ *
+ * Calling this method on a closed consumer will throw a HornetQException.
+ *
+ * @return a ClientMessage
+ *
+ * @throws HornetQException if an exception occurs while waiting to receive a message
+ */
ClientMessage receive() throws HornetQException;
+ /**
+ * Receives a message from a queue.
+ *
+ * This call will block until a message is received or the given timeout expires
+ *
+ * Calling this method on a closed consumer will throw a HornetQException.
+ * @param timeout time (in milliseconds) to wait to receive a message
+ *
+ * @return a message or <code>null</code> if the time out expired
+ *
+ * @throws HornetQException if an exception occurs while waiting to receive a message
+ */
ClientMessage receive(long timeout) throws HornetQException;
+ /**
+ * Receives a message from a queue.
+ *
+ * This call will force a network trip to HornetQ server to ensure that
+ * there are no messages in the queue which can be delivered to this consumer.
+ * This call will never wait indefinitely for a message, it will return <code>null</code>
+ * if no messages are available for this consumer.
+ * Note however that there is a performance cost as an additional network trip to the
+ * server may required to check the queue status.
+ *
+ * Calling this method on a closed consumer will throw a HornetQException.
+ *
+ * @return a message or <code>null</code> if there are no messages in the queue for this consumer
+ *
+ * @throws HornetQException if an exception occurs while waiting to receive a message
+ */
ClientMessage receiveImmediate() throws HornetQException;
+ /**
+ * Return the MessageHandler associated to this consumer.
+ *
+ * Calling this method on a closed consumer will throw a HornetQException.
+ *
+ * @return the MessageHandler associated to this consumer or <code>null</code>
+ *
+ * @throws HornetQException if an exception occurs while getting the MessageHandler
+ */
MessageHandler getMessageHandler() throws HornetQException;
+ /**
+ * Set the MessageHandler for this consumer to consume messages asynchronously.
+ *
+ * Calling this method on a closed consumer will throw a HornetQException.
+ *
+ * @param handler a MessageHandler
+ * @throws HornetQException if an exception occurs while setting the MessageHandler
+ */
void setMessageHandler(MessageHandler handler) throws HornetQException;
+ /**
+ * Close the consumer.
+ *
+ * Once this consumer is closed, it can not receive messages, whether synchronously or asynchronously.
+ *
+ * @throws HornetQException
+ */
void close() throws HornetQException;
+ /**
+ * Return whether the consumer is closed or not.
+ *
+ * @return <code>true</code> if this consumer is closed, <code>false</code> else
+ */
boolean isClosed();
+ /**
+ * Return the last exception thrown by a call to this consumer's MessageHandler
+ *
+ * @return the last exception thrown by a call to this consumer's MessageHandler or <code>null</code>
+ */
Exception getLastException();
}
15 years, 1 month
JBoss hornetq SVN: r8629 - trunk/src/main/org/hornetq/core/client.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 03:57:28 -0500 (Wed, 09 Dec 2009)
New Revision: 8629
Modified:
trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java
Log:
HORNETQ-186: fill in Javadocs for core API
* documented ClientSessionFactory API
Modified: trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java 2009-12-09 07:37:59 UTC (rev 8628)
+++ trunk/src/main/org/hornetq/core/client/ClientSessionFactory.java 2009-12-09 08:57:28 UTC (rev 8629)
@@ -24,6 +24,9 @@
/**
* A ClientSessionFactory is the entry point to create and configure HornetQ resources to produce and consume messages.
*
+ * It is possible to configure a factory using the setter methods only if no session has been created.
+ * Once a session is created, the configuration is fixed and any call to a setter method will throw a IllegalStateException.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
public interface ClientSessionFactory
@@ -182,7 +185,7 @@
*
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}.
*
- * @return <code>true</code> if consumers created through this factory will cache large messages in temporary files, <code>false</code> else.
+ * @return <code>true</code> if consumers created through this factory will cache large messages in temporary files, <code>false</code> else
*/
boolean isCacheLargeMessagesClient();
@@ -403,8 +406,8 @@
* Return whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
*
- * if <code>true</code>, the random unique group ID is created set on each message for the property
- * {@value MessageImpl#HDR_GROUP_ID}.
+ * if <code>true</code>, a random unique group ID is created and set on each message for the property
+ * {@link org.hornetq.core.message.impl.MessageImpl#HDR_GROUP_ID}.
* Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_AUTO_GROUP}.
*
* @return whether producers will automatically assign a group ID to their messages
@@ -419,79 +422,333 @@
*/
void setAutoGroup(boolean autoGroup);
+ /**
+ * Return the group ID that will be eventually set on each message for the property {@link org.hornetq.core.message.impl.MessageImpl#HDR_GROUP_ID}.
+ *
+ * Default value is is <code>null</code> and no group ID will be set on the messages.
+ *
+ * @return the group ID that will be eventually set on each message
+ */
+ String getGroupID();
+
+ /**
+ * Set the group ID that will be set on each message sent through this factory.
+ *
+ * @param groupID the group ID to use
+ */
+ void setGroupID(String groupID);
+
+ /**
+ * Return whether messages will pre-acknowledged on the server before they are sent to the consumers or not.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_PRE_ACKNOWLEDGE}
+ */
boolean isPreAcknowledge();
+ /**
+ * Set to <code>true</code> to pre-acknowledge consumed messages on the server before they are sent to consumers, else set to <code>false</code> to let
+ * clients acknowledge the message they consume.
+ *
+ * @param preAcknowledge <code>true</code> to enable pre-acknowledgement, <code>false</code> else
+ */
void setPreAcknowledge(boolean preAcknowledge);
+ /**
+ * Return the acknowledgements batch size.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_ACK_BATCH_SIZE}.
+ *
+ * @return acknowledgements batch size
+ */
int getAckBatchSize();
+ /**
+ * Return the acknowledgements batch size.
+ *
+ * Value must be greater than 0.
+ *
+ * @param ackBatchSize the acknowledgements batch size
+ */
void setAckBatchSize(int ackBatchSize);
+ /**
+ * Return the address to listen to discover which connectors this factory can use.
+ * The discovery address must be set to enable this factory to discover HornetQ servers.
+ *
+ * @return the address to listen to discover which connectors this factory can use
+ */
+ String getDiscoveryAddress();
+
+ /**
+ * Set the address to listen to discover which connectors this factory can use.
+ *
+ * @param discoveryAddress the address to listen to discover which connectors this factory can use
+ */
+ void setDiscoveryAddress(String discoveryAddress);
+
+ /**
+ * Return the port to listen to discover which connectors this factory can use.
+ * The discovery port must be set to enable this factory to discover HornetQ servers.
+ *
+ * @return the port to listen to discover which connectors this factory can use
+ */
+ int getDiscoveryPort();
+
+
+ /**
+ * Set the port to listen to discover which connectors this factory can use.
+ *
+ * @param discoveryPort the port to listen to discover which connectors this factory can use
+ */
+ void setDiscoveryPort(int discoveryPort);
+
+ /**
+ * Return the refresh timeout for discovered HornetQ servers.
+ *
+ * If this factory uses discovery to find HornetQ servers, the list of discovered servers
+ * will be refreshed according to this timeout.
+ *
+ * Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_DISCOVERY_REFRESH_TIMEOUT}.
+ *
+ * @return the refresh timeout for discovered HornetQ servers
+ */
+ long getDiscoveryRefreshTimeout();
+
+ /**
+ * Set the refresh timeout for discovered HornetQ servers.
+ *
+ * Value must be greater than 0.
+ *
+ * @param discoveryRefreshTimeout refresh timeout (in milliseconds) for discovered HornetQ servers
+ */
+ void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout);
+
+ /**
+ * Return the initial wait timeout if this factory is configured to use discovery.
+ *
+ * Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_DISCOVERY_INITIAL_WAIT_TIMEOUT}.
+ *
+ * @return the initial wait timeout if this factory is configured to use discovery
+ */
long getDiscoveryInitialWaitTimeout();
+ /**
+ * Set the initial wait timeout if this factory is configured to use discovery.
+ *
+ * Value is in milliseconds and must be greater than 0.
+ *
+ * @param initialWaitTimeout initial wait timeout when using discovery
+ */
void setDiscoveryInitialWaitTimeout(long initialWaitTimeout);
+ /**
+ * Return whether this factory will use global thread pools (shared among all the factories in the same JVM)
+ * or its own pools.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_USE_GLOBAL_POOLS}.
+ *
+ * @return <code>true</code> if this factory uses global thread pools, <code>false</code> else
+ */
boolean isUseGlobalPools();
+ /**
+ * Set whether this factory will use global thread pools (shared among all the factories in the same JVM)
+ * or its own pools.
+ *
+ * @param useGlobalPools <code>true</code> to let this factory uses global thread pools, <code>false</code> else
+ */
void setUseGlobalPools(boolean useGlobalPools);
+ /**
+ * Return the maximum size of the scheduled thread pool.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
+ *
+ * @return maximum size of the scheduled thread pool.
+ */
int getScheduledThreadPoolMaxSize();
+ /**
+ * Set the maximum size of the scheduled thread pool.
+ *
+ * This setting is relevant only if this factory does not use global pools.
+ * Value must be greater than 0.
+ *
+ * @param scheduledThreadPoolMaxSize maximum size of the scheduled thread pool.
+ */
void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
+ /**
+ * Return the maximum size of the thread pool.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_THREAD_POOL_MAX_SIZE}.
+ *
+ * @return maximum size of the thread pool.
+ */
int getThreadPoolMaxSize();
+ /**
+ * Set the maximum size of the thread pool.
+ *
+ * This setting is relevant only if this factory does not use global pools.
+ * Value must be -1 (for unlimited thread pool) or greater than 0.
+ *
+ * @param threadPoolMaxSize maximum size of the thread pool.
+ */
void setThreadPoolMaxSize(int threadPoolMaxSize);
+ /**
+ * Return the time to retry connections created by this factory after failure.
+ *
+ * Value is in milliseconds, default is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RETRY_INTERVAL}.
+ *
+ * @return the time to retry connections created by this factory after failure
+ */
long getRetryInterval();
+ /**
+ * Set the time to retry connections created by this factory after failure.
+ *
+ * Value must be greater than 0.
+ *
+ * @param retryInterval time (in milliseconds) to retry connections created by this factory after failure
+ */
void setRetryInterval(long retryInterval);
+ /**
+ * Return the multiplier to apply to successive retry intervals.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
+ *
+ * @return the multiplier to apply to successive retry intervals
+ */
double getRetryIntervalMultiplier();
+ /**
+ * Set the multiplier to apply to successive retry intervals.
+ *
+ * Value must be positive.
+ *
+ * @param retryIntervalMultiplier multiplier to apply to successive retry intervals
+ */
void setRetryIntervalMultiplier(double retryIntervalMultiplier);
+ /**
+ * Return the maximum retry interval (in the case a retry interval multiplier has been specified).
+ *
+ * Value is in milliseconds, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_MAX_RETRY_INTERVAL}.
+ *
+ * @return the maximum retry interval
+ */
long getMaxRetryInterval();
+ /**
+ * Set the maximum retry interval.
+ *
+ * Value must be greater than 0.
+ *
+ * @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier has been specified
+ */
void setMaxRetryInterval(long maxRetryInterval);
+ /**
+ * Return the maximum number of attempts to retry connection in case of failure.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_RECONNECT_ATTEMPTS}.
+ *
+ * @return the maximum number of attempts to retry connection in case of failure.
+ */
int getReconnectAttempts();
+ /**
+ * Set the maximum number of attempts to retry connection in case of failure.
+ *
+ * Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
+ *
+ * @param reconnectAttempts maximum number of attempts to retry connection in case of failure
+ */
void setReconnectAttempts(int reconnectAttempts);
+ /**
+ * Return whether connections created by this factory must failover in case the server they are
+ * connected to <em>has normally shut down</em>.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN}.
+ *
+ * @return <code>true</code> if connections must failover if the server has normally shut down, else <code>false</code>
+ */
boolean isFailoverOnServerShutdown();
+ /**
+ * Set whether connections created by this factory must failover in case the server they are
+ * connected to <em>has normally shut down</em>
+ *
+ * @param failoverOnServerShutdown <code>true</code> if connections must failover if the server has normally shut down, <code>false</code> else
+ */
void setFailoverOnServerShutdown(boolean failoverOnServerShutdown);
+ /**
+ * Return the class name of the connection load balancing policy.
+ *
+ * Default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME}.
+ *
+ * @return the class name of the connection load balancing policy
+ */
String getConnectionLoadBalancingPolicyClassName();
+ /**
+ * Set the class name of the connection load balancing policy.
+ *
+ * Value must be the name of a class implementing {@link ConnectionLoadBalancingPolicy}.
+ *
+ * @param loadBalancingPolicyClassName class name of the connection load balancing policy
+ */
void setConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName);
- String getDiscoveryAddress();
-
- void setDiscoveryAddress(String discoveryAddress);
-
- int getDiscoveryPort();
-
- void setDiscoveryPort(int discoveryPort);
-
- long getDiscoveryRefreshTimeout();
-
- void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout);
-
+ /**
+ * Return the initial size of messages created through this factory.
+ *
+ * Value is in bytes, default value is {@value org.hornetq.core.client.impl.ClientSessionFactoryImpl#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
+ *
+ * @return the initial size of messages created through this factory
+ */
int getInitialMessagePacketSize();
+ /**
+ * Set the initial size of messages created through this factory.
+ *
+ * Value must be greater than 0.
+ *
+ * @param size initial size of messages created through this factory.
+ */
void setInitialMessagePacketSize(int size);
+ /**
+ * Add an interceptor which will be executed <em>after packets are received from the server</em>.
+ *
+ * @param interceptor an Interceptor
+ */
void addInterceptor(Interceptor interceptor);
+ /**
+ * Remove an interceptor.
+ *
+ * @param interceptor interceptor to remove
+ *
+ * @return <code>true</code> if the interceptor is removed from this factory, <code>false</code> else
+ */
boolean removeInterceptor(Interceptor interceptor);
+ /**
+ * Close this factory and release all its resources
+ */
void close();
+ /**
+ * Creates a copy of this factory.
+ *
+ * @return a copy of this factory with the same parameters values
+ */
ClientSessionFactory copy();
- void setGroupID(String groupID);
-
- String getGroupID();
}
15 years, 1 month
JBoss hornetq SVN: r8628 - trunk/tests/src/org/hornetq/tests/integration/cluster/reattach.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-09 02:37:59 -0500 (Wed, 09 Dec 2009)
New Revision: 8628
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
Log:
fixed OrderReattachTest
* used HornetQ's LinkedBlockingDeque (java.util class is available in 1.6 only)
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java 2009-12-08 23:09:30 UTC (rev 8627)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/reattach/OrderReattachTest.java 2009-12-09 07:37:59 UTC (rev 8628)
@@ -16,7 +16,6 @@
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;
import junit.framework.Assert;
@@ -36,6 +35,7 @@
import org.hornetq.jms.client.HornetQTextMessage;
import org.hornetq.tests.util.ServiceTestBase;
import org.hornetq.utils.SimpleString;
+import org.hornetq.utils.concurrent.LinkedBlockingDeque;
/**
* A OrderReattachTest
15 years, 1 month