Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat Middleware LLC, 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.jboss.jca.adapters.jdbc.xa;
import org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnectionFactory;
import org.jboss.jca.adapters.jdbc.classloading.TCClassLoaderPlugin;
import org.jboss.jca.adapters.jdbc.spi.URLXASelectorStrategy;
import org.jboss.jca.adapters.jdbc.spi.XAData;
import org.jboss.jca.adapters.jdbc.util.Injection;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import javax.resource.ResourceException;
import javax.resource.spi.ConnectionRequestInfo;
import javax.resource.spi.ManagedConnection;
import javax.security.auth.Subject;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
/**
* XAManagedConnectionFactory
*
* @author David Jencks
* @author Adrian Brock
* @author Jesper Pedersen
*/
public class XAManagedConnectionFactory extends BaseWrapperManagedConnectionFactory
{
private static final long serialVersionUID = 1647927657609573729L;
private String xaDataSourceClass;
private String xaDataSourceProperties;
/** THe XA properties */
protected final Map xaProps = Collections.synchronizedMap(new HashMap());
private Boolean isSameRMOverrideValue;
private XADataSource xads;
private String urlProperty;
private URLXASelectorStrategy xadsSelector;
/**
* Constructor
*/
public XAManagedConnectionFactory()
{
}
/**
* Get the URL property
* @return The value
*/
public String getURLProperty()
{
return urlProperty;
}
/**
* Set the URL property
* @param urlProperty The value
*/
public void setURLProperty(String urlProperty)
{
this.urlProperty = urlProperty;
}
/**
* Get the XaDataSourceClass value.
* @return the XaDataSourceClass value.
*/
public String getXADataSourceClass()
{
return xaDataSourceClass;
}
/**
* Set the XaDataSourceClass value.
* @param xaDataSourceClass The new XaDataSourceClass value.
*/
public void setXADataSourceClass(String xaDataSourceClass)
{
this.xaDataSourceClass = xaDataSourceClass;
}
/**
* Get the XADataSourceProperties value.
* @return the XADataSourceProperties value.
*/
public String getXADataSourceProperties()
{
return xaDataSourceProperties;
}
/**
* Set the XADataSourceProperties value.
* @param xaDataSourceProperties The new XADataSourceProperties value.
* @exception ResourceException Thrown in case of an error
*/
public void setXADataSourceProperties(String xaDataSourceProperties) throws ResourceException
{
this.xaDataSourceProperties = xaDataSourceProperties;
xaProps.clear();
if (xaDataSourceProperties != null)
{
// Map any \ to \\
xaDataSourceProperties = xaDataSourceProperties.replaceAll("\\\\", "\\\\\\\\");
InputStream is = new ByteArrayInputStream(xaDataSourceProperties.getBytes());
try
{
Properties p = new Properties();
p.load(is);
for (Map.Entry