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);
+ }
+ }
+ });
+ }
+
}