JBoss hornetq SVN: r9161 - in trunk/src/config/jboss-as: non-clustered and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-26 05:16:13 -0400 (Mon, 26 Apr 2010)
New Revision: 9161
Modified:
trunk/src/config/jboss-as/clustered/hornetq-configuration.xml
trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml
Log:
fixed broken AS config
Modified: trunk/src/config/jboss-as/clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as/clustered/hornetq-configuration.xml 2010-04-24 09:23:40 UTC (rev 9160)
+++ trunk/src/config/jboss-as/clustered/hornetq-configuration.xml 2010-04-26 09:16:13 UTC (rev 9161)
@@ -47,7 +47,7 @@
<acceptor name="netty-throughput">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="${jboss.bind.address:localhost}"/>
- <param key="port" value="${hornetq.remoting.netty.batch.port:5445}"/>
+ <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
<param key="batch-delay" value="50"/>
</acceptor>
Modified: trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml
===================================================================
--- trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml 2010-04-24 09:23:40 UTC (rev 9160)
+++ trunk/src/config/jboss-as/non-clustered/hornetq-configuration.xml 2010-04-26 09:16:13 UTC (rev 9161)
@@ -45,7 +45,7 @@
<acceptor name="netty-throughput">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="${jboss.bind.address:localhost}"/>
- <param key="port" value="${hornetq.remoting.netty.batch.port:5445}"/>
+ <param key="port" value="${hornetq.remoting.netty.batch.port:5455}"/>
<param key="batch-delay" value="50"/>
</acceptor>
14 years
JBoss hornetq SVN: r9160 - trunk/src/main/org/hornetq/core/protocol/core/impl.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-24 05:23:40 -0400 (Sat, 24 Apr 2010)
New Revision: 9160
Modified:
trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-315
Modified: trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-04-23 14:44:27 UTC (rev 9159)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-04-24 09:23:40 UTC (rev 9160)
@@ -203,7 +203,7 @@
public Packet sendBlocking(final Packet packet) throws HornetQException
{
- if (connection.isDestroyed())
+ if (closed)
{
throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is destroyed");
}
14 years
JBoss hornetq SVN: r9159 - in trunk: src/main/org/hornetq/jms/client and 1 other directories.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-23 10:44:27 -0400 (Fri, 23 Apr 2010)
New Revision: 9159
Modified:
trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-315
Modified: trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-04-23 13:39:19 UTC (rev 9158)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/ChannelImpl.java 2010-04-23 14:44:27 UTC (rev 9159)
@@ -203,7 +203,7 @@
public Packet sendBlocking(final Packet packet) throws HornetQException
{
- if (closed)
+ if (connection.isDestroyed())
{
throw new HornetQException(HornetQException.NOT_CONNECTED, "Connection is destroyed");
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-04-23 13:39:19 UTC (rev 9158)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-04-23 14:44:27 UTC (rev 9159)
@@ -250,6 +250,8 @@
{
return;
}
+
+ sessionFactory.close();
try
{
@@ -258,17 +260,10 @@
session.close();
}
- // TODO may be a better way of doing this that doesn't involve creating a new session
-
try
{
if (!tempQueues.isEmpty())
{
-// if (initialSession == null)
-// {
-// initialSession = sessionFactory.createSession(username, password, false, true, true, false, 0);
-// }
-
// Remove any temporary queues
for (SimpleString queueName : tempQueues)
@@ -295,8 +290,6 @@
}
}
- sessionFactory.close();
-
closed = true;
}
catch (HornetQException e)
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java 2010-04-23 13:39:19 UTC (rev 9158)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/JMSServerStartStopTest.java 2010-04-23 14:44:27 UTC (rev 9159)
@@ -127,7 +127,25 @@
stop();
}
+
+ // https://jira.jboss.org/jira/browse/HORNETQ-315
+ public void testCloseConnectionAfterServerIsShutdown() throws Exception
+ {
+ start();
+
+ HornetQConnectionFactory jbcf = (HornetQConnectionFactory) HornetQJMSClient.createConnectionFactory(new TransportConfiguration(NettyConnectorFactory.class.getCanonicalName()));
+ jbcf.setBlockOnDurableSend(true);
+ jbcf.setBlockOnNonDurableSend(true);
+ jbcf.setReconnectAttempts(-1);
+
+ Connection conn = jbcf.createConnection();
+
+ stop();
+
+ conn.close();
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
14 years
JBoss hornetq SVN: r9158 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-04-23 09:39:19 -0400 (Fri, 23 Apr 2010)
New Revision: 9158
Modified:
trunk/docs/user-manual/en/appserver-integration.xml
Log:
https://jira.jboss.org/jira/browse/HORNETQ-326: Improve documentation on configuring MDBs and resource adapter
* updated MDB doc
Modified: trunk/docs/user-manual/en/appserver-integration.xml
===================================================================
--- trunk/docs/user-manual/en/appserver-integration.xml 2010-04-23 12:21:46 UTC (rev 9157)
+++ trunk/docs/user-manual/en/appserver-integration.xml 2010-04-23 13:39:19 UTC (rev 9158)
@@ -20,23 +20,23 @@
<title>Application Server Integration and Java EE</title>
<para>HornetQ can be easily installed in JBoss Application Server 4 or later. For details on
installing HornetQ in the JBoss Application Server please refer to quick-start guide.</para>
- <para>Since HornetQ also provides a JCA adaptor, it should also be possible to integrate HornetQ
+ <para>Since HornetQ also provides a JCA adapter, it is also possible to integrate HornetQ
as a JMS provider in other JEE compliant app servers. For instructions on how to integrate a
remote JCA adaptor into another application sever, please consult the other application server's
instructions.</para>
- <para>A JCA Adapter basically controls the inflow of messages to Message Driven Beans and the
+ <para>A JCA Adapter basically controls the inflow of messages to Message-Driven Beans (MDBs) and the
outflow of messages sent from other JEE components, e.g. EJBs and Servlets.</para>
<para>This section explains the basics behind configuring the different JEE components in the
AS.</para>
<section>
- <title>Configuring Message Driven Beans</title>
+ <title>Configuring Message-Driven Beans</title>
<para>The delivery of messages to an MDB using HornetQ is configured on the JCA Adapter via
- a configuration file <literal>ra.xml</literal> which can be found under in the <literal
- >jms-ra.rar</literal> archive of directory. By default this is configured to consume
+ a configuration file <literal>ra.xml</literal> which can be found under the <literal
+ >jms-ra.rar</literal> directory. By default this is configured to consume
messages using an InVM connector from the instance of HornetQ running within the
- application server. A full list of what is configurable is found later in this chapter. </para>
- <para>All MDB's however need to have the destination type and the destination configured.
- The following example shows how this can be done via annotations.</para>
+ application server. The configuration properties are listed later in this chapter. </para>
+ <para>All MDBs however need to have the destination type and the destination configured.
+ The following example shows how this can be done using annotations:</para>
<programlisting>@MessageDriven(name = "MDBExample",
activationConfig =
{
@@ -54,25 +54,29 @@
<para>The <literal>ResourceAdapter</literal> annotation is used to specify which adaptor
should be used. To use this you will need to import <literal
>org.jboss.ejb3.annotation.ResourceAdapter</literal> which can be found in the
- <literal>jboss-ejb3-ext-api.jar</literal> which can be found in the jboss
+ <literal>jboss-ejb3-ext-api.jar</literal> which can be found in the JBoss
repository. Alternatively you can add use a deployment descriptor and add something like
the following to <literal
>jboss.xml</literal><programlisting><message-driven>
<ejb-name>ExampleMDB</ejb-name>
- <resource-adapter-name>quartz-ra.rar</resource-adapter-name>
+ <resource-adapter-name>hornetq-ra.rar</resource-adapter-name>
</message-driven>
</programlisting>You
can also rename the hornetq-ra.rar directory to jms-ra.rar and neither the annotation or
the extra descriptor information will be needed. If you do this you will need to edit
the <literal>jms-ds.xml</literal> datasource file and change <literal>rar-name</literal>
element.</para>
+ <note>
+ <para>HornetQ is the default JMS provider for JBoss AS 6. Starting with this AS version, HornetQ resource
+ adapter is named <literal>jms-ra.rar</literal>.</para>
+ </note>
<para>All the examples shipped with the HornetQ distribution use the annotation.</para>
<section>
- <title>Using Container Managed Transactions</title>
- <para>When an MDB is using Container Managed Transactions (CMT), the delivery of the
+ <title>Using Container-Managed Transactions</title>
+ <para>When an MDB is using Container-Managed Transactions (CMT), the delivery of the
message is done within the scope of a JTA transaction. The commit or rollback of
this transaction is controlled by the container itself. If the transaction is rolled
- back then the message delivery semantics will kick in (by default this is to try and
+ back then the message delivery semantics will kick in (by default, it will try to
redeliver the message up to 10 times before sending to a DLQ). Using annotations
this would be configured as follows:</para>
<programlisting>@MessageDriven(name = "MDB_CMP_TxRequiredExample",
@@ -88,9 +92,8 @@
{
public void onMessage(Message message)...
}</programlisting>
- <para>The <literal>TransactionManagement</literal> annotation tells the container to
- treat this MDB to use Container Managed Persistence. The <literal
- >TransactionAttribute</literal> annotation tells the container that a JTA
+ <para>The <literal>TransactionManagement</literal> annotation tells the container to manage the
+ transaction. The <literal>TransactionAttribute</literal> annotation tells the container that a JTA
transaction is required for this MDB. Note that the only other valid value for this
is <literal>TransactionAttributeType.NOT_SUPPORTED</literal> which tells the
container that this MDB does not support JTA transactions and one should not be
@@ -100,7 +103,7 @@
>MessageDrivenContext</literal>. The code for this would look something
like:</para>
<programlisting> @Resource
- MessageDrivenContext ctx;
+ MessageDrivenContextContext ctx;
public void onMessage(Message message)
{
@@ -113,7 +116,7 @@
ctx.setRollbackOnly();
}
}</programlisting>
- <para>If you don't want the over head of an xa transaction being created every time but
+ <para>If you do not want the overhead of an XA transaction being created every time but
you would still like the message delivered within a transaction (i.e. you are only
using a JMS resource) then you can configure the MDB to use a local transaction.
This would be configured as such:</para>
@@ -133,8 +136,8 @@
}</programlisting>
</section>
<section>
- <title>Using Bean Managed Transactions</title>
- <para>Message driven beans can also be configured to use Bean Managed Transactions
+ <title>Using Bean-Managed Transactions</title>
+ <para>Message-driven beans can also be configured to use Bean-Managed Transactions
(BMT). In this case a User Transaction is created. This would be configured as
follows:</para>
<programlisting>@MessageDriven(name = "MDB_BMPExample",
@@ -150,7 +153,7 @@
{
public void onMessage(Message message)
}</programlisting>
- <para>When using Bean Managed Transactions the message delivery to the MDB will occur
+ <para>When using Bean-Managed Transactions the message delivery to the MDB will occur
outside the scope of the user transaction and use the acknowledge mode specified by
the user with the <literal>acknowledgeMode</literal> property. There are only 2
acceptable values for this <literal>Auto-acknowledge</literal> and <literal
@@ -176,6 +179,7 @@
tx.begin();
//do some stuff within the transaction
+
tx.commit();
}
@@ -186,8 +190,8 @@
}</programlisting>
</section>
<section>
- <title>Using Message Selectors with MDB's</title>
- <para>It is also possible to use MDB's with message selectors. To do this simple define
+ <title>Using Message Selectors with Message-Driven Beans</title>
+ <para>It is also possible to use MDBs with message selectors. To do this simple define
your message selector as follows:</para>
<programlisting>@MessageDriven(name = "MDBMessageSelectorExample",
activationConfig =
@@ -213,7 +217,7 @@
that the sending of the message will be done as part of the JTA transaction being used
by the component.</para>
<para>This means that if the sending of the message fails the overall transaction would
- rollback and the message redelivered. Heres an example of this from within an
+ rollback and the message be redelivered. Heres an example of this from within an
MDB:</para>
<programlisting>@MessageDriven(name = "MDBMessageSendTxExample",
activationConfig =
@@ -274,15 +278,15 @@
}
}</programlisting>
<para>In JBoss Application Server you can use the JMS JCA adapter for sending messages from
- EJBs (including Session, Entity and Message Driven Beans), Servlets (including jsps) and
+ EJBs (including Session, Entity and Message-Driven Beans), Servlets (including jsps) and
custom MBeans.</para>
</section>
<section>
<title>Configuring the JCA Adaptor</title>
<para>The Java Connector Architecture (JCA) Adapter is what allows HornetQ to be integrated
- with JEE components such as MDB's and EJB's. It configures how components such as MDB's
- consume messages from the HornetQ server and also how components such as EJB's or
- Servlet's can send messages.</para>
+ with JEE components such as MDBs and EJBs. It configures how components such as MDBs
+ consume messages from the HornetQ server and also how components such as EJBs or
+ Servlets can send messages.</para>
<para>The HornetQ JCA adapter is deployed via the <literal>jms-ra.rar</literal> archive. The
configuration of the adapter is found in this archive under <literal
>META-INF/ra.xml</literal>.</para>
@@ -293,8 +297,7 @@
<description>The transport type</description>
<config-property-name>ConnectorClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
- <config-property-value>org.hornetq.core.remoting.impl.invm.InVMConnectorF
- actory</config-property-value>
+ <config-property-value>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</config-property-value>
</config-property>
<config-property>
<description>The transport configuration. These values must be in the form of key=val;key=val;</description>
@@ -356,7 +359,7 @@
</inbound-resourceadapter>
</resourceadapter></programlisting>
- <para>There are 3 main parts to this configuration.</para>
+ <para>There are three main parts to this configuration.</para>
<orderedlist>
<listitem>
<para>A set of global properties for the adapter</para>
@@ -367,7 +370,7 @@
</listitem>
<listitem>
<para>The configuration of the inbound part of the adapter. This is used for
- controlling the consumption of messages via MDB's. </para>
+ controlling the consumption of messages via MDBs. </para>
</listitem>
</orderedlist>
<section>
@@ -375,7 +378,7 @@
<para>The first element you see is <literal>resourceadapter-class</literal> which should
be left unchanged. This is the HornetQ resource adapter class.</para>
<para>After that there is a list of configuration properties. This will be where most of
- the configuration is done. The first 2 configure the transport used by the adapter
+ the configuration is done. The first two properties configure the transport used by the adapter
and the rest configure the connection factory itself.
</para>
<note>
14 years
JBoss hornetq SVN: r9157 - in trunk/src/main/org/hornetq/core: transaction/impl and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2010-04-23 08:21:46 -0400 (Fri, 23 Apr 2010)
New Revision: 9157
Modified:
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
Log:
minor tweak
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-04-23 12:21:37 UTC (rev 9156)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-04-23 12:21:46 UTC (rev 9157)
@@ -117,8 +117,6 @@
private volatile boolean started = false;
- // private final Map<SimpleString, Runnable> failureRunners = new HashMap<SimpleString, Runnable>();
-
private final Map<SimpleString, TempQueueCleanerUpper> tempQueueCleannerUppers = new HashMap<SimpleString, TempQueueCleanerUpper>();
private final String name;
Modified: trunk/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2010-04-23 12:21:37 UTC (rev 9156)
+++ trunk/src/main/org/hornetq/core/transaction/impl/TransactionImpl.java 2010-04-23 12:21:46 UTC (rev 9157)
@@ -22,7 +22,6 @@
import org.hornetq.core.journal.IOAsyncTask;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.persistence.StorageManager;
-import org.hornetq.core.postoffice.PostOffice;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.TransactionOperation;
14 years
JBoss hornetq SVN: r9156 - trunk/native/bin.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-04-23 08:21:37 -0400 (Fri, 23 Apr 2010)
New Revision: 9156
Modified:
trunk/native/bin/libHornetQAIO64.so
Log:
recompiling 64bit lib
Modified: trunk/native/bin/libHornetQAIO64.so
===================================================================
(Binary files differ)
14 years
JBoss hornetq SVN: r9155 - in trunk: src/main/org/hornetq/core/journal/impl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-04-22 19:23:33 -0400 (Thu, 22 Apr 2010)
New Revision: 9155
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
trunk/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java
trunk/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/src/main/org/hornetq/utils/HornetQThreadFactory.java
trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java
trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
trunk/tests/src/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
Log:
HORNETQ-366 & HORNETQ-335 - Setting classLoader on ThreadFactory and some Security Manager tweaks
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -14,6 +14,8 @@
import java.io.Serializable;
import java.net.InetAddress;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -87,7 +89,7 @@
private List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors;
private String localBindAddress;
-
+
private String discoveryAddress;
private int discoveryPort;
@@ -141,7 +143,7 @@
private long maxRetryInterval;
private int reconnectAttempts;
-
+
private boolean failoverOnInitialConnection;
private int initialMessagePacketSize;
@@ -157,12 +159,12 @@
private static ScheduledExecutorService globalScheduledThreadPool;
private String groupID;
-
+
private static synchronized ExecutorService getGlobalThreadPool()
{
if (ClientSessionFactoryImpl.globalThreadPool == null)
{
- ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-threads", true);
+ ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-threads", true, getThisClassLoader());
ClientSessionFactoryImpl.globalThreadPool = Executors.newCachedThreadPool(factory);
}
@@ -174,10 +176,10 @@
{
if (ClientSessionFactoryImpl.globalScheduledThreadPool == null)
{
- ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-scheduled-threads", true);
+ ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-global-scheduled-threads", true, getThisClassLoader());
ClientSessionFactoryImpl.globalScheduledThreadPool = Executors.newScheduledThreadPool(HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
-
+
factory);
}
@@ -195,7 +197,7 @@
else
{
ThreadFactory factory = new HornetQThreadFactory("HornetQ-client-factory-threads-" + System.identityHashCode(this),
- true);
+ true, getThisClassLoader());
if (threadPoolMaxSize == -1)
{
@@ -207,7 +209,7 @@
}
factory = new HornetQThreadFactory("HornetQ-client-factory-pinger-threads-" + System.identityHashCode(this),
- true);
+ true, getThisClassLoader());
scheduledThreadPool = Executors.newScheduledThreadPool(scheduledThreadPoolMaxSize, factory);
}
@@ -224,9 +226,9 @@
if (discoveryAddress != null)
{
InetAddress groupAddress = InetAddress.getByName(discoveryAddress);
-
+
InetAddress lbAddress;
-
+
if (localBindAddress != null)
{
lbAddress = InetAddress.getByName(localBindAddress);
@@ -261,7 +263,7 @@
retryInterval,
retryIntervalMultiplier,
maxRetryInterval,
- reconnectAttempts,
+ reconnectAttempts,
failoverOnInitialConnection,
threadPool,
scheduledThreadPool,
@@ -288,8 +290,8 @@
public ClientSessionFactoryImpl(final ClientSessionFactory other)
{
- localBindAddress = other.getLocalBindAddress();
-
+ localBindAddress = other.getLocalBindAddress();
+
discoveryAddress = other.getDiscoveryAddress();
discoveryPort = other.getDiscoveryPort();
@@ -345,7 +347,7 @@
maxRetryInterval = other.getMaxRetryInterval();
reconnectAttempts = other.getReconnectAttempts();
-
+
failoverOnInitialConnection = other.isFailoverOnInitialConnection();
failoverOnServerShutdown = other.isFailoverOnServerShutdown();
@@ -408,7 +410,7 @@
maxRetryInterval = HornetQClient.DEFAULT_MAX_RETRY_INTERVAL;
reconnectAttempts = HornetQClient.DEFAULT_RECONNECT_ATTEMPTS;
-
+
failoverOnInitialConnection = HornetQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
failoverOnServerShutdown = HornetQClient.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
@@ -426,11 +428,11 @@
this.discoveryPort = discoveryPort;
}
-
+
public ClientSessionFactoryImpl(final String localBindAddress, final String discoveryAddress, final int discoveryPort)
{
this();
-
+
this.localBindAddress = localBindAddress;
this.discoveryAddress = discoveryAddress;
@@ -737,7 +739,7 @@
checkWrite();
this.reconnectAttempts = reconnectAttempts;
}
-
+
public synchronized boolean isFailoverOnInitialConnection()
{
return this.failoverOnInitialConnection;
@@ -770,7 +772,7 @@
checkWrite();
connectionLoadBalancingPolicyClassName = loadBalancingPolicyClassName;
}
-
+
public synchronized String getLocalBindAddress()
{
return localBindAddress;
@@ -835,7 +837,7 @@
checkWrite();
initialMessagePacketSize = size;
}
-
+
public ClientSession createSession(final String username,
final String password,
final boolean xa,
@@ -1041,7 +1043,7 @@
retryInterval,
retryIntervalMultiplier,
maxRetryInterval,
- reconnectAttempts,
+ reconnectAttempts,
failoverOnInitialConnection,
threadPool,
scheduledThreadPool,
@@ -1150,20 +1152,39 @@
throw new IllegalStateException("Please specify a load balancing policy class name on the session factory");
}
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
{
- Class<?> clazz = loader.loadClass(connectionLoadBalancingPolicyClassName);
- loadBalancingPolicy = (ConnectionLoadBalancingPolicy)clazz.newInstance();
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Unable to instantiate load balancing policy \"" + connectionLoadBalancingPolicyClassName +
- "\"",
- e);
- }
+ 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);
+ }
+ }
+ });
}
+ private static ClassLoader getThisClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return ClientSessionFactoryImpl.class.getClassLoader();
+ }
+ });
+
+ }
+
private synchronized void updatefailoverManagerArray()
{
failoverManagerArray = new FailoverManager[failoverManagerMap.size()];
Modified: trunk/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/client/impl/FailoverManagerImpl.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -486,10 +486,8 @@
else
{
HornetQException me = new HornetQException(HornetQException.INTERNAL_ERROR,
- "Failed to create session");
+ "Failed to create session", t);
- me.initCause(t);
-
throw me;
}
}
Modified: trunk/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/journal/impl/AIOSequentialFileFactory.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -14,6 +14,8 @@
package org.hornetq.core.journal.impl;
import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -21,6 +23,7 @@
import org.hornetq.core.asyncio.BufferCallback;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
+import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.logging.Logger;
@@ -143,7 +146,7 @@
super.start();
pollerExecutor = Executors.newCachedThreadPool(new HornetQThreadFactory("HornetQ-AIO-poller-pool" + System.identityHashCode(this),
- true));
+ true, getThisClassLoader()));
}
@@ -292,5 +295,18 @@
}
}
}
+
+ private static ClassLoader getThisClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return ClientSessionFactoryImpl.class.getClassLoader();
+ }
+ });
+
+ }
+
}
Modified: trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java
===================================================================
--- trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/journal/impl/AbstractSequentialFileFactory.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -17,12 +17,15 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
+import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.journal.SequentialFile;
import org.hornetq.core.journal.SequentialFileFactory;
import org.hornetq.core.logging.Logger;
@@ -114,7 +117,7 @@
if (isSupportsCallbacks())
{
writeExecutor = Executors.newSingleThreadExecutor(new HornetQThreadFactory("HornetQ-Asynchronous-Persistent-Writes" + System.identityHashCode(this),
- true));
+ true, getThisClassLoader()));
}
}
@@ -186,4 +189,18 @@
return Arrays.asList(fileNames);
}
+
+ private static ClassLoader getThisClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return ClientSessionFactoryImpl.class.getClassLoader();
+ }
+ });
+
+ }
+
+
}
Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -13,6 +13,8 @@
package org.hornetq.core.remoting.server.impl;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -140,6 +142,15 @@
{
return;
}
+
+ ClassLoader tccl =
+ AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
// The remoting service maintains it's own thread pool for handling remoting traffic
// If OIO each connection will have it's own thread
@@ -148,7 +159,7 @@
// to support many hundreds of connections, but the main thread pool must be kept small for better performance
ThreadFactory tFactory = new HornetQThreadFactory("HornetQ-remoting-threads" + System.identityHashCode(this),
- false);
+ false, tccl);
threadPool = Executors.newCachedThreadPool(tFactory);
Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -14,6 +14,8 @@
package org.hornetq.core.server.impl;
import java.lang.management.ManagementFactory;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,6 +39,7 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.HornetQClient;
+import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
import org.hornetq.core.client.impl.FailoverManager;
import org.hornetq.core.client.impl.FailoverManagerImpl;
import org.hornetq.core.config.Configuration;
@@ -903,7 +906,7 @@
{
// Create the pools - we have two pools - one for non scheduled - and another for scheduled
- ThreadFactory tFactory = new HornetQThreadFactory("HornetQ-server-threads" + System.identityHashCode(this), false);
+ ThreadFactory tFactory = new HornetQThreadFactory("HornetQ-server-threads" + System.identityHashCode(this), false, getThisClassLoader());
if (configuration.getThreadPoolMaxSize() == -1)
{
@@ -917,7 +920,7 @@
executorFactory = new OrderedExecutorFactory(threadPool);
scheduledPool = new ScheduledThreadPoolExecutor(configuration.getScheduledThreadPoolMaxSize(),
- new HornetQThreadFactory("HornetQ-scheduled-threads", false));
+ new HornetQThreadFactory("HornetQ-scheduled-threads", false, getThisClassLoader()));
managementService = new ManagementServiceImpl(mbeanServer, configuration);
@@ -1442,6 +1445,19 @@
throw new IllegalArgumentException("Error instantiating class \"" + className + "\"", e);
}
}
+
+ private static ClassLoader getThisClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return ClientSessionFactoryImpl.class.getClassLoader();
+ }
+ });
+
+ }
+
// Inner classes
// --------------------------------------------------------------------------------
Modified: trunk/src/main/org/hornetq/utils/HornetQThreadFactory.java
===================================================================
--- trunk/src/main/org/hornetq/utils/HornetQThreadFactory.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/src/main/org/hornetq/utils/HornetQThreadFactory.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -12,6 +12,8 @@
*/
package org.hornetq.utils;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
@@ -35,24 +37,28 @@
private final int threadPriority;
private final boolean daemon;
+
+ private final ClassLoader tccl;
- public HornetQThreadFactory(final String groupName, final boolean daemon)
+ public HornetQThreadFactory(final String groupName, final boolean daemon, final ClassLoader tccl)
{
- this(groupName, Thread.NORM_PRIORITY, daemon);
+ this(groupName, Thread.NORM_PRIORITY, daemon, tccl);
}
- public HornetQThreadFactory(final String groupName, final int threadPriority, final boolean daemon)
+ public HornetQThreadFactory(final String groupName, final int threadPriority, final boolean daemon, final ClassLoader tccl)
{
group = new ThreadGroup(groupName + "-" + System.identityHashCode(this));
this.threadPriority = threadPriority;
+
+ this.tccl = tccl;
this.daemon = daemon;
}
public Thread newThread(final Runnable command)
{
- Thread t = null;
+ final Thread t;
// attach the thread to a group only if there is no security manager:
// when sandboxed, the code does not have the RuntimePermission modifyThreadGroup
if (System.getSecurityManager() == null)
@@ -64,8 +70,32 @@
t = new Thread(command, "Thread-" + threadCount.getAndIncrement());
}
- t.setDaemon(daemon);
- t.setPriority(threadPriority);
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ t.setDaemon(daemon);
+ t.setPriority(threadPriority);
+ return null;
+ }
+ });
+
+ try
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ t.setContextClassLoader(tccl);
+ return null;
+ }
+ });
+ }
+ catch (java.security.AccessControlException e)
+ {
+ log.warn("Missing privileges to set Thread Context Class Loader on Thread Factory. Using current Thread Context Class Loader");
+ }
+
return t;
}
}
Modified: trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/tests/src/org/hornetq/tests/integration/replication/ReplicationTest.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -677,7 +677,7 @@
{
super.setUp();
- tFactory = new HornetQThreadFactory("HornetQ-ReplicationTest", false);
+ tFactory = new HornetQThreadFactory("HornetQ-ReplicationTest", false, this.getClass().getClassLoader());
executor = Executors.newCachedThreadPool(tFactory);
Modified: trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/tests/src/org/hornetq/tests/unit/core/asyncio/AsynchronousFileTest.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -72,7 +72,7 @@
{
super.setUp();
pollerExecutor = Executors.newCachedThreadPool(new HornetQThreadFactory("HornetQ-AIO-poller-pool" + System.identityHashCode(this),
- false));
+ false, this.getClass().getClassLoader()));
executor = Executors.newSingleThreadExecutor();
}
Modified: trunk/tests/src/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java 2010-04-22 21:53:41 UTC (rev 9154)
+++ trunk/tests/src/org/hornetq/tests/unit/core/asyncio/MultiThreadAsynchronousFileTest.java 2010-04-22 23:23:33 UTC (rev 9155)
@@ -72,7 +72,7 @@
{
super.setUp();
pollerExecutor = Executors.newCachedThreadPool(new HornetQThreadFactory("HornetQ-AIO-poller-pool" + System.identityHashCode(this),
- false));
+ false, this.getClass().getClassLoader()));
executor = Executors.newSingleThreadExecutor();
}
14 years
JBoss hornetq SVN: r9154 - trunk/tests/src/org/hornetq/tests/integration/cluster/failover.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-04-22 17:53:41 -0400 (Thu, 22 Apr 2010)
New Revision: 9154
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
Log:
Fixing another AIO dependency
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2010-04-22 21:52:14 UTC (rev 9153)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverSharedServerTest.java 2010-04-22 21:53:41 UTC (rev 9154)
@@ -19,7 +19,6 @@
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
-import org.hornetq.core.server.JournalType;
import org.hornetq.tests.util.ServiceTestBase;
/**
@@ -47,7 +46,7 @@
configuration.setJournalMaxIO_AIO(1000);
configuration.setJournalDirectory(getJournalDir(backupNode, false));
configuration.setJournalFileSize(100 * 1024);
- configuration.setJournalType(JournalType.ASYNCIO);
+ configuration.setJournalType(getDefaultJournalType());
configuration.setPagingDirectory(getPageDir(backupNode, false));
configuration.setLargeMessagesDirectory(getLargeMessagesDir(backupNode, false));
configuration.setClustered(true);
14 years
JBoss hornetq SVN: r9153 - trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-04-22 17:52:14 -0400 (Thu, 22 Apr 2010)
New Revision: 9153
Modified:
trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java
Log:
Fixing another AIO dependency
Modified: trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java 2010-04-22 20:07:33 UTC (rev 9152)
+++ trunk/tests/src/org/hornetq/tests/integration/core/deployers/impl/QueueDeployerTest.java 2010-04-22 21:52:14 UTC (rev 9153)
@@ -14,6 +14,7 @@
package org.hornetq.tests.integration.core.deployers.impl;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.deployers.DeploymentManager;
import org.hornetq.core.deployers.impl.FileDeploymentManager;
import org.hornetq.core.deployers.impl.QueueDeployer;
@@ -87,7 +88,9 @@
{
super.setUp();
DeploymentManager deploymentManager = new FileDeploymentManager(500);
- server = new HornetQServerImpl();
+ ConfigurationImpl config = new ConfigurationImpl();
+ config.setJournalType(getDefaultJournalType());
+ server = new HornetQServerImpl(config);
server.start();
deployer = new QueueDeployer(deploymentManager, server);
}
14 years
JBoss hornetq SVN: r9152 - in trunk/tests/src/org/hornetq/tests: integration/jms/cluster and 2 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-04-22 16:07:33 -0400 (Thu, 22 Apr 2010)
New Revision: 9152
Modified:
trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
Log:
Fixing a few more AIO dependent tests
Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/bridge/BridgeTestBase.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -88,6 +88,7 @@
serviceConf.setSecurityEnabled(false);
serviceConf.setBackup(backup);
serviceConf.setSharedStore(true);
+ serviceConf.setJournalType(getDefaultJournalType());
serviceConf.setBindingsDirectory(getBindingsDir(id, false));
serviceConf.setJournalMinFiles(2);
serviceConf.setJournalDirectory(getJournalDir(id, false));
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSFailoverTest.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -341,6 +341,7 @@
{
backupConf = new ConfigurationImpl();
backupConf.setSecurityEnabled(false);
+ backupConf.setJournalType(getDefaultJournalType());
backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
backupConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory", backupParams));
@@ -366,6 +367,7 @@
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
liveConf.setSharedStore(true);
+ liveConf.setJournalType(getDefaultJournalType());
liveConf.setBindingsDirectory(getBindingsDir());
liveConf.setJournalMinFiles(2);
liveConf.setJournalDirectory(getJournalDir());
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/JMSReconnectTest.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -324,6 +324,7 @@
Configuration liveConf = new ConfigurationImpl();
liveConf.setSecurityEnabled(false);
+ liveConf.setJournalType(getDefaultJournalType());
liveConf.getAcceptorConfigurations()
.add(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory"));
liveConf.setBindingsDirectory(getBindingsDir());
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/cluster/ReplicatedJMSFailoverTest.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -49,6 +49,7 @@
protected void startServers() throws Exception
{
backupConf = new ConfigurationImpl();
+ backupConf.setJournalType(getDefaultJournalType());
backupConf.setSecurityEnabled(false);
backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
backupConf.getAcceptorConfigurations()
@@ -72,6 +73,7 @@
liveConf = new ConfigurationImpl();
liveConf.setSecurityEnabled(false);
+ liveConf.setJournalType(getDefaultJournalType());
liveConf.getConnectorConfigurations().put("toBackup", new TransportConfiguration(INVM_CONNECTOR_FACTORY, backupParams));
liveConf.setBackupConnectorName("toBackup");
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -25,6 +25,7 @@
import org.hornetq.api.core.management.ObjectNameBuilder;
import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.core.management.RoleInfo;
+import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.messagecounter.impl.MessageCounterManagerImpl;
import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -108,9 +109,12 @@
Assert.assertEquals(conf.isJournalSyncNonTransactional(), serverControl.isJournalSyncNonTransactional());
Assert.assertEquals(conf.getJournalFileSize(), serverControl.getJournalFileSize());
Assert.assertEquals(conf.getJournalMinFiles(), serverControl.getJournalMinFiles());
- Assert.assertEquals(conf.getJournalMaxIO_AIO(), serverControl.getJournalMaxIO());
- Assert.assertEquals(conf.getJournalBufferSize_AIO(), serverControl.getJournalBufferSize());
- Assert.assertEquals(conf.getJournalBufferTimeout_AIO(), serverControl.getJournalBufferTimeout());
+ if (AsynchronousFileImpl.isLoaded())
+ {
+ Assert.assertEquals(conf.getJournalMaxIO_AIO(), serverControl.getJournalMaxIO());
+ Assert.assertEquals(conf.getJournalBufferSize_AIO(), serverControl.getJournalBufferSize());
+ Assert.assertEquals(conf.getJournalBufferTimeout_AIO(), serverControl.getJournalBufferTimeout());
+ }
Assert.assertEquals(conf.isCreateBindingsDir(), serverControl.isCreateBindingsDir());
Assert.assertEquals(conf.isCreateJournalDir(), serverControl.isCreateJournalDir());
Assert.assertEquals(conf.getPagingDirectory(), serverControl.getPagingDirectory());
Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2010-04-22 17:28:41 UTC (rev 9151)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java 2010-04-22 20:07:33 UTC (rev 9152)
@@ -94,7 +94,7 @@
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_DIR, conf.getJournalDirectory());
- Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_TYPE, conf.getJournalType());
+ Assert.assertEquals(getDefaultJournalType(), conf.getJournalType());
Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_SYNC_TRANSACTIONAL, conf.isJournalSyncTransactional());
14 years