[hornetq-commits] JBoss hornetq SVN: r8707 - in trunk: src/main/org/hornetq/core/config/impl and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 4 11:43:08 EST 2010


Author: jmesnil
Date: 2010-01-04 11:43:07 -0500 (Mon, 04 Jan 2010)
New Revision: 8707

Modified:
   trunk/src/main/org/hornetq/core/config/Configuration.java
   trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
   trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
   trunk/src/main/org/hornetq/core/management/HornetQServerControl.java
   trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java
   trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java
Log:
HORNETQ-186: API javadoc

* moved configuration javadoc to Configuration interface
* added @see tags from HornetQServerControl getters to the corresponding
  methods in Configuration
* removed start/stop/isStarted methods from Configuration interface
  (only the FileConfiguration class needs them to be properly setup by the
  microcontainer)


Modified: trunk/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/Configuration.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/src/main/org/hornetq/core/config/Configuration.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -25,38 +25,47 @@
 import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
 import org.hornetq.core.config.cluster.DivertConfiguration;
 import org.hornetq.core.config.cluster.QueueConfiguration;
+import org.hornetq.core.remoting.Interceptor;
 import org.hornetq.core.server.JournalType;
 import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
 
 /**
  * 
- * A Configuration
+ * A Configuration is used to configure HornetQ servers.
  * 
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  *
  */
 public interface Configuration extends Serializable
 {
-   public void start() throws Exception;
-
-   public void stop() throws Exception;
-
-   public boolean isStarted();
-
    // General attributes -------------------------------------------------------------------
 
+   /**
+    * Returns whether this server is clustered.
+    */
    boolean isClustered();
 
    void setClustered(boolean clustered);
 
+   /**
+    * Returns whether delivery count is persisted before messages are delivered to the consumers.
+    */
    boolean isPersistDeliveryCountBeforeDelivery();
 
    void setPersistDeliveryCountBeforeDelivery(boolean persistDeliveryCountBeforeDelivery);
 
+   /**
+    * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
+    * <br>
+    * If a backup server has been activated, returns {@code false}.
+    */
    boolean isBackup();
 
    void setBackup(boolean backup);
 
+   /**
+    * Returns whether this server shares its data store with a corresponding live or backup server.
+    */
    boolean isSharedStore();
 
    void setSharedStore(boolean sharedStore);
@@ -65,6 +74,9 @@
 
    void setFileDeploymentEnabled(boolean enable);
 
+   /**
+    * Returns whether this server is using persistence and store data.
+    */
    boolean isPersistenceEnabled();
 
    void setPersistenceEnabled(boolean enable);
@@ -73,18 +85,30 @@
 
    void setFileDeployerScanPeriod(long period);
 
+   /**
+    * Returns the maximum number of threads in the thread pool.
+    */
    int getThreadPoolMaxSize();
 
    void setThreadPoolMaxSize(int maxSize);
 
+   /**
+    * Returns the maximum number of threads in the <em>scheduled</em> thread pool.
+    */
    int getScheduledThreadPoolMaxSize();
 
    void setScheduledThreadPoolMaxSize(int maxSize);
 
+   /**
+    * Returns the interval time (in milliseconds) to invalidate security credentials.
+    */
    long getSecurityInvalidationInterval();
 
    void setSecurityInvalidationInterval(long interval);
 
+   /**
+    * Returns whether security is enabled for this server.
+    */
    boolean isSecurityEnabled();
 
    void setSecurityEnabled(boolean enabled);
@@ -97,10 +121,20 @@
 
    void setJMXDomain(String domain);
 
+   /**
+    * Returns the list of interceptors used by this server.
+    * 
+    * @see Interceptor
+    */
    List<String> getInterceptorClassNames();
 
    void setInterceptorClassNames(List<String> interceptors);
 
+   /**
+    * Returns the connection time to live.
+    * <br>
+    * This value overrides the connection time to live <em>sent by the client</em>.
+    */
    long getConnectionTTLOverride();
 
    void setConnectionTTLOverride(long ttl);
@@ -113,10 +147,18 @@
 
    void setAcceptorConfigurations(Set<TransportConfiguration> infos);
 
+   /**
+    * Returns the connectors configured for this server.
+    */
    Map<String, TransportConfiguration> getConnectorConfigurations();
 
    void setConnectorConfigurations(Map<String, TransportConfiguration> infos);
 
+   /**
+    * Returns the name of the connector used to connect to the backup.
+    * <br>
+    * If this server has no backup or is itself a backup, the value is {@code null}.
+    */
    String getBackupConnectorName();
 
    void setBackupConnectorName(String name);
@@ -149,10 +191,20 @@
 
    void setQueueConfigurations(final List<QueueConfiguration> configs);
 
-   SimpleString getManagementAddress();
+   /**
+    * Returns the management address of this server.
+    * <br>
+    * Clients can send management messages to this address to manage this server.
+    */
+    SimpleString getManagementAddress();
 
    void setManagementAddress(SimpleString address);
 
+   /**
+    * Returns the management notification address of this server.
+    * <br>
+    * Clients can bind queues to this address to receive management notifications emitted by this server.
+    */
    SimpleString getManagementNotificationAddress();
 
    void setManagementNotificationAddress(SimpleString address);
@@ -165,10 +217,16 @@
 
    void setManagementClusterPassword(String password);
 
+   /**
+    * Returns the size of the cache for pre-creating message IDs.
+    */
    int getIDCacheSize();
 
    void setIDCacheSize(int idCacheSize);
 
+   /**
+    * Returns whether message ID cache is persisted.
+    */
    boolean isPersistIDCache();
 
    void setPersistIDCache(boolean persist);
@@ -179,48 +237,81 @@
 
    // Journal related attributes ------------------------------------------------------------
 
+   /**
+    * Returns the file system directory used to store bindings.
+    */
    String getBindingsDirectory();
 
    void setBindingsDirectory(String dir);
 
+   /**
+    * Returns the file system directory used to store journal log.
+    */
    String getJournalDirectory();
 
    void setJournalDirectory(String dir);
 
+   /**
+    * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).
+    */
    JournalType getJournalType();
 
    void setJournalType(JournalType type);
 
+   /**
+    * Returns whether the journal is synchronized when receiving transactional data.
+    */
    boolean isJournalSyncTransactional();
 
    void setJournalSyncTransactional(boolean sync);
 
+   /**
+    * Returns whether the journal is synchronized when receiving non-transactional data.
+    */
    boolean isJournalSyncNonTransactional();
 
    void setJournalSyncNonTransactional(boolean sync);
 
+   /**
+    * Returns the size (in bytes) of each journal files.
+    */
    int getJournalFileSize();
 
    void setJournalFileSize(int size);
 
+   /**
+    * Returns the minimal number of journal files before compacting.
+    */
    int getJournalCompactMinFiles();
 
    void setJournalCompactMinFiles(int minFiles);
 
+   /**
+    * Return the percentage of live data before compacting the journal.
+    */
    int getJournalCompactPercentage();
 
    void setJournalCompactPercentage(int percentage);
 
+   /**
+    * Returns the number of journal files to pre-create.
+    */
    int getJournalMinFiles();
 
    void setJournalMinFiles(int files);
 
    // AIO and NIO need different values for these params
 
+   /**
+    * Returns the maximum number of write requests that can be in the AIO queue at any given time.
+    */
    int getJournalMaxIO_AIO();
 
    void setJournalMaxIO_AIO(int journalMaxIO);
 
+   /**
+    * Returns the timeout (in nanoseconds) used to flush buffers in the AIO queueu.
+    */
    int getJournalBufferTimeout_AIO();
 
    void setJournalBufferTimeout_AIO(int journalBufferTimeout);
@@ -241,10 +332,16 @@
 
    void setJournalBufferSize_NIO(int journalBufferSize);
 
+   /**
+    * Returns whether the bindings directory is created on this server startup.
+    */
    boolean isCreateBindingsDir();
 
    void setCreateBindingsDir(boolean create);
 
+   /**
+    * Returns whether the journal directory is created on this server startup.
+    */
    boolean isCreateJournalDir();
 
    void setCreateJournalDir(boolean create);
@@ -277,44 +374,82 @@
 
    // Paging Properties --------------------------------------------------------------------
 
+   /**
+    * Returns the file system directory used to store paging files.
+    */
    String getPagingDirectory();
 
    void setPagingDirectory(String dir);
 
    // Large Messages Properties ------------------------------------------------------------
 
+   /**
+    * Returns the file system directory used to store large messages.
+    */
    String getLargeMessagesDirectory();
 
    void setLargeMessagesDirectory(String directory);
 
    // Other Properties ---------------------------------------------------------------------
 
+   /**
+    * Returns whether wildcard routing is supported by this server.
+    */
    boolean isWildcardRoutingEnabled();
 
    void setWildcardRoutingEnabled(boolean enabled);
 
+   /**
+    * Returns the timeout (in milliseconds) after which transactions is removed 
+    * from the resource manager after it was created.
+    */
    long getTransactionTimeout();
 
    void setTransactionTimeout(long timeout);
 
+   /**
+    * Returns whether message counter is enabled for this server.
+    */
    boolean isMessageCounterEnabled();
 
    void setMessageCounterEnabled(boolean enabled);
 
+   /**
+    * Returns the sample period (in milliseconds) to take message counter snapshot.
+    */
    long getMessageCounterSamplePeriod();
 
+   /**
+    * Returns the maximum number of days kept in memory for message counter.
+    */
    int getMessageCounterMaxDayHistory();
 
+   /**
+    * Sets the maximum number of days kept in memory for message counter.
+    * 
+    * @param count value must be greater than 0
+    */
    void setMessageCounterMaxDayHistory(int maxDayHistory);
 
+   /**
+    * Returns the frequency (in milliseconds)  to scan transactions to detect which transactions 
+    * have timed out.
+    */
    long getTransactionTimeoutScanPeriod();
 
    void setTransactionTimeoutScanPeriod(long period);
 
+   /**
+    * Returns the frequency (in milliseconds)  to scan messages to detect which messages 
+    * have expired.
+    */
    long getMessageExpiryScanPeriod();
 
    void setMessageExpiryScanPeriod(long messageExpiryScanPeriod);
 
+   /**
+    * Returns the priority of the thread used to scan message expiration.
+    */
    int getMessageExpiryThreadPriority();
 
    void setMessageExpiryThreadPriority(int messageExpiryThreadPriority);

Modified: trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -317,19 +317,6 @@
 
    // Public -------------------------------------------------------------------------
 
-   public void start() throws Exception
-   {
-   }
-
-   public void stop() throws Exception
-   {
-   }
-
-   public boolean isStarted()
-   {
-      return true;
-   }
-
    public boolean isClustered()
    {
       return clustered;

Modified: trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -444,8 +444,6 @@
 
    public synchronized void stop() throws Exception
    {
-      super.stop();
-
       started = false;
    }
 

Modified: trunk/src/main/org/hornetq/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/HornetQServerControl.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/src/main/org/hornetq/core/management/HornetQServerControl.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -15,8 +15,8 @@
 
 import javax.management.MBeanOperationInfo;
 
+import org.hornetq.core.config.Configuration;
 import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.remoting.Interceptor;
 import org.hornetq.core.server.management.Operation;
 import org.hornetq.core.server.management.Parameter;
 
@@ -28,9 +28,7 @@
    // Attributes ----------------------------------------------------
 
    /**
-    * Returns the name of the connector used to connect to the backup.
-    * <br>
-    * If this server has no backup or is itself a backup, the value is {@code null}.
+    * @see Configuration#getBackupConnectorName()
     */
    String getBackupConnectorName();
 
@@ -50,131 +48,136 @@
    boolean isStarted();
 
    /**
-    * Returns the list of interceptors used by this server.
-    * 
-    * @see Interceptor
+    * @see Configuration#getInterceptorClassNames()
     */
    String[] getInterceptorClassNames();
 
    /**
-    * Returns whether this server is clustered.
+    * @see Configuration#isClustered()
     */
    boolean isClustered();
 
    /**
-    * Returns the maximum number of threads in the <em>scheduled</em> thread pool.
+    * @see Configuration#getScheduledThreadPoolMaxSize()
     */
    int getScheduledThreadPoolMaxSize();
 
    /**
-    * Returns the maximum number of threads in the thread pool.
+    * @see Configuration#getThreadPoolMaxSize()
     */
    int getThreadPoolMaxSize();
 
    /**
-    * Returns the interval time (in milliseconds) to invalidate security credentials.
+    * @see Configuration#getSecurityInvalidationInterval()
     */
    long getSecurityInvalidationInterval();
 
    /**
-    * Returns whether security is enabled for this server.
+    * @see Configuration#isSecurityEnabled()
     */
    boolean isSecurityEnabled();
 
    /**
-    * Returns the file system directory used to store bindings.
+    * @see Configuration#getBindingsDirectory()
     */
    String getBindingsDirectory();
 
    /**
-    * Returns the file system directory used to store journal log.
+    * @see Configuration#getJournalDirectory()
     */
    String getJournalDirectory();
 
    /**
-    * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).
+    * @see Configuration#getJournalType()
     */
    String getJournalType();
 
    /**
-    * Returns whether the journal is synchronized when receiving transactional data.
+    * @see Configuration#isJournalSyncTransactional()
     */
    boolean isJournalSyncTransactional();
 
    /**
-    * Returns whether the journal is synchronized when receiving non-transactional data.
+    * @see Configuration#isJournalSyncNonTransactional()()
     */
    boolean isJournalSyncNonTransactional();
 
    /**
-    * Returns the size (in bytes) of each journal files.
+    * @see Configuration#getJournalFileSize()
     */
    int getJournalFileSize();
 
    /**
-    * Returns the number of journal files to pre-create.
+    * @see Configuration#getJournalMinFiles()
     */
    int getJournalMinFiles();
 
    /**
-    * Returns the maximum number of write requests that can be in the AIO queue at any given time.
+    * Returns the maximum number of write requests that can be in the journal at any given time.
+    *
+    * @see Configuration#getJournalMaxIO_AIO()
+    * @see Configuration#getJournalMaxIO_NIO()
     */
    int getJournalMaxIO();
 
    /**
     * Returns the size of the internal buffer on the journal.
+    * 
+    * @see Configuration#getJournalBufferSize_AIO()
+    * @see Configuration#getJournalBufferSize_NIO()
     */
    int getJournalBufferSize();
 
    /**
     * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal.
+    * 
+    * @see Configuration#getJournalBufferTimeout_AIO()
+    * @see Configuration#getJournalBufferTimeout_NIO()
     */
    int getJournalBufferTimeout();
 
    /**
-    * Returns the minimal number of journal files before compacting.
+    * @see Configuration#getJournalCompactMinFiles()
     */
    int getJournalCompactMinFiles();
 
    /**
-    * Return the percentage of live data before compacting the journal.
+    * @see Configuration#getJournalCompactPercentage()
     */
    int getJournalCompactPercentage();
 
    /**
-    * Returns whether this server is using persistence and store data.
+    * @see Configuration#isPersistenceEnabled()
     */
    boolean isPersistenceEnabled();
 
    /**
-    * Returns whether the bindings directory is created on this server startup.
+    * @see Configuration#isCreateBindingsDir()
     */
    boolean isCreateBindingsDir();
 
    /**
-    * Returns whether the journal directory is created on this server startup.
+    * @see Configuration#isCreateJournalDir()
     */
    boolean isCreateJournalDir();
 
    /**
-    * Returns whether message counter is enabled for this server.
+    * @see Configuration#isMessageCounterEnabled()
     */
    boolean isMessageCounterEnabled();
 
    /**
-    * Returns the maximum number of days kept in memory for message counter.
+    * @see Configuration#getMessageCounterMaxDayHistory()
     */
    int getMessageCounterMaxDayCount();
 
    /**
-    * Sets the maximum number of days kept in memory for message counter.
-    * 
-    * @param count value must be greater than 0
+    * @see Configuration#setMessageCounterMaxDayHistory(int)
     */
    void setMessageCounterMaxDayCount(int count) throws Exception;
 
    /**
-    * Returns the sample period (in milliseconds) to take message counter snapshot.
+    * @see Configuration#getMessageCounterSamplePeriod()
     */
    long getMessageCounterSamplePeriod();
 
@@ -186,98 +189,89 @@
    void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
 
    /**
-    * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
-    * <br>
-    * If a backup server has been activated, returns {@code false}.
+    * @see Configuration#isBackup()
     */
    boolean isBackup();
 
    /**
-    * Returns whether this server shares its data store with a corresponding live or backup server.
+    * @see Configuration#isSharedStore()
     */
    boolean isSharedStore();
 
    /**
-    * Returns the file system directory used to store paging files.
+    * @see Configuration#getPagingDirectory()
     */
    String getPagingDirectory();
 
    /**
-    * Returns whether delivery count is persisted before messages are delivered to the consumers.
+    * @see Configuration#isPersistDeliveryCountBeforeDelivery()
     */
    boolean isPersistDeliveryCountBeforeDelivery();
 
    /**
-    * Returns the connection time to live.
-    * <br>
-    * This value overrides the connection time to live <em>sent by the client</em>.
+    * @see Configuration#getConnectionTTLOverride()
     */
    long getConnectionTTLOverride();
 
    /**
-    * Returns the management address of this server.
-    * <br>
-    * Clients can send management messages to this address to manage this server.
+    * @see Configuration#getManagementAddress()
     */
    String getManagementAddress();
 
    /**
-    * Returns the management notification address of this server.
-    * <br>
-    * Clients can bind queues to this address to receive management notifications emitted by this server.
+    * @see Configuration#getManagementNotificationAddress()
     */
    String getManagementNotificationAddress();
 
    /**
-    * Returns the size of the cache for pre-creating message IDs.
+    * @see Configuration#getIDCacheSize()
     */
    int getIDCacheSize();
 
    /**
-    * Returns whether message ID cache is persisted.
+    * @see Configuration#isPersistIDCache()
     */
    boolean isPersistIDCache();
 
    /**
-    * Returns the file system directory used to store large messages.
+    * @see Configuration#getLargeMessagesDirectory()
     */
    String getLargeMessagesDirectory();
 
    /**
-    * Returns whether wildcard routing is supported by this server.
+    * @see Configuration#isWildcardRoutingEnabled()
     */
    boolean isWildcardRoutingEnabled();
 
    /**
-    * Returns the timeout (in milliseconds) after which transactions is removed 
-    * from the resource manager after it was created.
+    * @see Configuration#getTransactionTimeout()
     */
    long getTransactionTimeout();
 
    /**
-    * Returns the frequency (in milliseconds)  to scan transactions to detect which transactions 
-    * have timed out.
+    * @see Configuration#getTransactionTimeoutScanPeriod()
     */
    long getTransactionTimeoutScanPeriod();
 
    /**
-    * Returns the frequency (in milliseconds)  to scan messages to detect which messages 
-    * have expired.
+    * @see Configuration#getMessageExpiryScanPeriod()
     */
    long getMessageExpiryScanPeriod();
 
    /**
-    * Returns the priority of the thread used to scan message expiration.
+    * @see Configuration#getMessageExpiryThreadPriority()
     */
    long getMessageExpiryThreadPriority();
 
    /**
-    * Returns the connectors configured for this server.
+    * @see Configuration#getConnectorConfigurations()
     */
    Object[] getConnectors() throws Exception;
 
    /**
     * Returns the connectors configured for this server using JSON serialization.
+    * 
+    * @see Configuration#getConnectorConfigurations()
     */
    String getConnectorsAsJSON() throws Exception;
 

Modified: trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/tests/src/org/hornetq/tests/integration/persistence/RestartSMTest.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -86,8 +86,6 @@
 
       Configuration configuration = createDefaultConfig();
 
-      configuration.start();
-
       configuration.setJournalType(JournalType.ASYNCIO);
 
       PostOffice postOffice = new FakePostOffice();

Modified: trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java	2010-01-04 16:15:56 UTC (rev 8706)
+++ trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/DuplicateDetectionUnitTest.java	2010-01-04 16:43:07 UTC (rev 8707)
@@ -98,10 +98,8 @@
 
          PostOffice postOffice = new FakePostOffice();
 
-         configuration.start();
+          configuration.setJournalType(JournalType.ASYNCIO);
 
-         configuration.setJournalType(JournalType.ASYNCIO);
-
          ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(ConfigurationImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE);
 
          journal = new JournalStorageManager(configuration, factory);



More information about the hornetq-commits mailing list