Author: borges
Date: 2011-05-26 11:38:46 -0400 (Thu, 26 May 2011)
New Revision: 10742
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java
trunk/hornetq-core/src/main/java/org/hornetq/core/config/impl/ConfigurationImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/logging/LogDelegateTest.java
Log:
HORNETQ-698 Remove journal constants from ConfigurationImpl. Adjust references.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java 2011-05-26
15:17:04 UTC (rev 10741)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/config/Configuration.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -29,20 +29,20 @@
import org.hornetq.spi.core.logging.LogDelegateFactory;
/**
- *
+ *
* A Configuration is used to configure HornetQ servers.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
*/
public interface Configuration extends Serializable
{
// General attributes
-------------------------------------------------------------------
-
-
+
+
/** To be used on dependency management on the application server */
String getName();
-
+
/** To be used on dependency management on the application server */
void setName(String name);
@@ -204,7 +204,7 @@
* Sets whether this server is manageable using JMX or not.
*/
void setJMXManagementEnabled(boolean enabled);
-
+
/**
* Returns the domain used by JMX MBeans (provided JMX management is enabled).
* <br>
@@ -214,7 +214,7 @@
/**
* Sets the domain used by JMX MBeans (provided JMX management is enabled).
- *
+ *
* Changing this JMX domain is required if multiple HornetQ servers are run inside
* the same JVM and all servers are using the same MBeanServer.
*/
@@ -280,7 +280,7 @@
/**
* Returns the name of the connector used to connect to the live node - only used when
using shared nothing (shared store = false).
- * <br>
+ * <br>
*/
String getLiveConnectorName();
@@ -587,7 +587,7 @@
/**
* Returns the timeout (in nanoseconds) used to flush buffers in the AIO queue.
* <br>
- * Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}.
+ * Default value is {@value
org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO}.
*/
int getJournalBufferTimeout_AIO();
@@ -599,7 +599,7 @@
/**
* Returns the buffer size (in bytes) for AIO.
* <br>
- * Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}.
+ * Default value is {@value
org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_AIO}.
*/
int getJournalBufferSize_AIO();
@@ -623,7 +623,7 @@
/**
* Returns the timeout (in nanoseconds) used to flush buffers in the NIO.
* <br>
- * Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}.
+ * Default value is {@value
org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO}.
*/
int getJournalBufferTimeout_NIO();
@@ -635,7 +635,7 @@
/**
* Returns the buffer size (in bytes) for NIO.
* <br>
- * Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}.
+ * Default value is {@value
org.hornetq.core.journal.impl.JournalConstants#DEFAULT_JOURNAL_BUFFER_SIZE_NIO}.
*/
int getJournalBufferSize_NIO();
@@ -737,7 +737,7 @@
void setWildcardRoutingEnabled(boolean enabled);
/**
- * Returns the timeout (in milliseconds) after which transactions is removed
+ * Returns the timeout (in milliseconds) after which transactions is removed
* from the resource manager after it was created.
* <br>
* Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_TRANSACTION_TIMEOUT}.
@@ -745,7 +745,7 @@
long getTransactionTimeout();
/**
- * Sets the timeout (in milliseconds) after which transactions is removed
+ * Sets the timeout (in milliseconds) after which transactions is removed
* from the resource manager after it was created.
*/
void setTransactionTimeout(long timeout);
@@ -771,7 +771,7 @@
/**
* Sets the sample period to take message counter snapshot.
- *
+ *
* @param period value must be greater than 1000ms
*/
void setMessageCounterSamplePeriod(long period);
@@ -785,13 +785,13 @@
/**
* Sets the maximum number of days kept in memory for message counter.
- *
+ *
* @param maxDayHistory value must be greater than 0
*/
void setMessageCounterMaxDayHistory(int maxDayHistory);
/**
- * Returns the frequency (in milliseconds) to scan transactions to detect which
transactions
+ * Returns the frequency (in milliseconds) to scan transactions to detect which
transactions
* have timed out.
* <br>
* Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_TRANSACTION_TIMEOUT_SCAN_PERIOD}.
@@ -799,13 +799,13 @@
long getTransactionTimeoutScanPeriod();
/**
- * Sets the frequency (in milliseconds) to scan transactions to detect which
transactions
+ * Sets the frequency (in milliseconds) to scan transactions to detect which
transactions
* have timed out.
*/
void setTransactionTimeoutScanPeriod(long period);
/**
- * Returns the frequency (in milliseconds) to scan messages to detect which messages
+ * Returns the frequency (in milliseconds) to scan messages to detect which messages
* have expired.
* <br>
* Default value is {@value
org.hornetq.core.config.impl.ConfigurationImpl#DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD}.
@@ -813,7 +813,7 @@
long getMessageExpiryScanPeriod();
/**
- * Sets the frequency (in milliseconds) to scan messages to detect which messages
+ * Sets the frequency (in milliseconds) to scan messages to detect which messages
* have expired.
*/
void setMessageExpiryScanPeriod(long messageExpiryScanPeriod);
@@ -831,7 +831,7 @@
void setMessageExpiryThreadPriority(int messageExpiryThreadPriority);
/**
- *
+ *
* @return A list of AddressSettings per matching to be deployed to the address
settings repository
*/
Map<String, AddressSettings> getAddressesSettings();
@@ -842,25 +842,25 @@
void setAddressesSettings(Map<String, AddressSettings> addressesSettings);
/**
- *
+ *
* @param roles a list of roles per matching
*/
void setSecurityRoles(Map<String, Set<Role>> roles);
/**
- *
+ *
* @return a list of roles per matching
*/
Map<String, Set<Role>> getSecurityRoles();
/**
- *
- * @param
+ *
+ * @param
*/
void setConnectorServiceConfigurations(List<ConnectorServiceConfiguration>
configs);
/**
- *
- * @return
+ *
+ * @return
*/
List<ConnectorServiceConfiguration> getConnectorServiceConfigurations();
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/config/impl/ConfigurationImpl.java 2011-05-26
15:17:04 UTC (rev 10741)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/config/impl/ConfigurationImpl.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -31,6 +31,7 @@
import org.hornetq.core.config.ConnectorServiceConfiguration;
import org.hornetq.core.config.CoreQueueConfiguration;
import org.hornetq.core.config.DivertConfiguration;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.logging.impl.JULLogDelegateFactory;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.JournalType;
@@ -109,16 +110,8 @@
public static final int DEFAULT_JOURNAL_MAX_IO_AIO = 500;
- public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO = (int)(1000000000d /
2000);
-
- public static final int DEFAULT_JOURNAL_BUFFER_SIZE_AIO = 490 * 1024;
-
public static final int DEFAULT_JOURNAL_MAX_IO_NIO = 1;
- public static final int DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO = (int)(1000000000d /
300);
-
- public static final int DEFAULT_JOURNAL_BUFFER_SIZE_NIO = 490 * 1024;
-
public static final boolean DEFAULT_JOURNAL_LOG_WRITE_RATE = false;
public static final int DEFAULT_JOURNAL_PERF_BLAST_PAGES = -1;
@@ -157,7 +150,7 @@
public static final int DEFAULT_ID_CACHE_SIZE = 2000;
public static final boolean DEFAULT_PERSIST_ID_CACHE = true;
-
+
public static final boolean DEFAULT_CLUSTER_DUPLICATE_DETECTION = true;
public static final boolean DEFAULT_CLUSTER_FORWARD_WHEN_NO_CONSUMERS = false;
@@ -185,7 +178,7 @@
public static final String DEFAULT_LOG_DELEGATE_FACTORY_CLASS_NAME =
JULLogDelegateFactory.class.getCanonicalName();
// Attributes
-----------------------------------------------------------------------------
-
+
protected String name = "ConfigurationImpl::" +
System.identityHashCode(this);
protected boolean clustered = ConfigurationImpl.DEFAULT_CLUSTERED;
@@ -231,7 +224,7 @@
protected String logDelegateFactoryClassName =
ConfigurationImpl.DEFAULT_LOG_DELEGATE_FACTORY_CLASS_NAME;
protected List<String> interceptorClassNames = new ArrayList<String>();
-
+
protected Map<String, TransportConfiguration> connectorConfigs = new
HashMap<String, TransportConfiguration>();
protected Set<TransportConfiguration> acceptorConfigs = new
HashSet<TransportConfiguration>();
@@ -284,15 +277,15 @@
protected int journalMaxIO_AIO = ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_AIO;
- protected int journalBufferTimeout_AIO =
ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO;
+ protected int journalBufferTimeout_AIO =
JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO;
- protected int journalBufferSize_AIO =
ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO;
+ protected int journalBufferSize_AIO =
JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO;
protected int journalMaxIO_NIO = ConfigurationImpl.DEFAULT_JOURNAL_MAX_IO_NIO;
- protected int journalBufferTimeout_NIO =
ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO;
+ protected int journalBufferTimeout_NIO =
JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO;
- protected int journalBufferSize_NIO =
ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_NIO;
+ protected int journalBufferSize_NIO =
JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO;
protected boolean logJournalWriteRate =
ConfigurationImpl.DEFAULT_JOURNAL_LOG_WRITE_RATE;
@@ -356,7 +349,7 @@
return allowAutoFailBack;
}
- public void setAllowAutoFailBack(boolean allowAutoFailBack)
+ public void setAllowAutoFailBack(final boolean allowAutoFailBack)
{
this.allowAutoFailBack = allowAutoFailBack;
}
@@ -513,7 +506,7 @@
{
this.liveConnectorName = liveConnectorName;
}
-
+
public GroupingHandlerConfiguration getGroupingHandlerConfiguration()
{
return groupingHandlerConfiguration;
@@ -894,7 +887,7 @@
return failoverOnServerShutdown;
}
- public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
+ public void setFailoverOnServerShutdown(final boolean failoverOnServerShutdown)
{
this.failoverOnServerShutdown = failoverOnServerShutdown;
}
@@ -1359,7 +1352,7 @@
public List<ConnectorServiceConfiguration> getConnectorServiceConfigurations()
{
- return this.connectorServiceConfigurations;
+ return connectorServiceConfigurations;
}
public long getFailbackDelay()
@@ -1367,14 +1360,14 @@
return failbackDelay;
}
- public void setFailbackDelay(long failbackDelay)
+ public void setFailbackDelay(final long failbackDelay)
{
this.failbackDelay = failbackDelay;
}
public void setConnectorServiceConfigurations(final
List<ConnectorServiceConfiguration> configs)
{
- this.connectorServiceConfigurations = configs;
+ connectorServiceConfigurations = configs;
}
/* (non-Javadoc)
@@ -1388,7 +1381,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.config.Configuration#setName(java.lang.String)
*/
- public void setName(String name)
+ public void setName(final String name)
{
this.name = name;
}
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-05-26
15:17:04 UTC (rev 10741)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileConfigurationParser.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -28,11 +28,18 @@
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.HornetQClient;
-import org.hornetq.core.config.*;
+import org.hornetq.core.config.BridgeConfiguration;
+import org.hornetq.core.config.BroadcastGroupConfiguration;
+import org.hornetq.core.config.ClusterConnectionConfiguration;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.ConnectorServiceConfiguration;
+import org.hornetq.core.config.CoreQueueConfiguration;
+import org.hornetq.core.config.DivertConfiguration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.config.impl.FileConfiguration;
import org.hornetq.core.config.impl.Validators;
import org.hornetq.core.journal.impl.AIOSequentialFileFactory;
+import org.hornetq.core.journal.impl.JournalConstants;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.JournalType;
@@ -139,7 +146,7 @@
/**
* @param validateAIO the validateAIO to set
*/
- public void setValidateAIO(boolean validateAIO)
+ public void setValidateAIO(final boolean validateAIO)
{
this.validateAIO = validateAIO;
}
@@ -479,14 +486,14 @@
int journalBufferTimeout = XMLConfigurationUtil.getInteger(e,
"journal-buffer-timeout",
- config.getJournalType()
== JournalType.ASYNCIO ? ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO
-
: ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO,
+ config.getJournalType()
== JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO
+
: JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO,
Validators.GT_ZERO);
int journalBufferSize = XMLConfigurationUtil.getInteger(e,
"journal-buffer-size",
- config.getJournalType() ==
JournalType.ASYNCIO ? ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_AIO
-
: ConfigurationImpl.DEFAULT_JOURNAL_BUFFER_SIZE_NIO,
+ config.getJournalType() ==
JournalType.ASYNCIO ? JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO
+
: JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO,
Validators.GT_ZERO);
int journalMaxIO = XMLConfigurationUtil.getInteger(e,
@@ -1206,7 +1213,7 @@
mainConfig.getBridgeConfigurations().add(config);
}
- private void getStaticConnectors(List<String> staticConnectorNames, Node child)
+ private void getStaticConnectors(final List<String> staticConnectorNames, final
Node child)
{
NodeList children2 =
((Element)child).getElementsByTagName("connector-ref");
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
---
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2011-05-26
15:17:04 UTC (rev 10741)
+++
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -54,8 +54,8 @@
public AIOSequentialFileFactory(final String journalDir)
{
this(journalDir,
- JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
- JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO,
+ JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO,
false);
}
Modified:
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java
===================================================================
---
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2011-05-26
15:17:04 UTC (rev 10741)
+++
trunk/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/SyncSpeedTest.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -27,11 +27,8 @@
import org.hornetq.core.logging.Logger;
/**
- * A SyncSpeedTest
- *
- * This class just provides some diagnostics on how fast your disk can sync
- * Useful when determining performance issues
- *
+ * SyncSpeedTest provides diagnostics on how fast your disk can sync.<p>
+ * It is used to investigate performance issues.
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a> fox
*
*
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/logging/LogDelegateTest.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/logging/LogDelegateTest.java 2011-05-26
15:17:04 UTC (rev 10741)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/logging/LogDelegateTest.java 2011-05-26
15:38:46 UTC (rev 10742)
@@ -16,7 +16,6 @@
import junit.framework.Assert;
import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.logging.impl.JULLogDelegate;
import org.hornetq.core.logging.impl.JULLogDelegateFactory;