[hornetq-commits] JBoss hornetq SVN: r10672 - in branches/Branch_2_2_EAP/src/main/org/hornetq: core/client/impl and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon May 16 16:32:10 EDT 2011


Author: clebert.suconic at jboss.com
Date: 2011-05-16 16:32:09 -0400 (Mon, 16 May 2011)
New Revision: 10672

Modified:
   branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/ServerLocator.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/FileConfiguration.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/remoting/ConnectorFactory.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java
   branches/Branch_2_2_EAP/src/main/org/hornetq/utils/VersionLoader.java
Log:
Fixing a few typos.. small fixes

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/ServerLocator.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/ServerLocator.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/client/ServerLocator.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -23,18 +23,18 @@
  * A ServerLocator
  *
  * @author Tim Fox
- *
- *
  */
 public interface ServerLocator
 {
-   
-   /**
-    * This method will disable any checks when a GarbageCollection happens leaving connections open.
-    * The JMS Layer will make specific usage of this method, since the ConnectionFactory.finalize should release this.
-    * 
-    * Warn: You may leave resources unnatended if you call this method and don't take care of cleaning the resources yourself.
-    */
+
+	/**
+	 * This method will disable any checks when a GarbageCollection happens
+	 * leaving connections open. The JMS Layer will make specific usage of this
+	 * method, since the ConnectionFactory.finalize should release this.
+	 * 
+	 * Warning: You may leave resources unattended if you call this method and
+	 * don't take care of cleaning the resources yourself.
+	 */
    void disableFinalizeCheck();
    
    /**
@@ -244,20 +244,26 @@
     */
    void setProducerMaxRate(int producerMaxRate);
 
-   /**
-    * Returns whether consumers created through this factory will block while sending message acknowledgements or do it asynchronously.
-    * 
-    * Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}.
-    * 
-    * @return whether consumers will block while sending message acknowledgements or do it asynchronously
-    */
+	/**
+	 * Returns whether consumers created through this factory will block while
+	 * sending message acknowledgments or do it asynchronously.
+	 * 
+	 * Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_ACKNOWLEDGE}.
+	 * 
+	 * @return whether consumers will block while sending message
+	 *         acknowledgments or do it asynchronously
+	 */
    boolean isBlockOnAcknowledge();
 
-   /**
-    * 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
-    */
+	/**
+	 * Sets whether consumers created through this factory will block while
+	 * sending message acknowledgments or do it asynchronously.
+	 * 
+	 * @param blockOnAcknowledge
+	 *            <code>true</code> to block when sending message
+	 *            acknowledgments or <code>false</code> to send them
+	 *            asynchronously
+	 */
    void setBlockOnAcknowledge(boolean blockOnAcknowledge);
 
    /**
@@ -341,30 +347,34 @@
     */
    boolean isPreAcknowledge();
 
-   /**
-    * 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
-    */
+	/**
+	 * 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-acknowledgment,
+	 *            <code>false</code> else
+	 */
    void setPreAcknowledge(boolean preAcknowledge);
 
-   /**
-    * Returns the acknowledgements batch size.
-    * 
-    * Default value is  {@link HornetQClient#DEFAULT_ACK_BATCH_SIZE}.
-    * 
-    * @return the acknowledgements batch size
-    */
+	/**
+	 * Returns the acknowledgments batch size.
+	 * 
+	 * Default value is {@link HornetQClient#DEFAULT_ACK_BATCH_SIZE}.
+	 * 
+	 * @return the acknowledgments batch size
+	 */
    int getAckBatchSize();
 
-   /**
-    * Sets the acknowledgements batch size.
-    * 
-    * Value must be equal or greater than 0.
-    * 
-    * @param ackBatchSize acknowledgements batch size
-    */
+	/**
+	 * Sets the acknowledgments batch size.
+	 * 
+	 * Value must be equal or greater than 0.
+	 * 
+	 * @param ackBatchSize
+	 *            acknowledgments batch size
+	 */
    void setAckBatchSize(int ackBatchSize);
 
    /**

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientLargeMessageImpl.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientLargeMessageImpl.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -27,8 +27,6 @@
  * until the buffer is filled up or the user set a streaming.
  *
  * @author clebertsuconic
- *
- *
  */
 public class ClientLargeMessageImpl extends ClientMessageImpl implements ClientLargeMessageInternal
 {
@@ -70,6 +68,7 @@
 
    // Public --------------------------------------------------------
 
+   @Override
    public int getEncodeSize()
    {
       if (bodyBuffer != null)
@@ -85,6 +84,7 @@
    /**
     * @return the largeMessage
     */
+   @Override
    public boolean isLargeMessage()
    {
       return true;
@@ -95,6 +95,7 @@
       largeMessageController = controller;
    }
 
+   @Override
    public HornetQBuffer getBodyBuffer()
    {
       checkBuffer();
@@ -102,6 +103,7 @@
       return bodyBuffer;
    }
 
+   @Override
    public int getBodySize()
    {
       return getLongProperty(Message.HDR_LARGE_BODY_SIZE).intValue();
@@ -115,6 +117,7 @@
    /* (non-Javadoc)
     * @see org.hornetq.api.core.client.ClientMessage#saveToOutputStream(java.io.OutputStream)
     */
+   @Override
    public void saveToOutputStream(final OutputStream out) throws HornetQException
    {
       if (bodyBuffer != null)
@@ -131,6 +134,7 @@
    /* (non-Javadoc)
     * @see org.hornetq.api.core.client.ClientMessage#setOutputStream(java.io.OutputStream)
     */
+   @Override
    public void setOutputStream(final OutputStream out) throws HornetQException
    {
       if (bodyBuffer != null)
@@ -146,6 +150,7 @@
    /* (non-Javadoc)
     * @see org.hornetq.api.core.client.ClientMessage#waitOutputStreamCompletion()
     */
+   @Override
    public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws HornetQException
    {
       if (bodyBuffer != null)
@@ -158,6 +163,7 @@
       }
    }
 
+   @Override
    public void discardBody()
    {
       if (bodyBuffer != null)

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/FileConfiguration.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -23,8 +23,7 @@
 import org.w3c.dom.Element;
 
 /**
- * ConfigurationImpl
- * This class allows the Configuration class to be configured via a config file.
+ * A {@code FileConfiguration} reads configuration values from a file.
  *
  * @author <a href="ataylor at redhat.com">Andy Taylor</a>
  * @author <a href="tim.fox at jboss.com">Tim Fox</a>
@@ -39,8 +38,7 @@
 
    private static final String DEFAULT_CONFIGURATION_URL = "hornetq-configuration.xml";
 
-   // For a bridge confirmations must be activated or send acknowledgements won't return
-
+   // For a bridge confirmations must be activated or send acknowledgments won't return
    public static final int DEFAULT_CONFIRMATION_WINDOW_SIZE = 1024 * 1024;
 
    // Static --------------------------------------------------------------------------
@@ -59,25 +57,25 @@
       {
          return;
       }
-      
-      
+
+
       URL url = getClass().getClassLoader().getResource(configurationUrl);
-      
+
       if (url == null)
       {
          // The URL is outside of the classloader. Trying a pure url now
          url = new URL(configurationUrl);
       }
-      
+
       FileConfiguration.log.debug("Loading server configuration from " + url);
 
       Reader reader = new InputStreamReader(url.openStream());
       String xml = org.hornetq.utils.XMLUtil.readerToString(reader);
       xml = XMLUtil.replaceSystemProps(xml);
       Element e = org.hornetq.utils.XMLUtil.stringToElement(xml);
-      
+
       FileConfigurationParser parser = new FileConfigurationParser();
-      
+
       // https://jira.jboss.org/browse/HORNETQ-478 - We only want to validate AIO when
       //     starting the server
       //     and we don't want to do it when deploying hornetq-queues.xml which uses the same parser and XML format

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/remoting/ConnectorFactory.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/remoting/ConnectorFactory.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/spi/core/remoting/ConnectorFactory.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -28,7 +28,7 @@
 public interface ConnectorFactory
 {
    /**
-    * creates a new instanc of a connector.
+    * creates a new instance of a connector.
     *
     * @param configuration       the configuration
     * @param handler             the handler

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/TypedProperties.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -38,24 +38,27 @@
 
 /**
  * 
- * A TypedProperties
- * 
+ * Property Value Conversion.
+ * <p>
+ * This implementation follows section 3.5.4 of the <i>Java Message Service<i>
+ * specification (Version 1.1 April 12, 2002).
+ * <p>
  * TODO - should have typed property getters and do conversions herein
  * 
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
+ * @see <i>Java Message Service<i> specification (Version 1.1 April 12, 2002), section 3.5.4.
  */
 public class TypedProperties
 {
    private static final Logger log = Logger.getLogger(TypedProperties.class);
-   
+
    private static final SimpleString HQ_PROPNAME = new SimpleString("_HQ_");
 
    private Map<SimpleString, PropertyValue> properties;
 
    private volatile int size;
-   
+
    private boolean internalProperties;
 
    public TypedProperties()
@@ -76,7 +79,7 @@
       properties = other.properties == null ? null : new HashMap<SimpleString, PropertyValue>(other.properties);
       size = other.size;
    }
-   
+
    public boolean hasInternalProperties()
    {
       return internalProperties;
@@ -354,19 +357,17 @@
    public Float getFloatProperty(final SimpleString key) throws PropertyConversionException
    {
       Object value = doGetProperty(key);
-
+      if (value == null)
+         return Float.valueOf(null);
       if (value instanceof Float)
       {
          return ((Float)value).floatValue();
       }
-      else if (value instanceof SimpleString)
+      if (value instanceof SimpleString)
       {
          return Float.parseFloat(((SimpleString)value).toString());
       }
-      else
-      {
-         throw new PropertyConversionException("Invalid conversion " + key);
-      }
+      throw new PropertyConversionException("Invalid conversion: " + key);
    }
 
    public SimpleString getSimpleStringProperty(final SimpleString key) throws PropertyConversionException
@@ -414,10 +415,7 @@
       {
          return new SimpleString(value.toString());
       }
-      else
-      {
-         throw new PropertyConversionException("Invalid conversion");
-      }
+      throw new PropertyConversionException("Invalid conversion");
    }
 
    public Object removeProperty(final SimpleString key)
@@ -430,10 +428,10 @@
       if (size == 0)
       {
          return false;
-         
+
       }
       else
-      {         
+      {
          return properties.containsKey(key);
       }
    }
@@ -442,7 +440,7 @@
    {
       if (size == 0)
       {
-         return Collections.EMPTY_SET;         
+         return Collections.emptySet();
       }
       else
       {
@@ -461,7 +459,7 @@
       else
       {
          int numHeaders = buffer.readInt();
-         
+
          properties = new HashMap<SimpleString, PropertyValue>(numHeaders);
          size = 0;
 
@@ -619,7 +617,7 @@
       {
          internalProperties = true;
       }
-      
+
       PropertyValue oldValue = properties.put(key, value);
       if (oldValue != null)
       {

Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/VersionLoader.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/VersionLoader.java	2011-05-16 18:18:12 UTC (rev 10671)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/VersionLoader.java	2011-05-16 20:32:09 UTC (rev 10672)
@@ -20,7 +20,6 @@
 import java.util.Properties;
 import java.util.StringTokenizer;
 
-import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.core.version.Version;
 import org.hornetq.core.version.impl.VersionImpl;
@@ -124,7 +123,7 @@
          }
          catch (IOException e)
          {
-            // if we get here then the messaging hasnt been built properly and the version.properties is skewed in some
+            // if we get here then the messaging hasn't been built properly and the version.properties is skewed in some
             // way
             throw new RuntimeException("unable to load " + VersionLoader.PROP_FILE_NAME, e);
          }



More information about the hornetq-commits mailing list