JBoss hornetq SVN: r8709 - in trunk/src/main/org/hornetq/core: server/impl and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-01-04 12:12:31 -0500 (Mon, 04 Jan 2010)
New Revision: 8709
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManager.java
trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManagerImpl.java
trunk/src/main/org/hornetq/core/client/impl/ClientProducerCredits.java
trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
trunk/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java
trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
trunk/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java
trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-255
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManager.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManager.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -24,7 +24,9 @@
*/
public interface ClientProducerCreditManager
{
- ClientProducerCredits getCredits(SimpleString address);
+ ClientProducerCredits getCredits(SimpleString address, boolean anon);
+
+ void returnCredits(SimpleString address);
void receiveCredits(SimpleString address, int credits, int offset);
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManagerImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditManagerImpl.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -13,10 +13,12 @@
package org.hornetq.core.client.impl;
-import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
import org.hornetq.SimpleString;
+import org.hornetq.core.logging.Logger;
/**
* A ProducerCreditManager
@@ -27,8 +29,14 @@
*/
public class ClientProducerCreditManagerImpl implements ClientProducerCreditManager
{
- private final Map<SimpleString, ClientProducerCredits> producerCredits = new HashMap<SimpleString, ClientProducerCredits>();
+ private static final Logger log = Logger.getLogger(ClientProducerCreditManagerImpl.class);
+ private static final int MAX_ANON_CREDITS_CACHE_SIZE = 1000;
+
+ private final Map<SimpleString, ClientProducerCredits> producerCredits = new LinkedHashMap<SimpleString, ClientProducerCredits>();
+
+ private final Map<SimpleString, ClientProducerCredits> anonCredits = new LinkedHashMap<SimpleString, ClientProducerCredits>();
+
private final ClientSessionInternal session;
private final int windowSize;
@@ -39,8 +47,8 @@
this.windowSize = windowSize;
}
-
- public synchronized ClientProducerCredits getCredits(final SimpleString address)
+
+ public synchronized ClientProducerCredits getCredits(final SimpleString address, final boolean anon)
{
ClientProducerCredits credits = producerCredits.get(address);
@@ -50,11 +58,46 @@
credits = new ClientProducerCreditsImpl(session, address, windowSize);
producerCredits.put(address, credits);
+
+ if (anon)
+ {
+ addToAnonCache(address, credits);
+ }
}
+ if (!anon)
+ {
+ credits.incrementRefCount();
+
+ //Remove from anon credits (if there)
+ anonCredits.remove(address);
+ }
+ else
+ {
+ credits.setAnon();
+ }
+
return credits;
}
+ public synchronized void returnCredits(final SimpleString address)
+ {
+ ClientProducerCredits credits = producerCredits.get(address);
+
+ if (credits != null && credits.decrementRefCount() == 0)
+ {
+ if (!credits.isAnon())
+ {
+ removeEntry(address, credits);
+ }
+ else
+ {
+ //All the producer refs have been removed but it's been used anonymously too so we add to the anon cache
+ addToAnonCache(address, credits);
+ }
+ }
+ }
+
public synchronized void receiveCredits(final SimpleString address, final int credits, final int offset)
{
ClientProducerCredits cr = producerCredits.get(address);
@@ -82,4 +125,32 @@
producerCredits.clear();
}
+
+ private void addToAnonCache(final SimpleString address, final ClientProducerCredits credits)
+ {
+ anonCredits.put(address, credits);
+
+ if (anonCredits.size() > MAX_ANON_CREDITS_CACHE_SIZE)
+ {
+ //Remove the oldest entry
+
+ Iterator<Map.Entry<SimpleString, ClientProducerCredits>> iter = anonCredits.entrySet().iterator();
+
+ Map.Entry<SimpleString, ClientProducerCredits> oldest = iter.next();
+
+ iter.remove();
+
+ removeEntry(oldest.getKey(), oldest.getValue());
+ }
+ }
+
+ private void removeEntry(final SimpleString address, final ClientProducerCredits credits)
+ {
+ producerCredits.remove(address);
+
+ credits.releaseOutstanding();
+
+ credits.close();
+ }
+
}
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientProducerCredits.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientProducerCredits.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientProducerCredits.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -29,4 +29,14 @@
void reset();
void close();
+
+ void incrementRefCount();
+
+ int decrementRefCount();
+
+ void setAnon();
+
+ boolean isAnon();
+
+ void releaseOutstanding();
}
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -19,7 +19,7 @@
import org.hornetq.core.logging.Logger;
/**
- * A ProducerCredits
+ * A ClientProducerCreditsImpl
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
@@ -38,7 +38,11 @@
private final ClientSessionInternal session;
private int arriving;
-
+
+ private int refCount;
+
+ private boolean anon;
+
public ClientProducerCreditsImpl(final ClientSessionInternal session,
final SimpleString address,
final int windowSize)
@@ -94,7 +98,34 @@
semaphore.release(Integer.MAX_VALUE / 2);
}
-
+
+ public synchronized void incrementRefCount()
+ {
+ refCount++;
+ }
+
+ public synchronized int decrementRefCount()
+ {
+ return --refCount;
+ }
+
+ public synchronized void releaseOutstanding()
+ {
+ int permits = semaphore.drainPermits();
+
+ session.sendProducerCreditsMessage(permits, address);
+ }
+
+ public synchronized boolean isAnon()
+ {
+ return anon;
+ }
+
+ public synchronized void setAnon()
+ {
+ this.anon = true;
+ }
+
private void checkCredits(final int credits)
{
int needed = Math.max(credits, windowSize);
@@ -119,7 +150,6 @@
private void requestCredits(final int credits)
{
-
session.sendProducerCreditsMessage(credits, address);
}
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientProducerImpl.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -111,7 +111,7 @@
if (address != null)
{
- credits = session.getCredits(address);
+ credits = session.getCredits(address, false);
}
else
{
@@ -151,7 +151,7 @@
{
return;
}
-
+
doCleanup();
}
@@ -195,6 +195,11 @@
private void doCleanup()
{
+ if (address != null)
+ {
+ session.returnCredits(address);
+ }
+
session.removeProducer(this);
closed = true;
@@ -211,7 +216,7 @@
msgI.setAddress(address);
// Anonymous
- theCredits = session.getCredits(address);
+ theCredits = session.getCredits(address, true);
}
else
{
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -1047,10 +1047,15 @@
channel.send(new SessionRequestProducerCreditsMessage(credits, address));
}
- public ClientProducerCredits getCredits(final SimpleString address)
+ public ClientProducerCredits getCredits(final SimpleString address, final boolean anon)
{
- return producerCreditManager.getCredits(address);
+ return producerCreditManager.getCredits(address, anon);
}
+
+ public void returnCredits(final SimpleString address)
+ {
+ producerCreditManager.returnCredits(address);
+ }
public void handleReceiveProducerCredits(final SimpleString address, final int credits, final int offset)
{
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionInternal.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -70,7 +70,9 @@
void sendProducerCreditsMessage(int credits, SimpleString address);
- ClientProducerCredits getCredits(SimpleString address);
+ ClientProducerCredits getCredits(SimpleString address, boolean anon);
+
+ void returnCredits(SimpleString address);
void handleReceiveProducerCredits(SimpleString address, int credits, int offset);
}
Modified: trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -519,10 +519,15 @@
session.sendProducerCreditsMessage(credits, address);
}
- public ClientProducerCredits getCredits(final SimpleString address)
+ public ClientProducerCredits getCredits(final SimpleString address, final boolean anon)
{
- return session.getCredits(address);
+ return session.getCredits(address, anon);
}
+
+ public void returnCredits(final SimpleString address)
+ {
+ session.returnCredits(address);
+ }
public void handleReceiveProducerCredits(final SimpleString address, final int credits, final int offset)
{
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-01-04 17:12:31 UTC (rev 8709)
@@ -1485,7 +1485,7 @@
throw new HornetQException(HornetQException.ILLEGAL_STATE, "large-message not initialized on server");
}
- // Immediately release the credits for the continuations- these don't contrinute to the in-memory size
+ // Immediately release the credits for the continuations- these don't contribute to the in-memory size
// of the message
releaseOutStanding(currentLargeMessage, packet.getPacketSize());
@@ -1535,30 +1535,39 @@
final CreditManagerHolder holder = getCreditManagerHolder(address);
int credits = packet.getCredits();
-
- int gotCredits = holder.manager.acquireCredits(credits, new CreditsAvailableRunnable()
+
+ //Requesting -ve credits means returning them
+
+ if (credits < 0)
{
- public boolean run(final int credits)
+ releaseOutStanding(address, -credits);
+ }
+ else
+ {
+ int gotCredits = holder.manager.acquireCredits(credits, new CreditsAvailableRunnable()
{
- synchronized (ServerSessionImpl.this)
+ public boolean run(final int credits)
{
- if (!closed)
+ synchronized (ServerSessionImpl.this)
{
- sendProducerCredits(holder, credits, address);
-
- return true;
+ if (!closed)
+ {
+ sendProducerCredits(holder, credits, address);
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
- else
- {
- return false;
- }
}
+ });
+
+ if (gotCredits > 0)
+ {
+ sendProducerCredits(holder, gotCredits, address);
}
- });
-
- if (gotCredits > 0)
- {
- sendProducerCredits(holder, gotCredits, address);
}
sendResponse(packet, null, false, false);
@@ -1932,7 +1941,12 @@
*/
private void releaseOutStanding(final ServerMessage message, final int credits) throws Exception
{
- CreditManagerHolder holder = getCreditManagerHolder(message.getAddress());
+ releaseOutStanding(message.getAddress(), credits);
+ }
+
+ private void releaseOutStanding(final SimpleString address, final int credits) throws Exception
+ {
+ CreditManagerHolder holder = getCreditManagerHolder(address);
holder.outstandingCredits -= credits;
15 years, 11 months
JBoss hornetq SVN: r8708 - in trunk: src/main/org/hornetq/core/config/impl and 2 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-01-04 11:56:10 -0500 (Mon, 04 Jan 2010)
New Revision: 8708
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/management/HornetQServerControl.java
trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
Log:
HORNETQ-185: API review
* added missing Configuration.setMessageCounterSamplePeriod() method
Modified: trunk/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/Configuration.java 2010-01-04 16:43:07 UTC (rev 8707)
+++ trunk/src/main/org/hornetq/core/config/Configuration.java 2010-01-04 16:56:10 UTC (rev 8708)
@@ -420,6 +420,13 @@
long getMessageCounterSamplePeriod();
/**
+ * Sets the sample period to take message counter snapshot.
+ *
+ * @param newPeriod value must be greater than 1000ms
+ */
+ void setMessageCounterSamplePeriod(long period);
+
+ /**
* Returns the maximum number of days kept in memory for message counter.
*/
int getMessageCounterMaxDayHistory();
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:43:07 UTC (rev 8707)
+++ trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java 2010-01-04 16:56:10 UTC (rev 8708)
@@ -804,6 +804,11 @@
{
return messageCounterSamplePeriod;
}
+
+ public void setMessageCounterSamplePeriod(long period)
+ {
+ this.messageCounterSamplePeriod = period;
+ }
public int getMessageCounterMaxDayHistory()
{
Modified: trunk/src/main/org/hornetq/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/HornetQServerControl.java 2010-01-04 16:43:07 UTC (rev 8707)
+++ trunk/src/main/org/hornetq/core/management/HornetQServerControl.java 2010-01-04 16:56:10 UTC (rev 8708)
@@ -182,9 +182,7 @@
long getMessageCounterSamplePeriod();
/**
- * Sets the sample period to take message counter snapshot.
- *
- * @param newPeriod value must be greater than 1000ms
+ * @see Configuration#setMessageCounterSamplePeriod(long)
*/
void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java 2010-01-04 16:43:07 UTC (rev 8707)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java 2010-01-04 16:56:10 UTC (rev 8708)
@@ -297,6 +297,10 @@
conf.setMessageCounterEnabled(b);
Assert.assertEquals(b, conf.isMessageCounterEnabled());
+ l = RandomUtil.randomPositiveLong();
+ conf.setMessageCounterSamplePeriod(l);
+ Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());
+
i = RandomUtil.randomInt();
conf.setMessageCounterMaxDayHistory(i);
Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory());
@@ -514,6 +518,10 @@
conf.setMessageCounterEnabled(b);
Assert.assertEquals(b, conf.isMessageCounterEnabled());
+ l = RandomUtil.randomPositiveLong();
+ conf.setMessageCounterSamplePeriod(l);
+ Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());
+
i = RandomUtil.randomInt();
conf.setMessageCounterMaxDayHistory(i);
Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory());
15 years, 11 months
JBoss hornetq SVN: r8707 - in trunk: src/main/org/hornetq/core/config/impl and 3 other directories.
by do-not-reply@jboss.org
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@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);
15 years, 11 months
JBoss hornetq SVN: r8706 - trunk.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-01-04 11:15:56 -0500 (Mon, 04 Jan 2010)
New Revision: 8706
Modified:
trunk/build-maven.xml
Log:
added maven target for creating repos files
Modified: trunk/build-maven.xml
===================================================================
--- trunk/build-maven.xml 2010-01-04 14:37:05 UTC (rev 8705)
+++ trunk/build-maven.xml 2010-01-04 16:15:56 UTC (rev 8706)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.0.0.BETA5"/>
+ <property name="hornetq.version" value="2.0.0.GA"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
@@ -103,4 +103,73 @@
</exec>
</target>
+ <target name="updateMavenRepos">
+ <fail unless="hornetq.distro" message="*** Please set the hornetq.distro property i.e. -Dhornetq.distro=foo ***"/>
+ <fail unless="hornetq.repos" message="*** Please set the hornetq.repos property i.e. -Dhornetq.repos=foo ***"/>
+ <property name="src.dir" value="${hornetq.distro}"/>
+ <property name="dest.dir" value="${hornetq.repos}"/>
+
+ <tstamp>
+ <format property="TIMESTAMP" pattern="yyyyMMddhhmmss" locale="en,UK"/>
+ </tstamp>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-bootstrap"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-core"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-jboss-as-integration"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-jms"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-logging"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-transports"/>
+ <param name="libDir" value="${src.dir}/lib"/>
+ </antcall>
+ <mkdir dir="tmpLib"/>
+ <unjar src="${src.dir}/lib/hornetq-ra.rar" dest="tmpLib"/>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-ra"/>
+ <param name="libDir" value="tmpLib"/>
+ </antcall>
+ <delete dir="tmpLib"/>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-core-client"/>
+ <param name="libDir" value="${src.dir}/client"/>
+ </antcall>
+ <antcall target="copyJar">
+ <param name="jarName" value="hornetq-jms-client"/>
+ <param name="libDir" value="${src.dir}/client"/>
+ </antcall>
+ </target>
+
+ <target name="copyJar">
+ <mkdir dir="${dest.dir}/${jarName}/${hornetq.version}"/>
+ <echo file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom"
+ message="<?xml version="1.0" encoding="UTF-8"?><project>${line.separator}
+ <modelVersion>4.0.0</modelVersion>${line.separator}
+ <groupId>org.hornetq</groupId>${line.separator}
+ <artifactId>hornetq-bootstrap</artifactId>${line.separator}
+ <version>${hornetq.version}</version>${line.separator}</project>"/>
+ <copy file="${libDir}/${jarName}.jar" tofile="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar"/>
+ <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar" algorithm="md5"/>
+ <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.jar" algorithm="sha1"/>
+ <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom" algorithm="md5"/>
+ <checksum file="${dest.dir}/${jarName}/${hornetq.version}/${jarName}-${hornetq.version}.pom" algorithm="sha1"/>
+ <replace file="${dest.dir}/${jarName}/maven-metadata.xml" token="</versions>" value=" <version>${hornetq.version}</version>${line.separator} </versions>"/>
+ <replaceregexp flags="g" file="${dest.dir}/${jarName}/maven-metadata.xml" match="<lastUpdated>(.+)</lastUpdated>" replace="<lastUpdated>${TIMESTAMP}</lastUpdated>"/>
+ <checksum file="${dest.dir}/${jarName}/maven-metadata.xml" algorithm="md5"/>
+ <checksum file="${dest.dir}/${jarName}/maven-metadata.xml" algorithm="sha1"/>
+ </target>
+
</project>
\ No newline at end of file
15 years, 11 months
JBoss hornetq SVN: r8705 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-01-04 09:37:05 -0500 (Mon, 04 Jan 2010)
New Revision: 8705
Modified:
trunk/docs/user-manual/en/clusters.xml
Log:
HORNETQ-249: Defect: Round Robin Conn. Load Balancing implementation
* updated the documentation to make it clear that the load-balancing
occurs at the session level from a single session factory.
Modified: trunk/docs/user-manual/en/clusters.xml
===================================================================
--- trunk/docs/user-manual/en/clusters.xml 2009-12-22 14:56:14 UTC (rev 8704)
+++ trunk/docs/user-manual/en/clusters.xml 2010-01-04 14:37:05 UTC (rev 8705)
@@ -420,9 +420,9 @@
</section>
<section id="clusters.client.loadbalancing">
<title>Client-Side Load balancing</title>
- <para>With HornetQ client-side connection load balancing, subsequent client
- connections created using a single factory can be made to different nodes of the
- cluster. This allows connections to spread smoothly across the nodes of a cluster and
+ <para>With HornetQ client-side load balancing, subsequent
+ sessions created using a single session factory can be connected to different nodes of the
+ cluster. This allows sessions to spread smoothly across the nodes of a cluster and
not be "clumped" on any particular node.</para>
<para>The load balancing policy to be used by the client factory is configurable. HornetQ
provides two out-of-the-box load balancing policies and you can also implement
15 years, 11 months