JBoss hornetq SVN: r11693 - branches.
by do-not-reply@jboss.org
Author: igarashitm
Date: 2011-11-15 12:00:59 -0500 (Tue, 15 Nov 2011)
New Revision: 11693
Removed:
branches/HORNETQ-316_for_2_2_EAP/
Log:
cleanup old branch
13 years, 1 month
JBoss hornetq SVN: r11692 - branches.
by do-not-reply@jboss.org
Author: igarashitm
Date: 2011-11-15 11:59:02 -0500 (Tue, 15 Nov 2011)
New Revision: 11692
Removed:
branches/HORNETQ-316_for-r11196/
Log:
cleanup old branch
13 years, 1 month
JBoss hornetq SVN: r11691 - tags.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-11-12 09:29:39 -0500 (Sat, 12 Nov 2011)
New Revision: 11691
Added:
tags/HornetQ_2_2_9_AS7_Final/
Log:
2.2.9.Final
13 years, 1 month
JBoss hornetq SVN: r11690 - branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-11-12 05:10:54 -0500 (Sat, 12 Nov 2011)
New Revision: 11690
Modified:
branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
Log:
test fix for resource adapter
Modified: branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java
===================================================================
--- branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-11-11 10:13:15 UTC (rev 11689)
+++ branches/Branch_2_2_AS7/tests/src/org/hornetq/tests/integration/ra/HornetQRATestBase.java 2011-11-12 10:10:54 UTC (rev 11690)
@@ -16,8 +16,13 @@
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.integration.jboss.recovery.AS7RecoveryRegistry;
import org.hornetq.jms.client.HornetQMessage;
import org.hornetq.tests.util.ServiceTestBase;
+import org.jboss.msc.service.*;
+import org.jboss.msc.value.Value;
+import org.jboss.tm.XAResourceRecovery;
+import org.jboss.tm.XAResourceRecoveryRegistry;
import javax.jms.Message;
import javax.jms.MessageListener;
@@ -29,9 +34,14 @@
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.*;
import javax.transaction.xa.XAResource;
+import java.io.PrintStream;
import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
import java.util.Timer;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
/**
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
@@ -60,6 +70,7 @@
server = createServer(true, configuration);
server.start();
server.createQueue(MDBQUEUEPREFIXEDSIMPLE, MDBQUEUEPREFIXEDSIMPLE, null, true, false);
+ AS7RecoveryRegistry.container = new DummyServiceContainer();
}
@Override
@@ -84,6 +95,7 @@
}
public abstract boolean isSecure();
+
class DummyMessageEndpointFactory implements MessageEndpointFactory
{
private DummyMessageEndpoint endpoint;
@@ -211,4 +223,247 @@
}
}
}
+
+
+ private static class DummyServiceContainer implements ServiceContainer
+ {
+ public void shutdown()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isShutdownComplete()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addTerminateListener(TerminateListener terminateListener)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void awaitTermination() throws InterruptedException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void awaitTermination(long l, TimeUnit timeUnit) throws InterruptedException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void dumpServices()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void dumpServices(PrintStream printStream)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getName()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceController<?> getRequiredService(ServiceName serviceName) throws ServiceNotFoundException
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceController<?> getService(ServiceName serviceName)
+ {
+ ServiceController<XAResourceRecoveryRegistry> controller = new ServiceController<XAResourceRecoveryRegistry>()
+ {
+ public ServiceController<?> getParent()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceContainer getServiceContainer()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Mode getMode()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean compareAndSetMode(Mode mode, Mode mode1)
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setMode(Mode mode)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public State getState()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Substate getSubstate()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public XAResourceRecoveryRegistry getValue() throws IllegalStateException
+ {
+ XAResourceRecoveryRegistry registry = new XAResourceRecoveryRegistry()
+ {
+ public void addXAResourceRecovery(XAResourceRecovery xaResourceRecovery)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void removeXAResourceRecovery(XAResourceRecovery xaResourceRecovery)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+ };
+ return registry; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Service<XAResourceRecoveryRegistry> getService() throws IllegalStateException
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceName getName()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceName[] getAliases()
+ {
+ return new ServiceName[0]; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addListener(ServiceListener<? super XAResourceRecoveryRegistry> serviceListener)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object> objectServiceListener)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void removeListener(ServiceListener<? super XAResourceRecoveryRegistry> serviceListener)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public StartException getStartException()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void retry()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Set<ServiceName> getImmediateUnavailableDependencies()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+ };
+ return controller; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public List<ServiceName> getServiceNames()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public <T> ServiceBuilder<T> addServiceValue(ServiceName serviceName, Value<? extends Service<T>> value)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public <T> ServiceBuilder<T> addService(ServiceName serviceName, Service<T> tService)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(ServiceListener<Object> objectServiceListener)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(ServiceListener<Object>... serviceListeners)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(Collection<ServiceListener<Object>> serviceListeners)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object> objectServiceListener)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(ServiceListener.Inheritance inheritance, ServiceListener<Object>... serviceListeners)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addListener(ServiceListener.Inheritance inheritance, Collection<ServiceListener<Object>> serviceListeners)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget removeListener(ServiceListener<Object> objectServiceListener)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Set<ServiceListener<Object>> getListeners()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addDependency(ServiceName serviceName)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addDependency(ServiceName... serviceNames)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget addDependency(Collection<ServiceName> serviceNames)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget removeDependency(ServiceName serviceName)
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Set<ServiceName> getDependencies()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public ServiceTarget subTarget()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public BatchServiceTarget batchTarget()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+ }
}
13 years, 1 month
JBoss hornetq SVN: r11689 - in branches/Branch_2_2_AS7: src/config/common and 5 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2011-11-11 05:13:15 -0500 (Fri, 11 Nov 2011)
New Revision: 11689
Added:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/logging/
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/logging/AS7HornetQLoggerFactory.java
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java
Modified:
branches/Branch_2_2_AS7/build-hornetq.xml
branches/Branch_2_2_AS7/build-maven.xml
branches/Branch_2_2_AS7/pom.xml
branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/Util.java
branches/Branch_2_2_AS7/src/main/org/hornetq/ra/recovery/RecoveryManager.java
Log:
added some AS7 integration classes that need to be here for dependency reasons, also updated version for release
Modified: branches/Branch_2_2_AS7/build-hornetq.xml
===================================================================
--- branches/Branch_2_2_AS7/build-hornetq.xml 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/build-hornetq.xml 2011-11-11 10:13:15 UTC (rev 11689)
@@ -233,6 +233,8 @@
<path refid="org.jboss.security.classpath"/>
<path refid="org.jboss.integration.classpath"/>
<path refid="org.jboss.javaee.classpath"/>
+ <path refid="org.jboss.msc.classpath"/>
+ <pathelement location="${org.jboss.logging.lib}/jboss-logging.jar"/>
</path>
<path id="twitter.integration.compilation.classpath">
Modified: branches/Branch_2_2_AS7/build-maven.xml
===================================================================
--- branches/Branch_2_2_AS7/build-maven.xml 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/build-maven.xml 2011-11-11 10:13:15 UTC (rev 11689)
@@ -13,7 +13,7 @@
-->
<project default="upload" name="HornetQ">
- <property name="hornetq.version" value="2.2.7.Final"/>
+ <property name="hornetq.version" value="2.2.9.AS7.Final"/>
<property name="build.dir" value="build"/>
<property name="jars.dir" value="${build.dir}/jars"/>
Modified: branches/Branch_2_2_AS7/pom.xml
===================================================================
--- branches/Branch_2_2_AS7/pom.xml 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/pom.xml 2011-11-11 10:13:15 UTC (rev 11689)
@@ -244,11 +244,17 @@
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
+ <!--needed to compile the integration jar-->
<dependency>
<groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.1.0.GA</version>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.1.0.CR1</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.msc</groupId>
+ <artifactId>jboss-msc</artifactId>
+ <version>1.0.1.GA</version>
+ </dependency>
<!--needed to compile twitter support-->
<dependency>
<groupId>org.twitter4j</groupId>
Modified: branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties
===================================================================
--- branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/src/config/common/hornetq-version.properties 2011-11-11 10:13:15 UTC (rev 11689)
@@ -1,9 +1,9 @@
-hornetq.version.versionName=HQ_2_2_8_FINAL_AS7
+hornetq.version.versionName=HQ_2_2_9_FINAL_AS7
hornetq.version.majorVersion=2
hornetq.version.minorVersion=2
-hornetq.version.microVersion=8
+hornetq.version.microVersion=9
hornetq.version.incrementingVersion=122
-hornetq.version.versionSuffix=CR2
-hornetq.version.versionTag=CR2
+hornetq.version.versionSuffix=GA
+hornetq.version.versionTag=GA
hornetq.netty.version=(a)NETTY.VERSION@
hornetq.version.compatibleVersionList=121,122
Added: branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/logging/AS7HornetQLoggerFactory.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/logging/AS7HornetQLoggerFactory.java (rev 0)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/logging/AS7HornetQLoggerFactory.java 2011-11-11 10:13:15 UTC (rev 11689)
@@ -0,0 +1,829 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.hornetq.integration.jboss.logging;
+
+import org.hornetq.spi.core.logging.LogDelegate;
+import org.hornetq.spi.core.logging.LogDelegateFactory;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Logger.Level;
+
+/**
+ * @author Emanuel Muckenhuber
+ */
+public class AS7HornetQLoggerFactory implements LogDelegateFactory
+{
+
+ /**
+ * {@inheritDoc}
+ */
+ public LogDelegate createDelegate(Class<?> clazz)
+ {
+ return new HornetQLogDelegate(clazz);
+ }
+
+ static class HornetQLogDelegate implements LogDelegate
+ {
+ private final Logger delegate;
+
+ HornetQLogDelegate(Class<?> clazz)
+ {
+ delegate = Logger.getLogger(clazz);
+ }
+
+ public boolean isEnabled(Level level)
+ {
+ return delegate.isEnabled(level);
+ }
+
+ public int hashCode()
+ {
+ return delegate.hashCode();
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return delegate.isTraceEnabled();
+ }
+
+ public boolean equals(Object obj)
+ {
+ return delegate.equals(obj);
+ }
+
+ public void trace(Object message)
+ {
+ delegate.trace(message);
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ delegate.trace(message, t);
+ }
+
+ public void trace(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.trace(loggerFqcn, message, t);
+ }
+
+ public void trace(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.trace(loggerFqcn, message, params, t);
+ }
+
+ public void tracev(String format, Object... params)
+ {
+ delegate.tracev(format, params);
+ }
+
+ public void tracev(String format, Object param1)
+ {
+ delegate.tracev(format, param1);
+ }
+
+ public void tracev(String format, Object param1, Object param2)
+ {
+ delegate.tracev(format, param1, param2);
+ }
+
+ public void tracev(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.tracev(format, param1, param2, param3);
+ }
+
+ public void tracev(Throwable t, String format, Object... params)
+ {
+ delegate.tracev(t, format, params);
+ }
+
+ public void tracev(Throwable t, String format, Object param1)
+ {
+ delegate.tracev(t, format, param1);
+ }
+
+ public void tracev(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.tracev(t, format, param1, param2);
+ }
+
+ public void tracev(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.tracev(t, format, param1, param2, param3);
+ }
+
+ public String toString()
+ {
+ return delegate.toString();
+ }
+
+ public void tracef(String format, Object... params)
+ {
+ delegate.tracef(format, params);
+ }
+
+ public void tracef(String format, Object param1)
+ {
+ delegate.tracef(format, param1);
+ }
+
+ public void tracef(String format, Object param1, Object param2)
+ {
+ delegate.tracef(format, param1, param2);
+ }
+
+ public void tracef(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.tracef(format, param1, param2, param3);
+ }
+
+ public void tracef(Throwable t, String format, Object... params)
+ {
+ delegate.tracef(t, format, params);
+ }
+
+ public void tracef(Throwable t, String format, Object param1)
+ {
+ delegate.tracef(t, format, param1);
+ }
+
+ public void tracef(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.tracef(t, format, param1, param2);
+ }
+
+ public void tracef(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.tracef(t, format, param1, param2, param3);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return delegate.isDebugEnabled();
+ }
+
+ public void debug(Object message)
+ {
+ delegate.debug(message);
+ }
+
+ public void debug(Object message, Throwable t)
+ {
+ delegate.debug(message, t);
+ }
+
+ public void debug(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.debug(loggerFqcn, message, t);
+ }
+
+ public void debug(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.debug(loggerFqcn, message, params, t);
+ }
+
+ public void debugv(String format, Object... params)
+ {
+ delegate.debugv(format, params);
+ }
+
+ public void debugv(String format, Object param1)
+ {
+ delegate.debugv(format, param1);
+ }
+
+ public void debugv(String format, Object param1, Object param2)
+ {
+ delegate.debugv(format, param1, param2);
+ }
+
+ public void debugv(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.debugv(format, param1, param2, param3);
+ }
+
+ public void debugv(Throwable t, String format, Object... params)
+ {
+ delegate.debugv(t, format, params);
+ }
+
+ public void debugv(Throwable t, String format, Object param1)
+ {
+ delegate.debugv(t, format, param1);
+ }
+
+ public void debugv(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.debugv(t, format, param1, param2);
+ }
+
+ public void debugv(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.debugv(t, format, param1, param2, param3);
+ }
+
+ public void debugf(String format, Object... params)
+ {
+ delegate.debugf(format, params);
+ }
+
+ public void debugf(String format, Object param1)
+ {
+ delegate.debugf(format, param1);
+ }
+
+ public void debugf(String format, Object param1, Object param2)
+ {
+ delegate.debugf(format, param1, param2);
+ }
+
+ public void debugf(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.debugf(format, param1, param2, param3);
+ }
+
+ public void debugf(Throwable t, String format, Object... params)
+ {
+ delegate.debugf(t, format, params);
+ }
+
+ public void debugf(Throwable t, String format, Object param1)
+ {
+ delegate.debugf(t, format, param1);
+ }
+
+ public void debugf(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.debugf(t, format, param1, param2);
+ }
+
+ public void debugf(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.debugf(t, format, param1, param2, param3);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return delegate.isInfoEnabled();
+ }
+
+ public void info(Object message)
+ {
+ delegate.info(message);
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ delegate.info(message, t);
+ }
+
+ public void info(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.info(loggerFqcn, message, t);
+ }
+
+ public void info(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.info(loggerFqcn, message, params, t);
+ }
+
+ public void infov(String format, Object... params)
+ {
+ delegate.infov(format, params);
+ }
+
+ public void infov(String format, Object param1)
+ {
+ delegate.infov(format, param1);
+ }
+
+ public void infov(String format, Object param1, Object param2)
+ {
+ delegate.infov(format, param1, param2);
+ }
+
+ public void infov(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.infov(format, param1, param2, param3);
+ }
+
+ public void infov(Throwable t, String format, Object... params)
+ {
+ delegate.infov(t, format, params);
+ }
+
+ public void infov(Throwable t, String format, Object param1)
+ {
+ delegate.infov(t, format, param1);
+ }
+
+ public void infov(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.infov(t, format, param1, param2);
+ }
+
+ public void infov(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.infov(t, format, param1, param2, param3);
+ }
+
+ public void infof(String format, Object... params)
+ {
+ delegate.infof(format, params);
+ }
+
+ public void infof(String format, Object param1)
+ {
+ delegate.infof(format, param1);
+ }
+
+ public void infof(String format, Object param1, Object param2)
+ {
+ delegate.infof(format, param1, param2);
+ }
+
+ public void infof(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.infof(format, param1, param2, param3);
+ }
+
+ public void infof(Throwable t, String format, Object... params)
+ {
+ delegate.infof(t, format, params);
+ }
+
+ public void infof(Throwable t, String format, Object param1)
+ {
+ delegate.infof(t, format, param1);
+ }
+
+ public void infof(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.infof(t, format, param1, param2);
+ }
+
+ public void infof(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.infof(t, format, param1, param2, param3);
+ }
+
+ public void warn(Object message)
+ {
+ delegate.warn(message);
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ delegate.warn(message, t);
+ }
+
+ public void warn(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.warn(loggerFqcn, message, t);
+ }
+
+ public void warn(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.warn(loggerFqcn, message, params, t);
+ }
+
+ public void warnv(String format, Object... params)
+ {
+ delegate.warnv(format, params);
+ }
+
+ public void warnv(String format, Object param1)
+ {
+ delegate.warnv(format, param1);
+ }
+
+ public void warnv(String format, Object param1, Object param2)
+ {
+ delegate.warnv(format, param1, param2);
+ }
+
+ public void warnv(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.warnv(format, param1, param2, param3);
+ }
+
+ public void warnv(Throwable t, String format, Object... params)
+ {
+ delegate.warnv(t, format, params);
+ }
+
+ public void warnv(Throwable t, String format, Object param1)
+ {
+ delegate.warnv(t, format, param1);
+ }
+
+ public void warnv(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.warnv(t, format, param1, param2);
+ }
+
+ public void warnv(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.warnv(t, format, param1, param2, param3);
+ }
+
+ public void warnf(String format, Object... params)
+ {
+ delegate.warnf(format, params);
+ }
+
+ public void warnf(String format, Object param1)
+ {
+ delegate.warnf(format, param1);
+ }
+
+ public void warnf(String format, Object param1, Object param2)
+ {
+ delegate.warnf(format, param1, param2);
+ }
+
+ public void warnf(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.warnf(format, param1, param2, param3);
+ }
+
+ public void warnf(Throwable t, String format, Object... params)
+ {
+ delegate.warnf(t, format, params);
+ }
+
+ public void warnf(Throwable t, String format, Object param1)
+ {
+ delegate.warnf(t, format, param1);
+ }
+
+ public void warnf(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.warnf(t, format, param1, param2);
+ }
+
+ public void warnf(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.warnf(t, format, param1, param2, param3);
+ }
+
+ public void error(Object message)
+ {
+ delegate.error(message);
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ delegate.error(message, t);
+ }
+
+ public void error(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.error(loggerFqcn, message, t);
+ }
+
+ public void error(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.error(loggerFqcn, message, params, t);
+ }
+
+ public void errorv(String format, Object... params)
+ {
+ delegate.errorv(format, params);
+ }
+
+ public void errorv(String format, Object param1)
+ {
+ delegate.errorv(format, param1);
+ }
+
+ public void errorv(String format, Object param1, Object param2)
+ {
+ delegate.errorv(format, param1, param2);
+ }
+
+ public void errorv(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.errorv(format, param1, param2, param3);
+ }
+
+ public void errorv(Throwable t, String format, Object... params)
+ {
+ delegate.errorv(t, format, params);
+ }
+
+ public void errorv(Throwable t, String format, Object param1)
+ {
+ delegate.errorv(t, format, param1);
+ }
+
+ public void errorv(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.errorv(t, format, param1, param2);
+ }
+
+ public void errorv(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.errorv(t, format, param1, param2, param3);
+ }
+
+ public void errorf(String format, Object... params)
+ {
+ delegate.errorf(format, params);
+ }
+
+ public void errorf(String format, Object param1)
+ {
+ delegate.errorf(format, param1);
+ }
+
+ public void errorf(String format, Object param1, Object param2)
+ {
+ delegate.errorf(format, param1, param2);
+ }
+
+ public void errorf(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.errorf(format, param1, param2, param3);
+ }
+
+ public void errorf(Throwable t, String format, Object... params)
+ {
+ delegate.errorf(t, format, params);
+ }
+
+ public void errorf(Throwable t, String format, Object param1)
+ {
+ delegate.errorf(t, format, param1);
+ }
+
+ public void errorf(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.errorf(t, format, param1, param2);
+ }
+
+ public void errorf(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.errorf(t, format, param1, param2, param3);
+ }
+
+ public void fatal(Object message)
+ {
+ delegate.fatal(message);
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ delegate.fatal(message, t);
+ }
+
+ public void fatal(String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.fatal(loggerFqcn, message, t);
+ }
+
+ public void fatal(String loggerFqcn, Object message, Object[] params, Throwable t)
+ {
+ delegate.fatal(loggerFqcn, message, params, t);
+ }
+
+ public void fatalv(String format, Object... params)
+ {
+ delegate.fatalv(format, params);
+ }
+
+ public void fatalv(String format, Object param1)
+ {
+ delegate.fatalv(format, param1);
+ }
+
+ public void fatalv(String format, Object param1, Object param2)
+ {
+ delegate.fatalv(format, param1, param2);
+ }
+
+ public void fatalv(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.fatalv(format, param1, param2, param3);
+ }
+
+ public void fatalv(Throwable t, String format, Object... params)
+ {
+ delegate.fatalv(t, format, params);
+ }
+
+ public void fatalv(Throwable t, String format, Object param1)
+ {
+ delegate.fatalv(t, format, param1);
+ }
+
+ public void fatalv(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.fatalv(t, format, param1, param2);
+ }
+
+ public void fatalv(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.fatalv(t, format, param1, param2, param3);
+ }
+
+ public void fatalf(String format, Object... params)
+ {
+ delegate.fatalf(format, params);
+ }
+
+ public void fatalf(String format, Object param1)
+ {
+ delegate.fatalf(format, param1);
+ }
+
+ public void fatalf(String format, Object param1, Object param2)
+ {
+ delegate.fatalf(format, param1, param2);
+ }
+
+ public void fatalf(String format, Object param1, Object param2, Object param3)
+ {
+ delegate.fatalf(format, param1, param2, param3);
+ }
+
+ public void fatalf(Throwable t, String format, Object... params)
+ {
+ delegate.fatalf(t, format, params);
+ }
+
+ public void fatalf(Throwable t, String format, Object param1)
+ {
+ delegate.fatalf(t, format, param1);
+ }
+
+ public void fatalf(Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.fatalf(t, format, param1, param2);
+ }
+
+ public void fatalf(Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.fatalf(t, format, param1, param2, param3);
+ }
+
+ public void log(Level level, Object message)
+ {
+ delegate.log(level, message);
+ }
+
+ public void log(Level level, Object message, Throwable t)
+ {
+ delegate.log(level, message, t);
+ }
+
+ public void log(Level level, String loggerFqcn, Object message, Throwable t)
+ {
+ delegate.log(level, loggerFqcn, message, t);
+ }
+
+ public void log(String loggerFqcn, Level level, Object message, Object[] params, Throwable t)
+ {
+ delegate.log(loggerFqcn, level, message, params, t);
+ }
+
+ public void logv(Level level, String format, Object... params)
+ {
+ delegate.logv(level, format, params);
+ }
+
+ public void logv(Level level, String format, Object param1)
+ {
+ delegate.logv(level, format, param1);
+ }
+
+ public void logv(Level level, String format, Object param1, Object param2)
+ {
+ delegate.logv(level, format, param1, param2);
+ }
+
+ public void logv(Level level, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logv(level, format, param1, param2, param3);
+ }
+
+ public void logv(Level level, Throwable t, String format, Object... params)
+ {
+ delegate.logv(level, t, format, params);
+ }
+
+ public void logv(Level level, Throwable t, String format, Object param1)
+ {
+ delegate.logv(level, t, format, param1);
+ }
+
+ public void logv(Level level, Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.logv(level, t, format, param1, param2);
+ }
+
+ public void logv(Level level, Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logv(level, t, format, param1, param2, param3);
+ }
+
+ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object... params)
+ {
+ delegate.logv(loggerFqcn, level, t, format, params);
+ }
+
+ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1)
+ {
+ delegate.logv(loggerFqcn, level, t, format, param1);
+ }
+
+ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.logv(loggerFqcn, level, t, format, param1, param2);
+ }
+
+ public void logv(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logv(loggerFqcn, level, t, format, param1, param2, param3);
+ }
+
+ public void logf(Level level, String format, Object... params)
+ {
+ delegate.logf(level, format, params);
+ }
+
+ public void logf(Level level, String format, Object param1)
+ {
+ delegate.logf(level, format, param1);
+ }
+
+ public void logf(Level level, String format, Object param1, Object param2)
+ {
+ delegate.logf(level, format, param1, param2);
+ }
+
+ public void logf(Level level, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logf(level, format, param1, param2, param3);
+ }
+
+ public void logf(Level level, Throwable t, String format, Object... params)
+ {
+ delegate.logf(level, t, format, params);
+ }
+
+ public void logf(Level level, Throwable t, String format, Object param1)
+ {
+ delegate.logf(level, t, format, param1);
+ }
+
+ public void logf(Level level, Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.logf(level, t, format, param1, param2);
+ }
+
+ public void logf(Level level, Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logf(level, t, format, param1, param2, param3);
+ }
+
+ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1)
+ {
+ delegate.logf(loggerFqcn, level, t, format, param1);
+ }
+
+ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2)
+ {
+ delegate.logf(loggerFqcn, level, t, format, param1, param2);
+ }
+
+ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object param1, Object param2, Object param3)
+ {
+ delegate.logf(loggerFqcn, level, t, format, param1, param2, param3);
+ }
+
+ public void logf(String loggerFqcn, Level level, Throwable t, String format, Object... params)
+ {
+ delegate.logf(loggerFqcn, level, t, format, params);
+ }
+ }
+
+}
Added: branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java (rev 0)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java 2011-11-11 10:13:15 UTC (rev 11689)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2010, Red Hat, Inc., and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.hornetq.integration.jboss.recovery;
+
+
+import org.hornetq.jms.server.recovery.HornetQResourceRecovery;
+import org.hornetq.jms.server.recovery.RecoveryRegistry;
+import org.jboss.msc.service.ServiceName;
+import org.jboss.msc.service.ServiceContainer;
+import org.jboss.msc.service.ServiceController;
+import org.jboss.tm.XAResourceRecoveryRegistry;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * 9/22/11
+ */
+public class AS7RecoveryRegistry implements RecoveryRegistry
+{
+ public static final ServiceName RECOVERY_MANAGER = ServiceName.JBOSS.append("txn").append("ArjunaRecoveryManager");
+ public static volatile ServiceContainer container;
+
+ private XAResourceRecoveryRegistry registry;
+
+ public AS7RecoveryRegistry()
+ {
+ registry = getXAResourceRecoveryRegistry();
+ if (registry == null)
+ {
+ throw new IllegalStateException("Unable to find Recovery Registry");
+ }
+ }
+
+ public void register(HornetQResourceRecovery resourceRecovery)
+ {
+ registry.addXAResourceRecovery(resourceRecovery);
+ }
+
+ public void unRegister(HornetQResourceRecovery resourceRecovery)
+ {
+ registry.removeXAResourceRecovery(resourceRecovery);
+ }
+
+ private static XAResourceRecoveryRegistry getXAResourceRecoveryRegistry()
+ {
+ @SuppressWarnings("unchecked")
+ ServiceController<XAResourceRecoveryRegistry> service = (ServiceController<XAResourceRecoveryRegistry>) container.getService(RECOVERY_MANAGER);
+ return service == null ? null : service.getValue();
+ }
+}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/HornetQResourceAdapter.java 2011-11-11 10:13:15 UTC (rev 11689)
@@ -13,6 +13,9 @@
package org.hornetq.ra;
import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
@@ -212,7 +215,7 @@
HornetQResourceAdapter.log.trace("start(" + ctx + ")");
}
- locateTM();
+ initialiseTransactionManager();
recoveryManager.start();
@@ -1560,14 +1563,14 @@
return map;
}
- private void locateTM()
+ private void initialiseTransactionManager()
{
String locatorClasses[] = raProperties.getTransactionManagerLocatorClass().split(";");
String locatorMethods[] = raProperties.getTransactionManagerLocatorMethod().split(";");
for (int i = 0 ; i < locatorClasses.length; i++)
{
- tm = Util.locateTM(locatorClasses[i], locatorMethods[i]);
+ tm = initialiseTransactionManager(locatorClasses[i], locatorMethods[i]);
if (tm != null)
{
break;
@@ -1735,4 +1738,68 @@
cf.setConnectionLoadBalancingPolicyClassName(val5);
}
}
+
+ /** The Resource adapter can't depend on any provider's specific library. Because of that we use reflection to locate the
+ * transaction manager during startup.
+ *
+ *
+ * TODO: https://jira.jboss.org/browse/HORNETQ-417
+ * We should use a proper SPI instead of reflection
+ * We would need to define a proper SPI package for this.
+ * */
+ public static TransactionManager initialiseTransactionManager(final String locatorClass, final String locatorMethod)
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Class<?> aClass = loader.loadClass(locatorClass);
+ Object o = safeInitNewInstance(locatorClass);
+ Method m = aClass.getMethod(locatorMethod);
+ return (TransactionManager)m.invoke(o);
+ }
+ catch (Throwable e)
+ {
+ log.debug(e.getMessage(), e);
+ return null;
+ }
+ }
+
+
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/Util.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/Util.java 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/Util.java 2011-11-11 10:13:15 UTC (rev 11689)
@@ -243,46 +243,4 @@
return res;
}
-
-
- /** The Resource adapter can't depend on any provider's specific library. Because of that we use reflection to locate the
- * transaction manager during startup.
- *
- *
- * TODO: https://jira.jboss.org/browse/HORNETQ-417
- * We should use a proper SPI instead of reflection
- * We would need to define a proper SPI package for this.
- * */
- public static TransactionManager locateTM(final String locatorClass, final String locatorMethod)
- {
- try
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class<?> aClass = loader.loadClass(locatorClass);
- Object o = aClass.newInstance();
- Method m = aClass.getMethod(locatorMethod);
- return (TransactionManager)m.invoke(o);
- }
- catch (Throwable e)
- {
- log.debug(e.getMessage(), e);
- return null;
- }
- }
-
- public static RecoveryRegistry locateRecoveryRegistry(final String locatorClass)
- {
- try
- {
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class<?> aClass = loader.loadClass(locatorClass);
- Object o = aClass.newInstance();
- return (RecoveryRegistry)o;
- }
- catch (Throwable e)
- {
- log.debug(e.getMessage(), e);
- return null;
- }
- }
}
Modified: branches/Branch_2_2_AS7/src/main/org/hornetq/ra/recovery/RecoveryManager.java
===================================================================
--- branches/Branch_2_2_AS7/src/main/org/hornetq/ra/recovery/RecoveryManager.java 2011-11-10 21:19:36 UTC (rev 11688)
+++ branches/Branch_2_2_AS7/src/main/org/hornetq/ra/recovery/RecoveryManager.java 2011-11-11 10:13:15 UTC (rev 11689)
@@ -30,6 +30,8 @@
import org.hornetq.jms.server.recovery.XARecoveryConfig;
import org.hornetq.ra.Util;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.HashMap;
import java.util.Map;
@@ -43,7 +45,7 @@
private RecoveryRegistry registry;
- private String resourceRecoveryClassNames = "org.jboss.as.integration.hornetq.recovery.AS5RecoveryRegistry";
+ private String resourceRecoveryClassNames = "org.hornetq.integration.jboss.recovery.AS7RecoveryRegistry;org.jboss.as.integration.hornetq.recovery.AS5RecoveryRegistry";
private Map<XARecoveryConfig, HornetQResourceRecovery> configMap = new HashMap<XARecoveryConfig, HornetQResourceRecovery>();
@@ -87,7 +89,7 @@
for (int i = 0 ; i < locatorClasses.length; i++)
{
- registry = Util.locateRecoveryRegistry(locatorClasses[i]);
+ registry = (RecoveryRegistry) safeInitNewInstance(locatorClasses[i]);
if (registry != null)
{
break;
@@ -161,4 +163,42 @@
return false;
}
+ /** This seems duplicate code all over the place, but for security reasons we can't let something like this to be open in a
+ * utility class, as it would be a door to load anything you like in a safe VM.
+ * For that reason any class trying to do a privileged block should do with the AccessController directly.
+ */
+ private static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = getClass().getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
}
13 years, 1 month
JBoss hornetq SVN: r11688 - tags.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-10 16:19:36 -0500 (Thu, 10 Nov 2011)
New Revision: 11688
Added:
tags/HornetQ_2_2_8_EAP_GA/
Log:
redo the release after JBPAPP-7273
13 years, 1 month
JBoss hornetq SVN: r11687 - tags.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-10 16:12:05 -0500 (Thu, 10 Nov 2011)
New Revision: 11687
Removed:
tags/HornetQ_2_2_8_EAP_GA/
Log:
retag on build
13 years, 1 month
JBoss hornetq SVN: r11686 - branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-11-10 16:11:28 -0500 (Thu, 10 Nov 2011)
New Revision: 11686
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
Log:
JBPAPP-7273 - Fixing NPE
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java 2011-11-10 11:08:03 UTC (rev 11685)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/Topology.java 2011-11-10 21:11:28 UTC (rev 11686)
@@ -60,7 +60,7 @@
*/
private final Map<String, TopologyMember> topology = new ConcurrentHashMap<String, TopologyMember>();
- private transient final Map<String, Long> mapDelete = new ConcurrentHashMap<String, Long>();
+ private transient Map<String, Long> mapDelete;
public Topology(final Object owner)
{
@@ -158,7 +158,7 @@
public boolean updateMember(final long uniqueEventID, final String nodeId, final TopologyMember memberInput)
{
- Long deleteTme = mapDelete.get(nodeId);
+ Long deleteTme = getMapDelete().get(nodeId);
if (deleteTme != null && uniqueEventID < deleteTme)
{
log.debug("Update uniqueEvent=" + uniqueEventID +
@@ -306,7 +306,7 @@
}
else
{
- mapDelete.put(nodeId, uniqueEventID);
+ getMapDelete().put(nodeId, uniqueEventID);
member = topology.remove(nodeId);
}
}
@@ -536,4 +536,13 @@
}
}
+ private synchronized Map<String, Long> getMapDelete()
+ {
+ if (mapDelete == null)
+ {
+ mapDelete = new ConcurrentHashMap<String, Long>();
+ }
+ return mapDelete;
+ }
+
}
13 years, 1 month
JBoss hornetq SVN: r11685 - in trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration: replication and 1 other directory.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-10 06:08:03 -0500 (Thu, 10 Nov 2011)
New Revision: 11685
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagingFailoverTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
Log:
Fix wait for 'shared journal' backup.
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java 2011-11-10 11:07:46 UTC (rev 11684)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/BackupSyncJournalTest.java 2011-11-10 11:08:03 UTC (rev 11685)
@@ -65,12 +65,12 @@
backupServer.start();
// Deliver messages with Backup in-sync
- waitForBackup(sessionFactory, BACKUP_WAIT_TIME, false, backupServer.getServer());
+ waitForRemoteBackup(sessionFactory, BACKUP_WAIT_TIME, false, backupServer.getServer());
sendMessages(session, producer, n_msgs);
// Deliver messages with Backup up-to-date
syncDelay.deliverUpToDateMsg();
- waitForBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
+ waitForRemoteBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
// SEND more messages, now with the backup replicating
sendMessages(session, producer, n_msgs);
@@ -114,14 +114,14 @@
{
syncDelay.deliverUpToDateMsg();
backupServer.start();
- waitForBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
+ waitForRemoteBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
}
public void testReplicationDuringSync() throws Exception
{
createProducerSendSomeMessages();
backupServer.start();
- waitForBackup(sessionFactory, BACKUP_WAIT_TIME, false, backupServer.getServer());
+ waitForRemoteBackup(sessionFactory, BACKUP_WAIT_TIME, false, backupServer.getServer());
sendMessages(session, producer, n_msgs);
session.commit();
@@ -136,7 +136,7 @@
private void finishSyncAndFailover() throws Exception
{
syncDelay.deliverUpToDateMsg();
- waitForBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
+ waitForRemoteBackup(sessionFactory, BACKUP_WAIT_TIME, true, backupServer.getServer());
assertFalse("should not be initialized", backupServer.getServer().isInitialised());
crash(session);
waitForServerInitialization(backupServer, 5);
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-10 11:07:46 UTC (rev 11684)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/FailoverTestBase.java 2011-11-10 11:08:03 UTC (rev 11685)
@@ -282,8 +282,7 @@
}
/**
- * This method will Waits for backup to be in the "started" state and to finish synchronization
- * with the live.
+ * Waits for backup to be in the "started" state and to finish synchronization with its live.
* @param sessionFactory
* @param seconds
* @throws Exception
@@ -291,7 +290,14 @@
protected void waitForBackup(ClientSessionFactoryInternal sessionFactory, int seconds) throws Exception
{
final HornetQServerImpl actualServer = (HornetQServerImpl)backupServer.getServer();
- waitForBackup(sessionFactory, seconds, true, actualServer);
+ if (actualServer.getConfiguration().isSharedStore())
+ {
+ waitForServer(actualServer);
+ }
+ else
+ {
+ waitForRemoteBackup(sessionFactory, seconds, true, actualServer);
+ }
}
/**
@@ -300,7 +306,7 @@
* @param waitForSync
* @param actualServer
*/
- public static void waitForBackup(ClientSessionFactoryInternal sessionFactory,
+ public static void waitForRemoteBackup(ClientSessionFactoryInternal sessionFactory,
int seconds,
boolean waitForSync,
final HornetQServer backup)
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java 2011-11-10 11:07:46 UTC (rev 11684)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/PagingFailoverTest.java 2011-11-10 11:08:03 UTC (rev 11685)
@@ -48,9 +48,12 @@
private static final SimpleString ADDRESS = new SimpleString("SimpleAddress");
- // Attributes ----------------------------------------------------
private ServerLocator locator;
+ private ClientSession session;
+
+ private ClientSessionFactoryInternal sf;
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -67,8 +70,18 @@
@Override
protected void tearDown() throws Exception
{
- locator.close();
- super.tearDown();
+ try
+ {
+ if (session != null)
+ session.close();
+ if (sf != null)
+ sf.close();
+ }
+ finally
+ {
+ closeServerLocator(locator);
+ super.tearDown();
+ }
}
public void testPageFailBeforeConsume() throws Exception
@@ -98,12 +111,9 @@
locator.setBlockOnDurableSend(true);
locator.setReconnectAttempts(-1);
- ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2);
- ClientSession session = sf.createSession(!transacted, !transacted, 0);
+ sf = createSessionFactoryAndWaitForTopology(locator, 2);
+ session = sf.createSession(!transacted, !transacted, 0);
- try
- {
-
session.createQueue(PagingFailoverTest.ADDRESS, PagingFailoverTest.ADDRESS, true);
ClientProducer prod = session.createProducer(PagingFailoverTest.ADDRESS);
@@ -144,7 +154,6 @@
for (int i = 0; i < MIDDLE; i++)
{
- System.out.println("msg " + i);
ClientMessage msg = cons.receive(20000);
Assert.assertNotNull(msg);
msg.acknowledge();
@@ -184,17 +193,6 @@
int result = (Integer)msg.getObjectProperty(new SimpleString("key"));
Assert.assertEquals(i, result);
}
- }
- finally
- {
- try
- {
- session.close();
- }
- catch (Exception ignored)
- {
- }
- }
}
// Package protected ---------------------------------------------
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagingFailoverTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagingFailoverTest.java 2011-11-10 11:07:46 UTC (rev 11684)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/failover/ReplicatedPagingFailoverTest.java 2011-11-10 11:08:03 UTC (rev 11685)
@@ -24,29 +24,9 @@
public class ReplicatedPagingFailoverTest extends PagingFailoverTest
{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
-
@Override
protected void createConfigs() throws Exception
{
createReplicatedConfigs();
}
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-11-10 11:07:46 UTC (rev 11684)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-11-10 11:08:03 UTC (rev 11685)
@@ -141,7 +141,7 @@
backupServer.start();
if (backup)
{
- FailoverTestBase.waitForBackup(null, 5, true, backupServer);
+ FailoverTestBase.waitForRemoteBackup(null, 5, true, backupServer);
}
int count = 0;
waitForReplication(count);
13 years, 1 month
JBoss hornetq SVN: r11684 - trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: borges
Date: 2011-11-10 06:07:46 -0500 (Thu, 10 Nov 2011)
New Revision: 11684
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
Log:
Improve clean to make sure everything gets closed.
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2011-11-10 11:07:28 UTC (rev 11683)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2011-11-10 11:07:46 UTC (rev 11684)
@@ -43,7 +43,7 @@
import org.hornetq.tests.util.UnitTestCase;
/**
- *
+ *
* A ProducerFlowControlTest
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a> fox
@@ -55,6 +55,12 @@
private ServerLocator locator;
+ private ClientSessionFactory sf;
+
+ private ClientSession session;
+
+ private HornetQServer server;
+
protected boolean isNetty()
{
return false;
@@ -70,7 +76,12 @@
@Override
protected void tearDown() throws Exception
{
- locator.close();
+ stopComponent(server);
+ if (sf != null)
+ {
+ sf.close();
+ }
+ closeServerLocator(locator);
super.tearDown();
}
@@ -207,7 +218,7 @@
{
final SimpleString address = new SimpleString("testaddress");
- HornetQServer server = createServer(realFiles, isNetty());
+ server = createServer(realFiles, isNetty());
AddressSettings addressSettings = new AddressSettings();
addressSettings.setMaxSizeBytes(maxSize);
@@ -219,10 +230,7 @@
server.start();
waitForServer(server);
- try
- {
-
- locator.setProducerWindowSize(producerWindowSize);
+ locator.setProducerWindowSize(producerWindowSize);
locator.setConsumerWindowSize(consumerWindowSize);
locator.setAckBatchSize(ackBatchSize);
@@ -231,8 +239,8 @@
locator.setMinLargeMessageSize(minLargeMessageSize);
}
- ClientSessionFactory sf = locator.createSessionFactory();
- ClientSession session = sf.createSession(false, true, true, true);
+ sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
session.start();
@@ -346,22 +354,13 @@
double rate = 1000 * (double)numMessages / (end - start);
ProducerFlowControlTest.log.info("rate is " + rate + " msgs / sec");
-
- session.close();
-
- sf.close();
- }
- finally
- {
- server.stop();
- }
}
public void testClosingSessionUnblocksBlockedProducer() throws Exception
{
final SimpleString address = new SimpleString("testaddress");
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
AddressSettings addressSettings = new AddressSettings();
addressSettings.setMaxSizeBytes(1024);
@@ -373,15 +372,12 @@
server.start();
waitForServer(server);
- try
- {
-
locator.setProducerWindowSize(1024);
locator.setConsumerWindowSize(1024);
locator.setAckBatchSize(1024);
- ClientSessionFactory sf = locator.createSessionFactory();
- final ClientSession session = sf.createSession(false, true, true, true);
+ sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
final SimpleString queueName = new SimpleString("testqueue");
@@ -423,18 +419,13 @@
Assert.assertTrue(closed.get());
t.join();
- }
- finally
- {
- server.stop();
- }
}
public void testFlowControlMessageNotRouted() throws Exception
{
final SimpleString address = new SimpleString("testaddress");
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
AddressSettings addressSettings = new AddressSettings();
addressSettings.setMaxSizeBytes(1024);
@@ -446,16 +437,13 @@
server.start();
waitForServer(server);
- try
- {
-
locator.setProducerWindowSize(1024);
locator.setConsumerWindowSize(1024);
locator.setAckBatchSize(1024);
- ClientSessionFactory sf = locator.createSessionFactory();
+ sf = locator.createSessionFactory();
- final ClientSession session = sf.createSession(false, true, true, true);
+ session = sf.createSession(false, true, true, true);
ClientProducer producer = session.createProducer(address);
@@ -471,30 +459,20 @@
producer.send(message);
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
// Not technically a flow control test, but what the hell
public void testMultipleConsumers() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
session.createQueue("address", "queue2", null, false);
session.createQueue("address", "queue3", null, false);
@@ -546,29 +524,19 @@
Assert.assertNotNull(msg);
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching1() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducerCredits credits = null;
@@ -590,29 +558,18 @@
Assert.assertEquals(0, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching2() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
+ sf = locator.createSessionFactory();
- try
- {
+ session = sf.createSession(false, true, true, true);
- ClientSessionFactory sf = locator.createSessionFactory();
-
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducerCredits credits = null;
@@ -636,29 +593,19 @@
Assert.assertEquals(1, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching3() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducerCredits credits = null;
@@ -680,29 +627,18 @@
Assert.assertEquals(0, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching4() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
+ sf = locator.createSessionFactory();
- try
- {
+ session = sf.createSession(false, true, true, true);
- ClientSessionFactory sf = locator.createSessionFactory();
-
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducerCredits credits = null;
@@ -726,29 +662,19 @@
Assert.assertEquals(i + 1, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching5() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducerCredits credits = null;
@@ -800,29 +726,18 @@
Assert.assertEquals(0, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsCaching6() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
+ sf = locator.createSessionFactory();
- try
- {
+ session = sf.createSession(false, true, true, true);
- ClientSessionFactory sf = locator.createSessionFactory();
-
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
for (int i = 0; i < ClientProducerCreditManagerImpl.MAX_UNREFERENCED_CREDITS_CACHE_SIZE; i++)
@@ -835,30 +750,19 @@
Assert.assertEquals(1, ((ClientSessionInternal)session).getProducerCreditManager()
.unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
-
}
public void testProducerCreditsCaching7() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
for (int i = 0; i < ClientProducerCreditManagerImpl.MAX_UNREFERENCED_CREDITS_CACHE_SIZE; i++)
@@ -895,29 +799,19 @@
Assert.assertEquals(ClientProducerCreditManagerImpl.MAX_UNREFERENCED_CREDITS_CACHE_SIZE,
((ClientSessionInternal)session).getProducerCreditManager().unReferencedCreditsSize());
}
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
public void testProducerCreditsRefCounting() throws Exception
{
- HornetQServer server = createServer(false, isNetty());
+ server = createServer(false, isNetty());
server.start();
waitForServer(server);
- try
- {
+ sf = locator.createSessionFactory();
- ClientSessionFactory sf = locator.createSessionFactory();
+ session = sf.createSession(false, true, true, true);
- final ClientSession session = sf.createSession(false, true, true, true);
-
session.createQueue("address", "queue1", null, false);
ClientProducer prod1 = session.createProducer("address");
@@ -946,13 +840,6 @@
Assert.assertEquals(1, ((ClientSessionInternal)session).getProducerCreditManager().creditsMapSize());
Assert.assertEquals(1, ((ClientSessionInternal)session).getProducerCreditManager().unReferencedCreditsSize());
-
- session.close();
- }
- finally
- {
- server.stop();
- }
}
}
Modified: trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java
===================================================================
--- trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java 2011-11-10 11:07:28 UTC (rev 11683)
+++ trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/client/SessionCreateConsumerTest.java 2011-11-10 11:07:46 UTC (rev 11684)
@@ -30,56 +30,52 @@
private final String queueName = "ClientSessionCreateConsumerTestQ";
private ServerLocator locator;
+ private HornetQServer service;
+ private ClientSessionInternal clientSession;
+ private ClientSessionFactory cf;
@Override
protected void setUp() throws Exception
{
locator = createInVMNonHALocator();
-
- super.setUp();
+ super.setUp();
+
+ service = createServer(false);
+ service.start();
+ locator.setProducerMaxRate(99);
+ locator.setBlockOnNonDurableSend(true);
+ locator.setBlockOnNonDurableSend(true);
+ cf = locator.createSessionFactory();
+ clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
}
@Override
protected void tearDown() throws Exception
{
- locator.close();
-
- super.tearDown();
+ stopComponent(service);
+ try
+ {
+ if (clientSession != null)
+ clientSession.close();
+ if (cf != null)
+ cf.close();
+ }
+ finally
+ {
+ closeServerLocator(locator);
+ super.tearDown();
+ }
}
public void testCreateConsumer() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
clientSession.createQueue(queueName, queueName, false);
ClientConsumer consumer = clientSession.createConsumer(queueName);
Assert.assertNotNull(consumer);
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
public void testCreateConsumerNoQ() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
try
{
clientSession.createConsumer(queueName);
@@ -89,47 +85,17 @@
{
Assert.assertEquals(e.getCode(), HornetQException.QUEUE_DOES_NOT_EXIST);
}
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
public void testCreateConsumerWithFilter() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
clientSession.createQueue(queueName, queueName, false);
ClientConsumer consumer = clientSession.createConsumer(queueName, "foo=bar");
Assert.assertNotNull(consumer);
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
public void testCreateConsumerWithInvalidFilter() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
clientSession.createQueue(queueName, queueName, false);
try
{
@@ -140,56 +106,20 @@
{
Assert.assertEquals(e.getCode(), HornetQException.INVALID_FILTER_EXPRESSION);
}
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
public void testCreateConsumerWithBrowseOnly() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
clientSession.createQueue(queueName, queueName, false);
ClientConsumer consumer = clientSession.createConsumer(queueName, null, true);
Assert.assertNotNull(consumer);
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
public void testCreateConsumerWithOverrides() throws Exception
{
- HornetQServer service = createServer(false);
- try
- {
- service.start();
- locator.setProducerMaxRate(99);
- locator.setBlockOnNonDurableSend(true);
- locator.setBlockOnNonDurableSend(true);
- ClientSessionFactory cf = locator.createSessionFactory();
- ClientSessionInternal clientSession = (ClientSessionInternal)cf.createSession(false, true, true);
clientSession.createQueue(queueName, queueName, false);
ClientConsumer consumer = clientSession.createConsumer(queueName, null, 100, 100, false);
Assert.assertNotNull(consumer);
- clientSession.close();
- }
- finally
- {
- service.stop();
- }
}
}
13 years, 1 month