@@ -0,0 +1,2471 @@
+/**%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.activemq.ra;%0A%0Aimport javax.resource.ResourceException;%0Aimport javax.resource.spi.ConnectionManager;%0A%0Aimport org.apache.activemq.ActiveMQXAConnectionFactory;%0A%0A/**%0A * Impl that will create an XAConnectionFactory that allows %0A * org.jboss.jms.server.recovery.MessagingXAResourceRecovery to deal with recovery via jms apis%0A * on the connectionfactory registered in jndi %0A * to use, reference in the ra.xml as follows:%0A * %7B@code %3Cmanagedconnectionfactory-class%3Eorg.apache.activemq.ra.ActiveMQXAManagedConnectionFactory%3C/managedconnectionfactory-class%3E%7D%0A *               %0A */%0Apublic class ActiveMQXAManagedConnectionFactory extends ActiveMQManagedConnectionFactory %7B%0A%0A   private static final long serialVersionUID = 2032273395660212918L;%0A%0A   /**%0A    * This method returns an ActiveMQXAConnectonFactory%3Cbr/%3E%0A    * %0A    * @see javax.resource.spi.ManagedConnectionFactory#createConnectionFactory(javax.resource.spi.ConnectionManager)%0A    */%0A   @Override%0A   public Object createConnectionFactory(ConnectionManager manager) throws ResourceException %7B%0A      return new ActiveMQXAConnectionFactory( getInfo().getUserName(), getInfo().getPassword(), getInfo().getServerUrl());%0A   %7D%0A   %0A   /**%0A    * @see java.lang.Object#equals(java.lang.Object)%0A    */%0A   @Override%0A   public boolean equals(Object object) %7B%0A      if (object == null %7C%7C object.getClass() != ActiveMQXAManagedConnectionFactory.class) %7B%0A          return false;%0A      %7D%0A      return ((ActiveMQXAManagedConnectionFactory)object).getInfo().equals(getInfo());%0A   %7D%0A%0A   /**%0A    * @see java.lang.Object#hashCode()%0A    */%0A   @Override%0A   public int hashCode() %7B%0A      return getInfo().hashCode();%0A   %7D%0A%7D%0A

resolve https://issues.apache.org/activemq/browse/AMQ-2670 - apply patch with thanks. Now possible to integrate RAR XAResource with jboss via the jboss org.jboss.jms.server.recovery.MessagingXAResourceRecovery handler