JBoss hornetq SVN: r10771 - branches.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-06-03 04:14:56 -0400 (Fri, 03 Jun 2011)
New Revision: 10771
Added:
branches/HORNETQ-681/
Log:
for fix jira
13 years, 6 months
JBoss hornetq SVN: r10770 - branches.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-06-03 04:08:27 -0400 (Fri, 03 Jun 2011)
New Revision: 10770
Removed:
branches/HORNETQ-681/
Log:
discard old code change
13 years, 6 months
JBoss hornetq SVN: r10769 - in branches/Branch_2_2_EAP: src/main/org/hornetq/core/paging/cursor/impl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-06-03 00:38:31 -0400 (Fri, 03 Jun 2011)
New Revision: 10769
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
Log:
JBPAPP-6466 / HORNETQ-706 - small tweaks only
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -163,7 +163,7 @@
deliveryCount.incrementAndGet();
if (isTrace)
{
- log.trace("deliveryCount = " + deliveryCount + " for " + this);
+ log.trace("++deliveryCount = " + deliveryCount + " for " + this, new Exception ("trace"));
}
}
@@ -174,6 +174,10 @@
public void decrementDeliveryCount()
{
deliveryCount.decrementAndGet();
+ if (isTrace)
+ {
+ log.trace("--deliveryCount = " + deliveryCount + " for " + this, new Exception ("trace"));
+ }
}
/* (non-Javadoc)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -106,12 +106,14 @@
// We only store the position for redeliveries. They will be read from the SoftCache again during delivery.
private final ConcurrentLinkedQueue<PagePosition> redeliveries = new ConcurrentLinkedQueue<PagePosition>();
+
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public PageSubscriptionImpl(final PageCursorProvider cursorProvider,
+ public PageSubscriptionImpl(final PageCursorProvider cursorProvider,
final PagingStore pageStore,
final StorageManager store,
final Executor executor,
@@ -299,7 +301,17 @@
tx.commit();
}
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "PageSubscriptionImpl [cursorId=" + cursorId + ", queue=" + queue + "]";
+ }
+
private PagedReference getReference(PagePosition pos) throws Exception
{
return cursorProvider.newReference(pos, cursorProvider.getMessage(pos), this);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/paging/impl/PageImpl.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -43,6 +43,7 @@
private static final Logger log = Logger.getLogger(PageImpl.class);
private static final boolean isTrace = log.isTraceEnabled();
+ private static final boolean isDebug = log.isDebugEnabled();
public static final int SIZE_RECORD = DataConstants.SIZE_BYTE + DataConstants.SIZE_INT + DataConstants.SIZE_BYTE;
@@ -106,9 +107,9 @@
public List<PagedMessage> read(StorageManager storage) throws Exception
{
- if (isTrace)
+ if (isDebug)
{
- log.trace("reading page " + this.pageId + " on address = " + storeName);
+ log.debug("reading page " + this.pageId + " on address = " + storeName);
}
ArrayList<PagedMessage> messages = new ArrayList<PagedMessage>();
@@ -238,9 +239,9 @@
storageManager.pageDeleted(storeName, pageId);
}
- if (isTrace)
+ if (isDebug)
{
- log.trace("Deleting pageId=" + pageId + " on store " + storeName);
+ log.debug("Deleting pageId=" + pageId + " on store " + storeName);
}
if (messages != null)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -341,7 +341,9 @@
@Override
public String toString()
{
- return "LargeServerMessage[messageID=" + messageID + ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
+ return "ServerMessage[messageID=" + messageID + ",priority=" + this.getPriority() +
+ ",expiration=[" + (this.getExpiration() != 0 ? new java.util.Date(this.getExpiration()) : "null") + "]" +
+ ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/QueueImpl.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -1502,7 +1502,7 @@
{
if (isTrace)
{
- log.warn("delivery has been running for too long. Scheduling another delivery task now");
+ log.trace("delivery has been running for too long. Scheduling another delivery task now");
}
deliverAsync();
@@ -1530,6 +1530,7 @@
{
ref = null;
}
+
if (ref == null)
{
@@ -1858,13 +1859,13 @@
if (bindingList.getBindings().isEmpty())
{
- QueueImpl.log.warn("Message has exceeded max delivery attempts. No bindings for Dead Letter Address " + deadLetterAddress +
+ QueueImpl.log.warn("Message " + ref + " has exceeded max delivery attempts. No bindings for Dead Letter Address " + deadLetterAddress +
" so dropping it");
}
else
{
- QueueImpl.log.warn("Message has reached maximum delivery attempts, sending it to Dead Letter Address " + deadLetterAddress +
+ QueueImpl.log.warn("Message " + ref + " has reached maximum delivery attempts, sending it to Dead Letter Address " + deadLetterAddress +
" from " +
name);
move(deadLetterAddress, ref, false, false);
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -314,14 +314,17 @@
private void doSend(final Message message, final long timeToLive, HornetQDestination destination) throws JMSException
{
- if (timeToLive == 0)
+ if (message.getJMSExpiration() != 0)
{
- message.setJMSExpiration(0);
+ if (timeToLive == 0)
+ {
+ message.setJMSExpiration(0);
+ }
+ else
+ {
+ message.setJMSExpiration(System.currentTimeMillis() + timeToLive);
+ }
}
- else
- {
- message.setJMSExpiration(System.currentTimeMillis() + timeToLive);
- }
if (!disableMessageTimestamp)
{
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-06-02 21:17:51 UTC (rev 10768)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/util/UnitTestCase.java 2011-06-03 04:38:31 UTC (rev 10769)
@@ -957,8 +957,6 @@
{
OperationContextImpl.clearContext();
- deleteDirectory(new File(getTestDir()));
-
int invmSize = InVMRegistry.instance.size();
if (invmSize > 0)
{
13 years, 6 months
JBoss hornetq SVN: r10768 - branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools.
by do-not-reply@jboss.org
Author: jicken
Date: 2011-06-02 17:17:51 -0400 (Thu, 02 Jun 2011)
New Revision: 10768
Modified:
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java
Log:
made jaxb encoding system dependent
Modified: branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java
===================================================================
--- branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java 2011-06-02 21:17:28 UTC (rev 10767)
+++ branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java 2011-06-02 21:17:51 UTC (rev 10768)
@@ -289,7 +289,8 @@
JAXBContext jc = JAXBContext.newInstance(HornetQExport.class);
Marshaller m = jc.createMarshaller();
- m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ //m.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
+ m.setProperty(Marshaller.JAXB_ENCODING, System.getProperty("file.encoding"));
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(hqJournalExport, os);
}
13 years, 6 months
JBoss hornetq SVN: r10767 - in branches/Branch_2_2_EAP_export_tool: src/main/org/hornetq/core/persistence/tools and 1 other directory.
by do-not-reply@jboss.org
Author: jicken
Date: 2011-06-02 17:17:28 -0400 (Thu, 02 Jun 2011)
New Revision: 10767
Modified:
branches/Branch_2_2_EAP_export_tool/.gitignore
branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java
Log:
added an optional filename argument for exporting
Modified: branches/Branch_2_2_EAP_export_tool/.gitignore
===================================================================
--- branches/Branch_2_2_EAP_export_tool/.gitignore 2011-06-02 16:33:20 UTC (rev 10766)
+++ branches/Branch_2_2_EAP_export_tool/.gitignore 2011-06-02 21:17:28 UTC (rev 10767)
@@ -1,3 +1,5 @@
+.idea
+classes
target
thirdparty
native
Modified: branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java
===================================================================
--- branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java 2011-06-02 16:33:20 UTC (rev 10766)
+++ branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ExportData.java 2011-06-02 21:17:28 UTC (rev 10767)
@@ -13,33 +13,44 @@
package org.hornetq.core.persistence.tools;
+import org.hornetq.core.journal.impl.SyncSpeedTest;
+
+import java.io.*;
+
/**
* A ExportData
*
* @author clebertsuconic
- *
- *
+ * @author <a href="mailto:torben@jit-consulting.de">Torben Jaeger</a>
*/
-public class ExportData
-{
+public class ExportData {
- public static void main(String args[])
- {
- if (args.length != 2) {
+ public static void main(String args[]) {
+ if (args.length != 2 && args.length != 3) {
// todo: maybe just use a hq-config.xml file as a parameter
- System.out.println("Usage Export: java org.hornetq.core.persistence.tools.ExportData <bindings-dir> <journal-dir>");
+ System.out.println("Usage: java org.hornetq.core.persistence.tools.ExportData <bindings-dir> " +
+ "<journal-dir> [filename]");
+ System.out.println("[filename] is optional. If no filename is given, standard out is used!");
System.exit(-1);
}
- try
- {
- ManageDataTool.exportMessages(args[0], args[1], System.out);
+
+ PrintStream output = System.out;
+ if (args.length == 3) {
+ try {
+ output = new PrintStream(new FileOutputStream(args[2],true));
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
}
- catch (Exception e)
- {
+
+ try {
+ ManageDataTool.exportMessages(args[0], args[1], output);
+ } catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
-
+
}
// Constants -----------------------------------------------------
13 years, 6 months
JBoss hornetq SVN: r10766 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-06-02 12:33:20 -0400 (Thu, 02 Jun 2011)
New Revision: 10766
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
Log:
just committing useful debug
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2011-06-02 15:09:29 UTC (rev 10765)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2011-06-02 16:33:20 UTC (rev 10766)
@@ -274,7 +274,8 @@
public String toString()
{
return "ServerMessage[messageID=" + messageID + ",priority=" + this.getPriority() +
- ",expiration=" + this.getExpiration() + ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
+ ",expiration=" + (this.getExpiration() != 0 ? new java.util.Date(this.getExpiration()) : 0) +
+ ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
}
// FIXME - this is stuff that is only used in large messages
13 years, 6 months
JBoss hornetq SVN: r10765 - in trunk: hornetq-jboss-as-integration and 1 other directories.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-06-02 11:09:29 -0400 (Thu, 02 Jun 2011)
New Revision: 10765
Modified:
trunk/hornetq-jboss-as-integration/pom.xml
trunk/hornetq-jms/pom.xml
trunk/pom.xml
Log:
HORNETQ-712
Modified: trunk/hornetq-jboss-as-integration/pom.xml
===================================================================
--- trunk/hornetq-jboss-as-integration/pom.xml 2011-06-02 05:47:03 UTC (rev 10764)
+++ trunk/hornetq-jboss-as-integration/pom.xml 2011-06-02 15:09:29 UTC (rev 10765)
@@ -27,8 +27,8 @@
<artifactId>jbosssx</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-transaction-api</artifactId>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.integration</groupId>
Modified: trunk/hornetq-jms/pom.xml
===================================================================
--- trunk/hornetq-jms/pom.xml 2011-06-02 05:47:03 UTC (rev 10764)
+++ trunk/hornetq-jms/pom.xml 2011-06-02 15:09:29 UTC (rev 10765)
@@ -19,12 +19,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
+ <groupId>org.jboss.spec.javax.jms</groupId>
+ <artifactId>jboss-jms-api_1.1_spec</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-transaction-api</artifactId>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
</dependency>
<dependency>
<groupId>jboss.jbossts</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-06-02 05:47:03 UTC (rev 10764)
+++ trunk/pom.xml 2011-06-02 15:09:29 UTC (rev 10765)
@@ -144,10 +144,11 @@
</dependency>
<!-- needed to compile JMS-->
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-jms-api</artifactId>
- <version>1.1.0.GA</version>
+ <groupId>org.jboss.spec.javax.jms</groupId>
+ <artifactId>jboss-jms-api_1.1_spec</artifactId>
+ <version>1.0.0.Final</version>
</dependency>
+
<!-- needed to compile JavaEE examples-->
<dependency>
<groupId>org.jboss.javaee</groupId>
@@ -155,10 +156,11 @@
<version>3.0.0.GA</version>
</dependency>
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-transaction-api</artifactId>
- <version>1.0.1.GA</version>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ <version>1.0.0.Final</version>
</dependency>
+
<!--this specifically for the JMS Bridge-->
<dependency>
<groupId>org.jboss.integration</groupId>
13 years, 6 months
JBoss hornetq SVN: r10764 - in branches/HORNETQ-681: hornetq-core/src/main/java/org/hornetq/core/client/impl and 6 other directories.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-06-02 01:47:03 -0400 (Thu, 02 Jun 2011)
New Revision: 10764
Added:
branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/utils/ClassloadingUtil.java
Modified:
branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java
branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/JMSServerManager.java
branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java
branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
HORNETQ-681
Modified: branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java
===================================================================
--- branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/api/core/client/ServerLocator.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -31,19 +31,19 @@
* 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();
-
+
/**
* Create a ClientSessionFactory using whatever load balancing policy is in force
* @return The ClientSessionFactory
* @throws Exception
*/
ClientSessionFactory createSessionFactory() throws Exception;
-
+
/**
* Create a ClientSessionFactory to a specific server. The server must already be known about by this ServerLocator.
* This method allows the user to make a connection to a specific server bypassing any load balancing policy in force
@@ -52,39 +52,39 @@
* @throws Exception if a failure happened in creating the ClientSessionFactory or the ServerLocator does not know about the passed in transportConfiguration
*/
ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration) throws Exception;
-
+
/**
* Returns the period used to check if a client has failed to receive pings from the server.
- *
+ *
* Period is in milliseconds, default value is {@link HornetQClient#DEFAULT_CLIENT_FAILURE_CHECK_PERIOD}.
- *
+ *
* @return the period used to check if a client has failed to receive pings from the server
*/
long getClientFailureCheckPeriod();
/**
* Sets the period (in milliseconds) used to check if a client has failed to receive pings from the server.
- *
+ *
* Value must be -1 (to disable) or greater than 0.
- *
+ *
* @param clientFailureCheckPeriod the period to check failure
*/
void setClientFailureCheckPeriod(long clientFailureCheckPeriod);
/**
* When <code>true</code>, consumers created through this factory will create temporary files to cache large messages.
- *
+ *
* There is 1 temporary file created for each large message.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_CACHE_LARGE_MESSAGE_CLIENT}.
- *
+ *
* @return <code>true</code> if consumers created through this factory will cache large messages in temporary files, <code>false</code> else
*/
boolean isCacheLargeMessagesClient();
/**
* Sets whether large messages received by consumers created through this factory will be cached in temporary files or not.
- *
+ *
* @param cached <code>true</code> to cache large messages in temporary files, <code>false</code> else
*/
void setCacheLargeMessagesClient(boolean cached);
@@ -92,73 +92,73 @@
/**
* Returns the connection <em>time-to-live</em>.
* This TTL determines how long the server will keep a connection alive in the absence of any data arriving from the client.
- *
+ *
* Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_CONNECTION_TTL}.
- *
+ *
* @return the connection time-to-live in milliseconds
*/
long getConnectionTTL();
/**
* Sets this factory's connections <em>time-to-live</em>.
- *
+ *
* Value must be -1 (to disable) or greater or equals to 0.
- *
+ *
* @param connectionTTL period in milliseconds
*/
void setConnectionTTL(long connectionTTL);
/**
* Returns the blocking calls timeout.
- *
+ *
* If client's blocking calls to the server take more than this timeout, the call will throw a {@link HornetQException} with the code {@link HornetQException#CONNECTION_TIMEDOUT}.
* Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_CALL_TIMEOUT}.
- *
+ *
* @return the blocking calls timeout
*/
long getCallTimeout();
/**
* Sets the blocking call timeout.
- *
+ *
* Value must be greater or equals to 0
- *
+ *
* @param callTimeout blocking call timeout in milliseconds
*/
void setCallTimeout(long callTimeout);
/**
* Returns the large message size threshold.
- *
+ *
* Messages whose size is if greater than this value will be handled as <em>large messages</em>.
- *
+ *
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_MIN_LARGE_MESSAGE_SIZE}.
- *
+ *
* @return the message size threshold to treat messages as large messages.
*/
int getMinLargeMessageSize();
/**
* Sets the large message size threshold.
- *
+ *
* Value must be greater than 0.
- *
+ *
* @param minLargeMessageSize large message size threshold in bytes
*/
void setMinLargeMessageSize(int minLargeMessageSize);
/**
* Returns the window size for flow control of the consumers created through this factory.
- *
+ *
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_CONSUMER_WINDOW_SIZE}.
- *
+ *
* @return the window size used for consumer flow control
*/
int getConsumerWindowSize();
/**
* Sets the window size for flow control of the consumers created through this factory.
- *
+ *
* Value must be -1 (to disable flow control), 0 (to not buffer any messages) or greater than 0 (to set the maximum size of the buffer)
*
* @param consumerWindowSize window size (in bytes) used for consumer flow control
@@ -167,37 +167,37 @@
/**
* Returns the maximum rate of message consumption for consumers created through this factory.
- *
+ *
* This value controls the rate at which a consumer can consume messages. A consumer will never consume messages at a rate faster than the rate specified.
- *
+ *
* Value is -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
* Default value is {@link HornetQClient#DEFAULT_CONSUMER_MAX_RATE}.
- *
+ *
* @return the consumer max rate
*/
int getConsumerMaxRate();
/**
* Sets the maximum rate of message consumption for consumers created through this factory.
- *
+ *
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message consumption rate specified in units of messages per second.
- *
+ *
* @param consumerMaxRate maximum rate of message consumption (in messages per seconds)
*/
void setConsumerMaxRate(int consumerMaxRate);
/**
* Returns the size for the confirmation window of clients using this factory.
- *
+ *
* Value is in bytes or -1 (to disable the window). Default value is {@link HornetQClient#DEFAULT_CONFIRMATION_WINDOW_SIZE}.
- *
+ *
* @return the size for the confirmation window of clients using this factory
*/
int getConfirmationWindowSize();
/**
* Sets the size for the confirmation window buffer of clients using this factory.
- *
+ *
* Value must be -1 (to disable the window) or greater than 0.
* @param confirmationWindowSize size of the confirmation window (in bytes)
@@ -206,40 +206,40 @@
/**
* Returns the window size for flow control of the producers created through this factory.
- *
+ *
* Value must be -1 (to disable flow control) or greater than 0 to determine the maximum amount of bytes at any give time (to prevent overloading the connection).
* Default value is {@link HornetQClient#DEFAULT_PRODUCER_WINDOW_SIZE}.
- *
+ *
* @return the window size for flow control of the producers created through this factory.
*/
int getProducerWindowSize();
/**
* Returns the window size for flow control of the producers created through this factory.
- *
+ *
* Value must be -1 (to disable flow control) or greater than 0.
- *
+ *
* @param producerWindowSize window size (in bytest) for flow control of the producers created through this factory.
*/
void setProducerWindowSize(int producerWindowSize);
/**
* Returns the maximum rate of message production for producers created through this factory.
- *
+ *
* This value controls the rate at which a producer can produce messages. A producer will never produce messages at a rate faster than the rate specified.
- *
+ *
* Value is -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
* Default value is {@link HornetQClient#DEFAULT_PRODUCER_MAX_RATE}.
- *
+ *
* @return maximum rate of message production (in messages per seconds)
*/
int getProducerMaxRate();
/**
* Sets the maximum rate of message production for producers created through this factory.
- *
+ *
* Value must -1 (to disable) or a positive integer corresponding to the maximum desired message production rate specified in units of messages per second.
- *
+ *
* @param producerMaxRate maximum rate of message production (in messages per seconds)
*/
void setProducerMaxRate(int producerMaxRate);
@@ -247,9 +247,9 @@
/**
* 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
*/
@@ -258,7 +258,7 @@
/**
* 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
@@ -271,7 +271,7 @@
* <br>
* If the session is configured to send durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
* to be notified once the message has been handled by the server.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_DURABLE_SEND}.
*
* @return whether producers will block while sending persistent messages or do it asynchronously
@@ -280,7 +280,7 @@
/**
* Sets whether producers created through this factory will block while sending <em>durable</em> messages or do it asynchronously.
- *
+ *
* @param blockOnDurableSend <code>true</code> to block when sending durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnDurableSend(boolean blockOnDurableSend);
@@ -290,7 +290,7 @@
* <br>
* If the session is configured to send non-durable message asynchronously, the client can set a SendAcknowledgementHandler on the ClientSession
* to be notified once the message has been handled by the server.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_BLOCK_ON_NON_DURABLE_SEND}.
*
* @return whether producers will block while sending non-durable messages or do it asynchronously
@@ -299,7 +299,7 @@
/**
* Sets whether producers created through this factory will block while sending <em>non-durable</em> messages or do it asynchronously.
- *
+ *
* @param blockOnNonDurableSend <code>true</code> to block when sending non-durable messages or <code>false</code> to send them asynchronously
*/
void setBlockOnNonDurableSend(boolean blockOnNonDurableSend);
@@ -307,11 +307,11 @@
/**
* Returns whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
- *
+ *
* if <code>true</code>, a random unique group ID is created and set on each message for the property
* {@link org.hornetq.api.core.Message#HDR_GROUP_ID}.
* Default value is {@link HornetQClient#DEFAULT_AUTO_GROUP}.
- *
+ *
* @return whether producers will automatically assign a group ID to their messages
*/
boolean isAutoGroup();
@@ -319,23 +319,23 @@
/**
* Sets whether producers created through this factory will automatically
* assign a group ID to the messages they sent.
- *
+ *
* @param autoGroup <code>true</code> to automatically assign a group ID to each messages sent through this factory, <code>false</code> else
*/
void setAutoGroup(boolean autoGroup);
/**
* Returns the group ID that will be eventually set on each message for the property {@link org.hornetq.api.core.Message#HDR_GROUP_ID}.
- *
+ *
* Default value is is <code>null</code> and no group ID will be set on the messages.
- *
+ *
* @return the group ID that will be eventually set on each message
*/
String getGroupID();
-
+
/**
* Sets the group ID that will be set on each message sent through this factory.
- *
+ *
* @param groupID the group ID to use
*/
void setGroupID(String groupID);
@@ -351,7 +351,7 @@
* 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
@@ -360,18 +360,18 @@
/**
* Returns the acknowledgments batch size.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_ACK_BATCH_SIZE}.
- *
+ *
* @return the acknowledgments batch size
*/
int getAckBatchSize();
/**
* Sets the acknowledgments batch size.
- *
+ *
* Value must be equal or greater than 0.
- *
+ *
* @param ackBatchSize
* acknowledgments batch size
*/
@@ -392,9 +392,9 @@
/**
* Returns whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_USE_GLOBAL_POOLS}.
- *
+ *
* @return <code>true</code> if this factory uses global thread pools, <code>false</code> else
*/
boolean isUseGlobalPools();
@@ -402,117 +402,117 @@
/**
* Sets whether this factory will use global thread pools (shared among all the factories in the same JVM)
* or its own pools.
- *
+ *
* @param useGlobalPools <code>true</code> to let this factory uses global thread pools, <code>false</code> else
*/
void setUseGlobalPools(boolean useGlobalPools);
/**
* Returns the maximum size of the scheduled thread pool.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE}.
- *
+ *
* @return the maximum size of the scheduled thread pool.
*/
int getScheduledThreadPoolMaxSize();
/**
* Sets the maximum size of the scheduled thread pool.
- *
+ *
* This setting is relevant only if this factory does not use global pools.
* Value must be greater than 0.
- *
+ *
* @param scheduledThreadPoolMaxSize maximum size of the scheduled thread pool.
*/
void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
/**
* Returns the maximum size of the thread pool.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_THREAD_POOL_MAX_SIZE}.
- *
+ *
* @return the maximum size of the thread pool.
*/
int getThreadPoolMaxSize();
/**
* Sets the maximum size of the thread pool.
- *
+ *
* This setting is relevant only if this factory does not use global pools.
* Value must be -1 (for unlimited thread pool) or greater than 0.
- *
+ *
* @param threadPoolMaxSize maximum size of the thread pool.
*/
void setThreadPoolMaxSize(int threadPoolMaxSize);
/**
- * Returns the time to retry connections created by this factory after failure.
- *
+ * Returns the time to retry connections created by this factory after failure.
+ *
* Value is in milliseconds, default is {@link HornetQClient#DEFAULT_RETRY_INTERVAL}.
- *
+ *
* @return the time to retry connections created by this factory after failure
*/
long getRetryInterval();
/**
* Sets the time to retry connections created by this factory after failure.
- *
+ *
* Value must be greater than 0.
- *
- * @param retryInterval time (in milliseconds) to retry connections created by this factory after failure
+ *
+ * @param retryInterval time (in milliseconds) to retry connections created by this factory after failure
*/
void setRetryInterval(long retryInterval);
/**
* Returns the multiplier to apply to successive retry intervals.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_RETRY_INTERVAL_MULTIPLIER}.
- *
+ *
* @return the multiplier to apply to successive retry intervals
*/
double getRetryIntervalMultiplier();
/**
* Sets the multiplier to apply to successive retry intervals.
- *
+ *
* Value must be positive.
- *
+ *
* @param retryIntervalMultiplier multiplier to apply to successive retry intervals
*/
void setRetryIntervalMultiplier(double retryIntervalMultiplier);
/**
* Returns the maximum retry interval (in the case a retry interval multiplier has been specified).
- *
+ *
* Value is in milliseconds, default value is {@link HornetQClient#DEFAULT_MAX_RETRY_INTERVAL}.
- *
+ *
* @return the maximum retry interval
*/
long getMaxRetryInterval();
/**
* Sets the maximum retry interval.
- *
+ *
* Value must be greater than 0.
- *
+ *
* @param maxRetryInterval maximum retry interval to apply in the case a retry interval multiplier has been specified
*/
void setMaxRetryInterval(long maxRetryInterval);
/**
* Returns the maximum number of attempts to retry connection in case of failure.
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_RECONNECT_ATTEMPTS}.
- *
+ *
* @return the maximum number of attempts to retry connection in case of failure.
*/
int getReconnectAttempts();
/**
* Sets the maximum number of attempts to retry connection in case of failure.
- *
+ *
* Value must be -1 (to retry infinitely), 0 (to never retry connection) or greater than 0.
- *
+ *
* @param reconnectAttempts maximum number of attempts to retry connection in case of failure
*/
void setReconnectAttempts(int reconnectAttempts);
@@ -523,66 +523,66 @@
/**
* Returns true if the client will automatically attempt to connect to the backup server if the initial
* connection to the live server fails
- *
+ *
* Default value is {@link HornetQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}.
*/
boolean isFailoverOnInitialConnection();
-
+
/**
* Sets the value for FailoverOnInitialReconnection
- *
+ *
* @param failover
*/
void setFailoverOnInitialConnection(boolean failover);
/**
* Returns the class name of the connection load balancing policy.
- *
+ *
* Default value is "org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy".
- *
+ *
* @return the class name of the connection load balancing policy
*/
String getConnectionLoadBalancingPolicyClassName();
/**
* Sets the class name of the connection load balancing policy.
- *
+ *
* Value must be the name of a class implementing {@link ConnectionLoadBalancingPolicy}.
- *
+ *
* @param loadBalancingPolicyClassName class name of the connection load balancing policy
*/
void setConnectionLoadBalancingPolicyClassName(String loadBalancingPolicyClassName);
/**
* Returns the initial size of messages created through this factory.
- *
+ *
* Value is in bytes, default value is {@link HornetQClient#DEFAULT_INITIAL_MESSAGE_PACKET_SIZE}.
- *
+ *
* @return the initial size of messages created through this factory
*/
int getInitialMessagePacketSize();
/**
* Sets the initial size of messages created through this factory.
- *
+ *
* Value must be greater than 0.
- *
+ *
* @param size initial size of messages created through this factory.
*/
void setInitialMessagePacketSize(int size);
-
+
/**
* Adds an interceptor which will be executed <em>after packets are received from the server</em>.
- *
+ *
* @param interceptor an Interceptor
*/
void addInterceptor(Interceptor interceptor);
/**
* Removes an interceptor.
- *
+ *
* @param interceptor interceptor to remove
- *
+ *
* @return <code>true</code> if the interceptor is removed from this factory, <code>false</code> else
*/
boolean removeInterceptor(Interceptor interceptor);
@@ -593,12 +593,16 @@
void close();
boolean isHA();
-
+
boolean isCompressLargeMessage();
-
+
void setCompressLargeMessage(boolean compress);
void addClusterTopologyListener(ClusterTopologyListener listener);
void removeClusterTopologyListener(ClusterTopologyListener listener);
+
+ void setUseTCCL(boolean useTCCL);
+
+ boolean isUseTCCL();
}
Modified: branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -18,8 +18,19 @@
import java.net.InetAddress;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.*;
-import java.util.concurrent.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
import org.hornetq.api.core.DiscoveryGroupConfiguration;
import org.hornetq.api.core.HornetQException;
@@ -35,6 +46,7 @@
import org.hornetq.core.cluster.DiscoveryListener;
import org.hornetq.core.cluster.impl.DiscoveryGroupImpl;
import org.hornetq.core.logging.Logger;
+import org.hornetq.utils.ClassloadingUtil;
import org.hornetq.utils.HornetQThreadFactory;
import org.hornetq.utils.UUIDGenerator;
@@ -57,13 +69,13 @@
private final Set<ClusterTopologyListener> topologyListeners = new HashSet<ClusterTopologyListener>();
- private Set<ClientSessionFactory> factories = new HashSet<ClientSessionFactory>();
+ private final Set<ClientSessionFactory> factories = new HashSet<ClientSessionFactory>();
private TransportConfiguration[] initialConnectors;
- private DiscoveryGroupConfiguration discoveryGroupConfiguration;
+ private final DiscoveryGroupConfiguration discoveryGroupConfiguration;
- private StaticConnector staticConnector = new StaticConnector();
+ private final StaticConnector staticConnector = new StaticConnector();
private Topology topology = new Topology();
@@ -157,15 +169,17 @@
private boolean backup;
+ private boolean useTCCL = true;
+
private final Exception e = new Exception();
-
+
// To be called when there are ServerLocator being finalized.
// To be used on test assertions
public static Runnable finalizeCallback = null;
-
+
public static synchronized void clearThreadPools()
{
-
+
if (globalThreadPool != null)
{
globalThreadPool.shutdown();
@@ -184,7 +198,7 @@
globalThreadPool = null;
}
}
-
+
if (globalScheduledThreadPool != null)
{
globalScheduledThreadPool.shutdown();
@@ -283,25 +297,9 @@
throw new IllegalStateException("Please specify a load balancing policy class name on the session factory");
}
- AccessController.doPrivileged(new PrivilegedAction<Object>()
- {
- public Object run()
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
- {
- Class<?> clazz = loader.loadClass(connectionLoadBalancingPolicyClassName);
- loadBalancingPolicy = (ConnectionLoadBalancingPolicy)clazz.newInstance();
- return null;
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Unable to instantiate load balancing policy \"" + connectionLoadBalancingPolicyClassName +
- "\"",
- e);
- }
- }
- });
+ loadBalancingPolicy =
+ (ConnectionLoadBalancingPolicy)ClassloadingUtil.safeInitNewInstance(connectionLoadBalancingPolicyClassName,
+ useTCCL);
}
private synchronized void initialise() throws Exception
@@ -348,13 +346,13 @@
final TransportConfiguration[] transportConfigs)
{
e.fillInStackTrace();
- this.ha = useHA;
+ ha = useHA;
this.discoveryGroupConfiguration = discoveryGroupConfiguration;
- this.initialConnectors = transportConfigs;
+ initialConnectors = transportConfigs;
- this.nodeID = UUIDGenerator.getInstance().generateStringUUID();
+ nodeID = UUIDGenerator.getInstance().generateStringUUID();
clientFailureCheckPeriod = HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
@@ -458,7 +456,7 @@
}
}
- public void start(Executor executor) throws Exception
+ public void start(final Executor executor) throws Exception
{
initialise();
@@ -922,7 +920,7 @@
this.reconnectAttempts = reconnectAttempts;
}
- public void setInitialConnectAttempts(int initialConnectAttempts)
+ public void setInitialConnectAttempts(final int initialConnectAttempts)
{
checkWrite();
this.initialConnectAttempts = initialConnectAttempts;
@@ -935,13 +933,13 @@
public synchronized boolean isFailoverOnInitialConnection()
{
- return this.failoverOnInitialConnection;
+ return failoverOnInitialConnection;
}
public synchronized void setFailoverOnInitialConnection(final boolean failover)
{
checkWrite();
- this.failoverOnInitialConnection = failover;
+ failoverOnInitialConnection = failover;
}
public synchronized String getConnectionLoadBalancingPolicyClassName()
@@ -957,7 +955,7 @@
public TransportConfiguration[] getStaticTransportConfigurations()
{
- return this.initialConnectors;
+ return initialConnectors;
}
public DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()
@@ -1008,9 +1006,9 @@
/* (non-Javadoc)
* @see org.hornetq.api.core.client.ServerLocator#setCompressLargeMessage(boolean)
*/
- public void setCompressLargeMessage(boolean compress)
+ public void setCompressLargeMessage(final boolean compress)
{
- this.compressLargeMessage = compress;
+ compressLargeMessage = compress;
}
private void checkWrite()
@@ -1021,7 +1019,7 @@
}
}
- public void setNodeID(String nodeID)
+ public void setNodeID(final String nodeID)
{
this.nodeID = nodeID;
}
@@ -1031,7 +1029,7 @@
return nodeID;
}
- public void setClusterConnection(boolean clusterConnection)
+ public void setClusterConnection(final boolean clusterConnection)
{
this.clusterConnection = clusterConnection;
}
@@ -1046,9 +1044,9 @@
return clusterTransportConfiguration;
}
- public void setClusterTransportConfiguration(TransportConfiguration tc)
+ public void setClusterTransportConfiguration(final TransportConfiguration tc)
{
- this.clusterTransportConfiguration = tc;
+ clusterTransportConfiguration = tc;
}
public boolean isBackup()
@@ -1056,11 +1054,21 @@
return backup;
}
- public void setBackup(boolean backup)
+ public void setBackup(final boolean backup)
{
this.backup = backup;
}
+ public void setUseTCCL(final boolean useTCCL)
+ {
+ this.useTCCL = useTCCL;
+ }
+
+ public boolean isUseTCCL()
+ {
+ return useTCCL;
+ }
+
@Override
protected void finalize() throws Throwable
{
@@ -1236,13 +1244,13 @@
{
List<DiscoveryEntry> newConnectors = discoveryGroup.getDiscoveryEntries();
- this.initialConnectors = (TransportConfiguration[])Array.newInstance(TransportConfiguration.class,
+ initialConnectors = (TransportConfiguration[])Array.newInstance(TransportConfiguration.class,
newConnectors.size());
int count = 0;
for (DiscoveryEntry entry : newConnectors)
{
- this.initialConnectors[count++] = entry.getConnector();
+ initialConnectors[count++] = entry.getConnector();
}
if (ha && clusterConnection && !receivedTopology && initialConnectors.length > 0)
@@ -1294,7 +1302,7 @@
topologyListeners.remove(listener);
}
- public synchronized void addFactory(ClientSessionFactoryInternal factory)
+ public synchronized void addFactory(final ClientSessionFactoryInternal factory)
{
if (factory != null)
{
@@ -1344,14 +1352,14 @@
try
{
-
+
List<Future<ClientSessionFactory>> futuresList = new ArrayList<Future<ClientSessionFactory>>();
-
+
for (Connector conn : connectors)
{
futuresList.add(threadPool.submit(conn));
}
-
+
for (int i = 0, futuresSize = futuresList.size(); i < futuresSize; i++)
{
Future<ClientSessionFactory> future = futuresList.get(i);
@@ -1359,7 +1367,9 @@
{
csf = future.get();
if (csf != null)
+ {
break;
+ }
}
catch (Exception e)
{
@@ -1423,7 +1433,7 @@
System.identityHashCode(this));
log.warn("The ServerLocator you didn't close was created here:", e);
-
+
if (ServerLocatorImpl.finalizeCallback != null)
{
ServerLocatorImpl.finalizeCallback.run();
@@ -1437,7 +1447,7 @@
class Connector implements Callable<ClientSessionFactory>
{
- private TransportConfiguration initialConnector;
+ private final TransportConfiguration initialConnector;
private volatile ClientSessionFactoryInternal factory;
@@ -1447,7 +1457,7 @@
private Exception e;
- public Connector(TransportConfiguration initialConnector, ClientSessionFactoryInternal factory)
+ public Connector(final TransportConfiguration initialConnector, final ClientSessionFactoryInternal factory)
{
this.initialConnector = initialConnector;
this.factory = factory;
Added: branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/utils/ClassloadingUtil.java
===================================================================
--- branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/utils/ClassloadingUtil.java (rev 0)
+++ branches/HORNETQ-681/hornetq-core/src/main/java/org/hornetq/utils/ClassloadingUtil.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.utils;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * A ClassloadingUtil
+ *
+ * @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+ */
+public final class ClassloadingUtil
+{
+ public static Object safeInitNewInstance(final String className, final boolean useTccl)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = null;
+ if (useTccl)
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ loader = ClassloadingUtil.class.getClassLoader();
+ }
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Error instantiating connector factory \"" + className + "\"", e);
+ }
+ }
+ });
+ }
+
+}
Modified: branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/client/HornetQConnectionFactory.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -38,7 +38,7 @@
/**
* HornetQ implementation of a JMS ConnectionFactory.
- *
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt> $Id$
@@ -65,18 +65,21 @@
private boolean readOnly;
+ private boolean useTCCL = true;
+
// Constructors ---------------------------------------------------------------------------------
public HornetQConnectionFactory()
{
serverLocator = null;
}
-
+
public HornetQConnectionFactory(final ServerLocator serverLocator)
{
this.serverLocator = serverLocator;
-
+
serverLocator.disableFinalizeCheck();
+ serverLocator.setUseTCCL(useTCCL);
}
public HornetQConnectionFactory(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration)
@@ -89,8 +92,9 @@
{
serverLocator = HornetQClient.createServerLocatorWithoutHA(groupConfiguration);
}
-
+
serverLocator.disableFinalizeCheck();
+ serverLocator.setUseTCCL(useTCCL);
}
public HornetQConnectionFactory(final boolean ha, final TransportConfiguration... initialConnectors)
@@ -103,8 +107,9 @@
{
serverLocator = HornetQClient.createServerLocatorWithoutHA(initialConnectors);
}
-
+
serverLocator.disableFinalizeCheck();
+ serverLocator.setUseTCCL(useTCCL);
}
// ConnectionFactory implementation -------------------------------------------------------------
@@ -128,7 +133,7 @@
public QueueConnection createQueueConnection(final String username, final String password) throws JMSException
{
- return (QueueConnection)createConnectionInternal(username, password, false, HornetQConnection.TYPE_QUEUE_CONNECTION);
+ return createConnectionInternal(username, password, false, HornetQConnection.TYPE_QUEUE_CONNECTION);
}
// TopicConnectionFactory implementation --------------------------------------------------------
@@ -140,7 +145,7 @@
public TopicConnection createTopicConnection(final String username, final String password) throws JMSException
{
- return (TopicConnection)createConnectionInternal(username, password, false, HornetQConnection.TYPE_TOPIC_CONNECTION);
+ return createConnectionInternal(username, password, false, HornetQConnection.TYPE_TOPIC_CONNECTION);
}
// XAConnectionFactory implementation -----------------------------------------------------------
@@ -473,7 +478,7 @@
checkWrite();
return serverLocator.getInitialConnectAttempts();
}
-
+
public synchronized boolean isFailoverOnInitialConnection()
{
return serverLocator.isFailoverOnInitialConnection();
@@ -538,22 +543,22 @@
{
return serverLocator.getGroupID();
}
-
+
public boolean isCompressLargeMessage()
{
return serverLocator.isCompressLargeMessage();
}
-
- public void setCompressLargeMessage(boolean compress)
+
+ public void setCompressLargeMessage(final boolean compress)
{
serverLocator.setCompressLargeMessage(compress);
}
-
+
public void close()
{
serverLocator.close();
}
-
+
public ServerLocator getServerLocator()
{
return serverLocator;
@@ -564,7 +569,7 @@
return JMSFactoryType.CF.intValue();
}
/**
- *
+ *
* @deprecated use {@link ServerLocator#createSessionFactory()}
* @return
*/
@@ -582,7 +587,12 @@
throw ex;
}
}
-
+
+ public void setUseTCCL(final boolean useTCCL)
+ {
+ this.useTCCL = useTCCL;
+ }
+
// Package protected ----------------------------------------------------------------------------
// Protected ------------------------------------------------------------------------------------
@@ -595,7 +605,7 @@
readOnly = true;
ClientSessionFactory factory;
-
+
try
{
factory = serverLocator.createSessionFactory();
@@ -603,15 +613,15 @@
catch (Exception e)
{
JMSException jmse = new JMSException("Failed to create session factory");
-
+
jmse.initCause(e);
jmse.setLinkedException(e);
-
+
throw jmse;
}
HornetQConnection connection = null;
-
+
if (isXA)
{
if (type == HornetQConnection.TYPE_GENERIC_CONNECTION)
@@ -676,7 +686,7 @@
dupsOKBatchSize,
transactionBatchSize,
factory);
- }
+ }
}
connection.setReference(this);
try
@@ -708,6 +718,7 @@
}
}
+ @Override
public void finalize() throws Throwable
{
try
Modified: branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/JMSServerManager.java
===================================================================
--- branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/JMSServerManager.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/JMSServerManager.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -18,7 +18,6 @@
import javax.naming.Context;
-import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.security.Role;
import org.hornetq.core.server.HornetQComponent;
@@ -30,7 +29,7 @@
/**
* The JMS Management interface.
- *
+ *
* @author <a href="ataylor(a)redhat.com">Andy Taylor</a>
* @author <a href="jmesnil(a)redhat.com">Jeff Mesnil</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
@@ -41,14 +40,14 @@
/**
* Has the Server been started.
- *
+ *
* @return true if the server us running
*/
boolean isStarted();
/**
* Creates a JMS Queue.
- *
+ *
* @param queueName
* The name of the queue to create
* @param selectorString
@@ -59,7 +58,7 @@
* if problems were encountered creating the queue.
*/
boolean createQueue(boolean storeConfig, String queueName, String selectorString, boolean durable, String ...bindings) throws Exception;
-
+
boolean addTopicToJndi(final String topicName, final String binding) throws Exception;
boolean addQueueToJndi(final String queueName, final String binding) throws Exception;
@@ -68,7 +67,7 @@
/**
* Creates a JMS Topic
- *
+ *
* @param topicName
* the name of the topic
* @param binding
@@ -83,7 +82,7 @@
/**
* Remove the topic from JNDI or BindingRegistry.
* Calling this method does <em>not</em> destroy the destination.
- *
+ *
* @param name
* the name of the destination to remove from JNDI or BindingRegistry
* @return true if removed
@@ -95,7 +94,7 @@
/**
* Remove the topic from JNDI or BindingRegistry.
* Calling this method does <em>not</em> destroy the destination.
- *
+ *
* @param name
* the name of the destination to remove from JNDI or BindingRegistry
* @return true if removed
@@ -107,7 +106,7 @@
/**
* Remove the queue from JNDI or BindingRegistry.
* Calling this method does <em>not</em> destroy the destination.
- *
+ *
* @param name
* the name of the destination to remove from JNDI or BindingRegistry
* @return true if removed
@@ -119,7 +118,7 @@
/**
* Remove the queue from JNDI or BindingRegistry.
* Calling this method does <em>not</em> destroy the destination.
- *
+ *
* @param name
* the name of the destination to remove from JNDI or BindingRegistry
* @return true if removed
@@ -134,7 +133,7 @@
/**
* destroys a queue and removes it from JNDI or BindingRegistry
- *
+ *
* @param name
* the name of the queue to destroy
* @return true if destroyed
@@ -142,16 +141,16 @@
* if a problem occurred destroying the queue
*/
boolean destroyQueue(String name) throws Exception;
-
+
String[] getJNDIOnQueue(String queue);
-
+
String[] getJNDIOnTopic(String topic);
-
+
String[] getJNDIOnConnectionFactory(String factoryName);
/**
* destroys a topic and removes it from JNDI or BindingRegistry
- *
+ *
* @param name
* the name of the topic to destroy
* @return true if the topic was destroyed
@@ -159,8 +158,8 @@
* if a problem occurred destroying the topic
*/
boolean destroyTopic(String name) throws Exception;
-
- /** Call this method to have a CF rebound to JNDI and stored on the Journal
+
+ /** Call this method to have a CF rebound to JNDI and stored on the Journal
* @throws Exception */
HornetQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception;
@@ -168,14 +167,14 @@
void createConnectionFactory(String name,
boolean ha,
- JMSFactoryType cfType,
+ JMSFactoryType cfType,
List<String> connectorNames,
String ... bindings) throws Exception;
void createConnectionFactory(String name,
boolean ha,
- JMSFactoryType cfType,
- List<String> connectorNames,
+ JMSFactoryType cfType,
+ List<String> connectorNames,
String clientID,
long clientFailureCheckPeriod,
long connectionTTL,
@@ -209,7 +208,7 @@
void createConnectionFactory(String name,
boolean ha,
- JMSFactoryType cfType,
+ JMSFactoryType cfType,
String discoveryGroupName,
String clientID,
long clientFailureCheckPeriod,
@@ -230,7 +229,7 @@
boolean preAcknowledge,
String loadBalancingPolicyClassName,
int transactionBatchSize,
- int dupsOKBatchSize,
+ int dupsOKBatchSize,
boolean useGlobalPools,
int scheduledThreadPoolMaxSize,
int threadPoolMaxSize,
@@ -241,12 +240,12 @@
boolean failoverOnInitialConnection,
String groupId,
String ... bindings) throws Exception;
-
+
void createConnectionFactory(boolean storeConfig, ConnectionFactoryConfiguration cfConfig, String... bindings) throws Exception;
/**
* destroys a connection factory.
- *
+ *
* @param name
* the name of the connection factory to destroy
* @return true if the connection factory was destroyed
@@ -266,9 +265,9 @@
String[] listSessions(String connectionID) throws Exception;
String listPreparedTransactionDetailsAsJSON() throws Exception;
-
+
String listPreparedTransactionDetailsAsHTML() throws Exception;
-
+
void setContext(final Context context);
HornetQServer getHornetQServer();
@@ -289,4 +288,6 @@
* @param registry
*/
void setRegistry(BindingRegistry registry);
+
+ void setLoadedByAS7(boolean isAS7);
}
Modified: branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java
===================================================================
--- branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/ConnectionFactoryConfiguration.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -27,25 +27,25 @@
*/
public interface ConnectionFactoryConfiguration extends EncodingSupport
{
-
+
boolean isPersisted();
-
+
String getName();
String[] getBindings();
void setBindings(String[] bindings);
-
+
String getDiscoveryGroupName();
-
+
void setDiscoveryGroupName(String discoveryGroupName);
-
+
List<String> getConnectorNames();
void setConnectorNames(List<String> connectorNames);
-
+
boolean isHA();
-
+
void setHA(boolean ha);
String getClientID();
@@ -71,11 +71,11 @@
int getMinLargeMessageSize();
void setMinLargeMessageSize(int minLargeMessageSize);
-
+
boolean isCompressLargeMessages();
-
- void setCompressLargeMessages(boolean compress);
+ void setCompressLargeMessages(boolean compress);
+
int getConsumerWindowSize();
void setConsumerWindowSize(int consumerWindowSize);
@@ -165,6 +165,10 @@
void setGroupID(String groupID);
void setFactoryType(JMSFactoryType factType);
-
+
JMSFactoryType getFactoryType();
+
+ void setUseTCCL(boolean useTCCL);
+
+ boolean isUseTCCL();
}
Modified: branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
===================================================================
--- branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -26,9 +26,9 @@
/**
* This class contains the configuration properties of a connection factory.
- *
+ *
* It is also persisted on the journal at the time of management is used to created a connection factory and set to store.
- *
+ *
* Every property on this class has to be also set through encoders through EncodingSupport implementation at this class.
*
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
@@ -42,13 +42,13 @@
// Attributes ----------------------------------------------------
private String name;
-
+
private boolean persisted;
private String[] bindings;
private List<String> connectorNames;
-
+
private String discoveryGroupName;
private String clientID = null;
@@ -64,7 +64,7 @@
private boolean cacheLargeMessagesClient = HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
private int minLargeMessageSize = HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-
+
private boolean compressLargeMessage = HornetQClient.DEFAULT_COMPRESS_LARGE_MESSAGES;
private int consumerWindowSize = HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE;
@@ -115,6 +115,8 @@
private JMSFactoryType factoryType = JMSFactoryType.CF;
+ private boolean useTCCL = true;
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -157,7 +159,7 @@
{
return name;
}
-
+
public boolean isPersisted()
{
return persisted;
@@ -174,7 +176,7 @@
/**
* @param discoveryGroupName the discoveryGroupName to set
*/
- public void setDiscoveryGroupName(String discoveryGroupName)
+ public void setDiscoveryGroupName(final String discoveryGroupName)
{
this.discoveryGroupName = discoveryGroupName;
}
@@ -266,7 +268,7 @@
public void setCompressLargeMessages(final boolean compress)
{
- this.compressLargeMessage = compress;
+ compressLargeMessage = compress;
}
public int getConsumerWindowSize()
@@ -507,11 +509,11 @@
public void decode(final HornetQBuffer buffer)
{
persisted = true;
-
+
name = buffer.readSimpleString().toString();
discoveryGroupName = BufferHelper.readNullableSimpleStringAsString(buffer);
-
+
int nConnectors = buffer.readInt();
if (nConnectors > 0)
@@ -521,11 +523,11 @@
for (int i = 0; i < nConnectors; i++)
{
SimpleString str = buffer.readSimpleString();
-
+
connectorNames.add(str.toString());
}
}
-
+
ha = buffer.readBoolean();
clientID = BufferHelper.readNullableSimpleStringAsString(buffer);
@@ -583,7 +585,7 @@
reconnectAttempts = buffer.readInt();
failoverOnInitialConnection = buffer.readBoolean();
-
+
compressLargeMessage = buffer.readBoolean();
groupID = BufferHelper.readNullableSimpleStringAsString(buffer);
@@ -597,12 +599,12 @@
public void encode(final HornetQBuffer buffer)
{
persisted = true;
-
+
BufferHelper.writeAsSimpleString(buffer, name);
BufferHelper.writeAsNullableSimpleString(buffer, discoveryGroupName);
-
- if (this.connectorNames == null)
+
+ if (connectorNames == null)
{
buffer.writeInt(0);
}
@@ -615,7 +617,7 @@
BufferHelper.writeAsSimpleString(buffer, tc);
}
}
-
+
buffer.writeBoolean(ha);
BufferHelper.writeAsNullableSimpleString(buffer, clientID);
@@ -673,7 +675,7 @@
buffer.writeInt(reconnectAttempts);
buffer.writeBoolean(failoverOnInitialConnection);
-
+
buffer.writeBoolean(compressLargeMessage);
BufferHelper.writeAsNullableSimpleString(buffer, groupID);
@@ -689,20 +691,20 @@
int size = BufferHelper.sizeOfSimpleString(name) +
BufferHelper.sizeOfNullableSimpleString(discoveryGroupName);
-
+
size += DataConstants.SIZE_INT;
- if (this.connectorNames != null)
+ if (connectorNames != null)
{
for (String tc : connectorNames)
{
- size += BufferHelper.sizeOfSimpleString(tc);
+ size += BufferHelper.sizeOfSimpleString(tc);
}
}
-
+
size += BufferHelper.sizeOfNullableSimpleString(clientID) +
-
- DataConstants.SIZE_BOOLEAN +
+
+ DataConstants.SIZE_BOOLEAN +
// ha
DataConstants.SIZE_LONG +
@@ -784,8 +786,8 @@
DataConstants.SIZE_BOOLEAN +
// failoverOnInitialConnection
-
- DataConstants.SIZE_BOOLEAN +
+
+ DataConstants.SIZE_BOOLEAN +
// compress-large-message
BufferHelper.sizeOfNullableSimpleString(groupID) +
@@ -805,6 +807,18 @@
return factoryType;
}
+ @Override
+ public void setUseTCCL(final boolean useTCCL)
+ {
+ this.useTCCL = useTCCL;
+ }
+
+ @Override
+ public boolean isUseTCCL()
+ {
+ return useTCCL;
+ }
+
// Public --------------------------------------------------------
// Package protected ---------------------------------------------
Modified: branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-06-02 02:52:22 UTC (rev 10763)
+++ branches/HORNETQ-681/hornetq-jms/src/main/java/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-06-02 05:47:03 UTC (rev 10764)
@@ -107,9 +107,9 @@
*/
private Context context;
- private Map<String, HornetQQueue> queues = new HashMap<String, HornetQQueue>();
+ private final Map<String, HornetQQueue> queues = new HashMap<String, HornetQQueue>();
- private Map<String, HornetQTopic> topics = new HashMap<String, HornetQTopic>();
+ private final Map<String, HornetQTopic> topics = new HashMap<String, HornetQTopic>();
private final Map<String, HornetQConnectionFactory> connectionFactories = new HashMap<String, HornetQConnectionFactory>();
@@ -144,11 +144,13 @@
private JMSStorageManager storage;
+ private boolean isLoadedByAS7 = false;
+
public JMSServerManagerImpl(final HornetQServer server) throws Exception
{
this.server = server;
- this.coreConfig = server.getConfiguration();
+ coreConfig = server.getConfiguration();
configFileName = null;
}
@@ -157,7 +159,7 @@
{
this.server = server;
- this.coreConfig = server.getConfiguration();
+ coreConfig = server.getConfiguration();
this.configFileName = configFileName;
}
@@ -166,14 +168,14 @@
{
this.server = server;
- this.coreConfig = server.getConfiguration();
+ coreConfig = server.getConfiguration();
configFileName = null;
config = configuration;
}
- public JMSServerManagerImpl(HornetQServer server, String configFilename, JMSStorageManager storageManager)
+ public JMSServerManagerImpl(final HornetQServer server, final String configFilename, final JMSStorageManager storageManager)
{
this.server = server;
@@ -250,7 +252,9 @@
if (registry == null)
{
if (!contextSet)
+ {
context = new InitialContext();
+ }
registry = new JndiBindingRegistry(context);
}
@@ -342,7 +346,7 @@
return registry;
}
- public void setRegistry(BindingRegistry registry)
+ public void setRegistry(final BindingRegistry registry)
{
this.registry = registry;
}
@@ -405,11 +409,13 @@
runAfterActive(new RunnableException()
{
+ @Override
public String toString()
{
return "createQueue for " + queueName;
}
+ @Override
public void runException() throws Exception
{
if (internalCreateQueue(queueName, selectorString, durable))
@@ -459,11 +465,13 @@
runAfterActive(new RunnableException()
{
+ @Override
public String toString()
{
return "createTopic for " + topicName;
}
+ @Override
public void runException() throws Exception
{
if (internalCreateTopic(topicName))
@@ -525,17 +533,17 @@
return added;
}
- public String[] getJNDIOnQueue(String queue)
+ public String[] getJNDIOnQueue(final String queue)
{
return getJNDIList(queueJNDI, queue);
}
- public String[] getJNDIOnTopic(String topic)
+ public String[] getJNDIOnTopic(final String topic)
{
return getJNDIList(topicJNDI, topic);
}
- public String[] getJNDIOnConnectionFactory(String factoryName)
+ public String[] getJNDIOnConnectionFactory(final String factoryName)
{
return getJNDIList(connectionFactoryJNDI, factoryName);
}
@@ -589,7 +597,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeQueueFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeQueueFromJNDI(String name, String jndi) throws Exception
+ public boolean removeQueueFromJNDI(final String name, final String jndi) throws Exception
{
checkInitialised();
@@ -607,7 +615,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeQueueFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeQueueFromJNDI(String name) throws Exception
+ public boolean removeQueueFromJNDI(final String name) throws Exception
{
checkInitialised();
@@ -626,7 +634,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeTopicFromJNDI(String name, String jndi) throws Exception
+ public boolean removeTopicFromJNDI(final String name, final String jndi) throws Exception
{
checkInitialised();
@@ -645,7 +653,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeTopicFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeTopicFromJNDI(String name) throws Exception
+ public boolean removeTopicFromJNDI(final String name) throws Exception
{
checkInitialised();
@@ -663,7 +671,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeConnectionFactoryFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeConnectionFactoryFromJNDI(String name, String jndi) throws Exception
+ public boolean removeConnectionFactoryFromJNDI(final String name, final String jndi) throws Exception
{
checkInitialised();
@@ -678,7 +686,7 @@
* @see org.hornetq.jms.server.JMSServerManager#removeConnectionFactoryFromJNDI(java.lang.String, java.lang.String)
*/
- public boolean removeConnectionFactoryFromJNDI(String name) throws Exception
+ public boolean removeConnectionFactoryFromJNDI(final String name) throws Exception
{
checkInitialised();
@@ -749,7 +757,7 @@
final boolean ha,
final JMSFactoryType cfType,
final List<String> connectorNames,
- String... jndiBindings) throws Exception
+ final String... jndiBindings) throws Exception
{
checkInitialised();
HornetQConnectionFactory cf = connectionFactories.get(name);
@@ -763,7 +771,7 @@
public synchronized void createConnectionFactory(final String name,
final boolean ha,
- JMSFactoryType cfType,
+ final JMSFactoryType cfType,
final List<String> connectorNames,
final String clientID,
final long clientFailureCheckPeriod,
@@ -794,7 +802,7 @@
final int reconnectAttempts,
final boolean failoverOnInitialConnection,
final String groupId,
- String... jndiBindings) throws Exception
+ final String... jndiBindings) throws Exception
{
checkInitialised();
HornetQConnectionFactory cf = connectionFactories.get(name);
@@ -925,7 +933,7 @@
}
}
- public synchronized HornetQConnectionFactory recreateCF(String name, ConnectionFactoryConfiguration cf) throws Exception
+ public synchronized HornetQConnectionFactory recreateCF(final String name, final ConnectionFactoryConfiguration cf) throws Exception
{
List<String> jndi = connectionFactoryJNDI.get(name);
@@ -935,7 +943,7 @@
}
String[] usedJNDI = jndi.toArray(new String[jndi.size()]);
-
+
HornetQConnectionFactory realCF = internalCreateCFPOJO(cf);
if (cf.isPersisted())
@@ -946,7 +954,7 @@
for (String jndiElement : usedJNDI)
{
- this.bindToJndi(jndiElement, realCF);
+ bindToJndi(jndiElement, realCF);
}
return realCF;
@@ -959,13 +967,16 @@
runAfterActive(new RunnableException()
{
+ @Override
public String toString()
{
return "createConnectionFactory for " + cfConfig.getName();
}
+ @Override
public void runException() throws Exception
{
+ cfConfig.setUseTCCL(!isLoadedByAS7);
HornetQConnectionFactory cf = internalCreateCF(storeConfig, cfConfig);
@@ -998,9 +1009,9 @@
}
// used on tests only
- public void replaceStorageManager(JMSStorageManager newStorage)
+ public void replaceStorageManager(final JMSStorageManager newStorage)
{
- this.storage = newStorage;
+ storage = newStorage;
}
private String[] getJNDIList(final Map<String, List<String>> map, final String name)
@@ -1201,6 +1212,7 @@
cf.setFailoverOnInitialConnection(cfConfig.isFailoverOnInitialConnection());
cf.setCompressLargeMessage(cfConfig.isCompressLargeMessages());
cf.setGroupID(cfConfig.getGroupID());
+ cf.setUseTCCL(cfConfig.isUseTCCL());
return cf;
}
@@ -1392,7 +1404,7 @@
}
}
- private void addToBindings(Map<String, List<String>> map, String name, String... jndi)
+ private void addToBindings(final Map<String, List<String>> map, final String name, final String... jndi)
{
List<String> list = map.get(name);
if (list == null)
@@ -1452,7 +1464,7 @@
/**
* @param param
*/
- private void unbindJNDI(Map<String, List<String>> param)
+ private void unbindJNDI(final Map<String, List<String>> param)
{
if (context != null)
{
@@ -1478,7 +1490,7 @@
*/
private void initJournal() throws Exception
{
- this.coreConfig = server.getConfiguration();
+ coreConfig = server.getConfiguration();
createJournal();
@@ -1628,7 +1640,7 @@
}
}
- private boolean runAfterActive(RunnableException runnable) throws Exception
+ private boolean runAfterActive(final RunnableException runnable) throws Exception
{
if (active)
{
@@ -1660,4 +1672,10 @@
public abstract void runException() throws Exception;
}
+ @Override
+ public void setLoadedByAS7(final boolean isAS7)
+ {
+ isLoadedByAS7 = isAS7;
+ }
+
}
13 years, 6 months
JBoss hornetq SVN: r10763 - branches.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2011-06-01 22:52:22 -0400 (Wed, 01 Jun 2011)
New Revision: 10763
Added:
branches/HORNETQ_650/
Log:
for fixing 650
13 years, 6 months
JBoss hornetq SVN: r10762 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-06-01 14:37:25 -0400 (Wed, 01 Jun 2011)
New Revision: 10762
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
Log:
typo
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2011-06-01 18:26:38 UTC (rev 10761)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/impl/ServerMessageImpl.java 2011-06-01 18:37:25 UTC (rev 10762)
@@ -274,7 +274,7 @@
public String toString()
{
return "ServerMessage[messageID=" + messageID + ",priority=" + this.getPriority() +
- ",expiration" + this.getExpiration() + ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
+ ",expiration=" + this.getExpiration() + ", durable=" + durable + ", address=" + getAddress() + ",properties=" + properties.toString() + "]";
}
// FIXME - this is stuff that is only used in large messages
13 years, 6 months