Browse files

Fixing a few typos.. small fixes

  • Loading branch information...
1 parent a6713a4 commit 523acae24bd9dcc80eef91746596d3426d929d61 @clebertsuconic clebertsuconic committed May 16, 2011
View
92 src/main/org/hornetq/api/core/client/ServerLocator.java
@@ -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);
/**
View
10 src/main/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
@@ -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 ClientLargeMessageImpl()
// Public --------------------------------------------------------
+ @Override
public int getEncodeSize()
{
if (bodyBuffer != null)
@@ -85,6 +84,7 @@ public int getEncodeSize()
/**
* @return the largeMessage
*/
+ @Override
public boolean isLargeMessage()
{
return true;
@@ -95,13 +95,15 @@ public void setLargeMessageController(final LargeMessageController controller)
largeMessageController = controller;
}
+ @Override
public HornetQBuffer getBodyBuffer()
{
checkBuffer();
return bodyBuffer;
}
+ @Override
public int getBodySize()
{
return getLongProperty(Message.HDR_LARGE_BODY_SIZE).intValue();
@@ -115,6 +117,7 @@ public LargeMessageController getLargeMessageController()
/* (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 @@ public void saveToOutputStream(final OutputStream out) throws HornetQException
/* (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 @@ public void setOutputStream(final OutputStream out) throws HornetQException
/* (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 @@ public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws Ho
}
}
+ @Override
public void discardBody()
{
if (bodyBuffer != null)
View
18 src/main/org/hornetq/core/config/impl/FileConfiguration.java
@@ -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@redhat.com">Andy Taylor</a>
* @author <a href="tim.fox@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 @@ public synchronized void start() throws Exception
{
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
View
2 src/main/org/hornetq/spi/core/remoting/ConnectorFactory.java
@@ -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
View
40 src/main/org/hornetq/utils/TypedProperties.java
@@ -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@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@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 @@ public TypedProperties(final TypedProperties other)
properties = other.properties == null ? null : new HashMap<SimpleString, PropertyValue>(other.properties);
size = other.size;
}
-
+
public boolean hasInternalProperties()
{
return internalProperties;
@@ -354,19 +357,17 @@ else if (value instanceof SimpleString)
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 @@ else if (value instanceof Double)
{
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 @@ public boolean containsProperty(final SimpleString key)
if (size == 0)
{
return false;
-
+
}
else
- {
+ {
return properties.containsKey(key);
}
}
@@ -442,7 +440,7 @@ public boolean containsProperty(final SimpleString key)
{
if (size == 0)
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
else
{
@@ -461,7 +459,7 @@ public synchronized void decode(final HornetQBuffer buffer)
else
{
int numHeaders = buffer.readInt();
-
+
properties = new HashMap<SimpleString, PropertyValue>(numHeaders);
size = 0;
@@ -619,7 +617,7 @@ private synchronized void doPutValue(final SimpleString key, final PropertyValue
{
internalProperties = true;
}
-
+
PropertyValue oldValue = properties.put(key, value);
if (oldValue != null)
{
View
3 src/main/org/hornetq/utils/VersionLoader.java
@@ -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 @@ private static Version load()
}
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);
}

0 comments on commit 523acae

Please sign in to comment.