Example usage for javax.naming Reference add

List of usage examples for javax.naming Reference add

Introduction

In this page you can find the example usage for javax.naming Reference add.

Prototype

public void add(RefAddr addr) 

Source Link

Document

Adds an address to the end of the list of addresses.

Usage

From source file:com.frameworkset.commons.dbcp2.datasources.PerUserPoolDataSource.java

/**
 * Returns a <code>PerUserPoolDataSource</code> {@link Reference}.
 *///from  ww  w.j a va  2 s.  c om
@Override
public Reference getReference() throws NamingException {
    Reference ref = new Reference(getClass().getName(), PerUserPoolDataSourceFactory.class.getName(), null);
    ref.add(new StringRefAddr("instanceKey", getInstanceKey()));
    return ref;
}

From source file:org.apache.synapse.commons.datasource.JNDIBasedDataSourceRepository.java

/**
 * Register a DataSource in the JNDI tree
 *
 * @see DataSourceRepository#register(DataSourceInformation)
 *//*from w  ww  .ja v  a 2s .c  o m*/
public void register(DataSourceInformation information) {

    validateInitialized();
    String dataSourceName = information.getDatasourceName();
    validateDSName(dataSourceName);
    Properties properties = information.getProperties();

    InitialContext context = null;
    Properties jndiEvn = null;

    if (properties == null || properties.isEmpty()) {
        if (initialContext != null) {
            context = initialContext;
            if (log.isDebugEnabled()) {
                log.debug("Empty JNDI properties for datasource " + dataSourceName);
                log.debug("Using system-wide jndi properties : " + jndiProperties);
            }

            jndiEvn = jndiProperties;
        }
    }

    if (context == null) {

        jndiEvn = createJNDIEnvironment(properties, information.getAlias());
        context = createInitialContext(jndiEvn);

        if (context == null) {

            validateInitialContext(initialContext);
            context = initialContext;

            if (log.isDebugEnabled()) {
                log.debug("Cannot create a name context with provided jndi properties : " + jndiEvn);
                log.debug("Using system-wide JNDI properties : " + jndiProperties);
            }

            jndiEvn = jndiProperties;
        } else {
            perDataSourceICMap.put(dataSourceName, context);
        }
    }

    String dsType = information.getType();
    String driver = information.getDriver();
    String url = information.getUrl();

    String user = information.getSecretInformation().getUser();
    String password = information.getSecretInformation().getResolvedSecret();

    String maxActive = String.valueOf(information.getMaxActive());
    String maxIdle = String.valueOf(information.getMaxIdle());
    String maxWait = String.valueOf(information.getMaxWait());

    //populates context tree
    populateContextTree(context, dataSourceName);

    if (DataSourceInformation.BASIC_DATA_SOURCE.equals(dsType)) {

        Reference ref = new Reference("javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory",
                null);

        ref.add(new StringRefAddr(DataSourceConstants.PROP_DRIVER_CLS_NAME, driver));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_URL, url));
        ref.add(new StringRefAddr(SecurityConstants.PROP_USER_NAME, user));
        ref.add(new StringRefAddr(SecurityConstants.PROP_PASSWORD, password));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_MAX_ACTIVE, maxActive));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_MAX_IDLE, maxIdle));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_MAX_WAIT, maxWait));

        // set BasicDataSource specific parameters
        setBasicDataSourceParameters(ref, information);
        //set default jndiProperties for reference
        setCommonParameters(ref, information);

        try {

            if (log.isDebugEnabled()) {
                log.debug("Registering a DataSource with name : " + dataSourceName
                        + " in the JNDI tree with jndiProperties : " + jndiEvn);
            }

            context.rebind(dataSourceName, ref);
        } catch (NamingException e) {
            String msg = " Error binding name ' " + dataSourceName + " ' to "
                    + "the DataSource(BasicDataSource) reference";
            throw new SynapseCommonsException(msg, e, log);
        }

    } else if (DataSourceInformation.PER_USER_POOL_DATA_SOURCE.equals(dsType)) {

        // Construct DriverAdapterCPDS reference
        String className = (String) information.getParameter(DataSourceConstants.PROP_CPDS_ADAPTER
                + DataSourceConstants.DOT_STRING + DataSourceConstants.PROP_CPDS_CLASS_NAME);
        String factory = (String) information.getParameter(DataSourceConstants.PROP_CPDS_ADAPTER
                + DataSourceConstants.DOT_STRING + DataSourceConstants.PROP_CPDS_FACTORY);
        String name = (String) information.getParameter(DataSourceConstants.PROP_CPDS_ADAPTER
                + DataSourceConstants.DOT_STRING + DataSourceConstants.PROP_CPDS_NAME);

        Reference cpdsRef = new Reference(className, factory, null);

        cpdsRef.add(new StringRefAddr(DataSourceConstants.PROP_DRIVER, driver));
        cpdsRef.add(new StringRefAddr(DataSourceConstants.PROP_URL, url));
        cpdsRef.add(new StringRefAddr(DataSourceConstants.PROP_USER, user));
        cpdsRef.add(new StringRefAddr(SecurityConstants.PROP_PASSWORD, password));

        try {
            context.rebind(name, cpdsRef);
        } catch (NamingException e) {
            String msg = "Error binding name '" + name + "' to " + "the DriverAdapterCPDS reference";
            throw new SynapseCommonsException(msg, e, log);
        }

        // Construct PerUserPoolDataSource reference
        Reference ref = new Reference("org.apache.commons.dbcp.datasources.PerUserPoolDataSource",
                "org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory", null);

        ref.add(new BinaryRefAddr(DataSourceConstants.PROP_JNDI_ENV, MiscellaneousUtil.serialize(jndiEvn)));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DATA_SOURCE_NAME, name));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_MAX_ACTIVE, maxActive));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_MAX_IDLE, maxIdle));
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_MAX_WAIT, maxWait));

        //set default jndiProperties for reference
        setCommonParameters(ref, information);

        try {

            if (log.isDebugEnabled()) {
                log.debug("Registering a DataSource with name : " + dataSourceName
                        + " in the JNDI tree with jndiProperties : " + jndiEvn);
            }

            context.rebind(dataSourceName, ref);
        } catch (NamingException e) {
            String msg = "Error binding name ' " + dataSourceName + " ' to "
                    + "the PerUserPoolDataSource reference";
            throw new SynapseCommonsException(msg, e, log);
        }

    } else {
        throw new SynapseCommonsException("Unsupported data source type : " + dsType, log);
    }
    cachedNameList.add(dataSourceName);
}

From source file:org.apache.synapse.commons.datasource.JNDIBasedDataSourceRepository.java

/**
 * Helper method to set all default parameter for naming reference of data source
 *
 * @param reference   The naming reference instance
 * @param information DataSourceInformation instance
 *//*  ww  w. ja  va  2s.c o m*/
private static void setCommonParameters(Reference reference, DataSourceInformation information) {

    reference.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_AUTO_COMMIT,
            String.valueOf(information.isDefaultAutoCommit())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_READ_ONLY,
            String.valueOf(information.isDefaultReadOnly())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_TEST_ON_BORROW,
            String.valueOf(information.isTestOnBorrow())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_TEST_ON_RETURN,
            String.valueOf(information.isTestOnReturn())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_TIME_BETWEEN_EVICTION_RUNS_MILLIS,
            String.valueOf(information.getTimeBetweenEvictionRunsMillis())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_NUM_TESTS_PER_EVICTION_RUN,
            String.valueOf(information.getNumTestsPerEvictionRun())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_MIN_EVICTABLE_IDLE_TIME_MILLIS,
            String.valueOf(information.getMinEvictableIdleTimeMillis())));
    reference.add(new StringRefAddr(DataSourceConstants.PROP_TEST_WHILE_IDLE,
            String.valueOf(information.isTestWhileIdle())));

    String validationQuery = information.getValidationQuery();

    if (validationQuery != null && !"".equals(validationQuery)) {
        reference.add(new StringRefAddr(DataSourceConstants.PROP_VALIDATION_QUERY, validationQuery));
    }
}

From source file:org.apache.synapse.commons.datasource.JNDIBasedDataSourceRepository.java

/**
 * Helper method to set all BasicDataSource specific parameter
 *
 * @param ref         The naming reference instance
 * @param information DataSourceInformation instance
 *//*from w w  w  . j av a2 s. co m*/
private static void setBasicDataSourceParameters(Reference ref, DataSourceInformation information) {

    int defaultTransactionIsolation = information.getDefaultTransactionIsolation();
    String defaultCatalog = information.getDefaultCatalog();

    if (defaultTransactionIsolation != -1) {
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_TRANSACTION_ISOLATION,
                String.valueOf(defaultTransactionIsolation)));
    }

    ref.add(new StringRefAddr(DataSourceConstants.PROP_MIN_IDLE, String.valueOf(information.getMaxIdle())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_ACCESS_TO_UNDERLYING_CONNECTION_ALLOWED,
            String.valueOf(information.isAccessToUnderlyingConnectionAllowed())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_REMOVE_ABANDONED,
            String.valueOf(information.isRemoveAbandoned())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_REMOVE_ABANDONED_TIMEOUT,
            String.valueOf(information.getRemoveAbandonedTimeout())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_LOG_ABANDONED,
            String.valueOf(information.isLogAbandoned())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_POOL_PREPARED_STATEMENTS,
            String.valueOf(information.isPoolPreparedStatements())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_MAX_OPEN_PREPARED_STATEMENTS,
            String.valueOf(information.getMaxOpenPreparedStatements())));
    ref.add(new StringRefAddr(DataSourceConstants.PROP_INITIAL_SIZE,
            String.valueOf(information.getInitialSize())));

    if (defaultCatalog != null && !"".equals(defaultCatalog)) {
        ref.add(new StringRefAddr(DataSourceConstants.PROP_DEFAULT_CATALOG, defaultCatalog));
    }
}

From source file:org.apache.synapse.util.DataSourceRegistrar.java

/**
 * Helper method to register a single data source .The given data source name is used ,
 * if there is no property with name dsName ,when,data source is binding to the initial context,
 *
 * @param dsName         The name of the data source
 * @param dsProperties   The property bag
 * @param initialContext The initial context instance
 * @param jndiEnv        The JNDI environment properties
 *//* ww  w .j  a  v  a  2  s  .c o  m*/
private static void registerDataSource(String dsName, Properties dsProperties, InitialContext initialContext,
        Properties jndiEnv) {

    if (dsName == null || "".equals(dsName)) {
        if (log.isDebugEnabled()) {
            log.debug("DataSource name is either empty or null, ignoring..");
        }
        return;
    }

    StringBuffer buffer = new StringBuffer();
    buffer.append(SynapseConstants.SYNAPSE_DATASOURCES);
    buffer.append(DOT_STRING);
    buffer.append(dsName);
    buffer.append(DOT_STRING);

    // Prefix for getting particular data source's properties
    String prefix = buffer.toString();

    String driver = getProperty(dsProperties, prefix + PROP_DRIVER_CLS_NAME, null);
    if (driver == null) {
        handleException(prefix + PROP_DRIVER_CLS_NAME + " cannot be found.");
    }

    String url = getProperty(dsProperties, prefix + PROP_URL, null);
    if (url == null) {
        handleException(prefix + PROP_URL + " cannot be found.");
    }

    // get other required properties
    String user = getProperty(dsProperties, prefix + PROP_USER_NAME, "synapse");
    String password = getProperty(dsProperties, prefix + PROP_PASSWORD, "synapse");
    String dataSourceName = getProperty(dsProperties, prefix + PROP_DSNAME, dsName);

    //populates context tree
    populateContextTree(initialContext, dataSourceName);

    String dsType = getProperty(dsProperties, prefix + "type", "BasicDataSource");

    String maxActive = getProperty(dsProperties, prefix + PROP_MAXACTIVE,
            String.valueOf(GenericObjectPool.DEFAULT_MAX_ACTIVE));
    String maxIdle = getProperty(dsProperties, prefix + PROP_MAXIDLE,
            String.valueOf(GenericObjectPool.DEFAULT_MAX_IDLE));
    String maxWait = getProperty(dsProperties, prefix + PROP_MAXWAIT,
            String.valueOf(GenericObjectPool.DEFAULT_MAX_WAIT));

    if ("BasicDataSource".equals(dsType)) {

        Reference ref = new Reference("javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory",
                null);

        ref.add(new StringRefAddr(PROP_DRIVER_CLS_NAME, driver));
        ref.add(new StringRefAddr(PROP_URL, url));
        ref.add(new StringRefAddr(PROP_USER_NAME, user));
        ref.add(new StringRefAddr(PROP_PASSWORD, password));
        ref.add(new StringRefAddr(PROP_MAXACTIVE, maxActive));
        ref.add(new StringRefAddr(PROP_MAXIDLE, maxIdle));
        ref.add(new StringRefAddr(PROP_MAXWAIT, maxWait));

        //set BasicDataSource specific parameters
        setBasicDataSourceParameters(ref, dsProperties, prefix);
        //set default properties for reference
        setCommonParameters(ref, dsProperties, prefix);

        try {
            initialContext.rebind(dataSourceName, ref);
        } catch (NamingException e) {
            String msg = " Error binding name ' " + dataSourceName + " ' to "
                    + "the DataSource(BasicDataSource) reference";
            handleException(msg, e);
        }

    } else if ("PerUserPoolDataSource".equals(dsType)) {

        // Construct DriverAdapterCPDS reference
        String className = getProperty(dsProperties, prefix + PROP_CPDSADAPTER + DOT_STRING + "className",
                "org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS");
        String factory = getProperty(dsProperties, prefix + PROP_CPDSADAPTER + DOT_STRING + "factory",
                "org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS");
        String name = getProperty(dsProperties, prefix + PROP_CPDSADAPTER + DOT_STRING + "name", "cpds");

        Reference cpdsRef = new Reference(className, factory, null);

        cpdsRef.add(new StringRefAddr(PROP_DRIVER, driver));
        cpdsRef.add(new StringRefAddr(PROP_URL, url));
        cpdsRef.add(new StringRefAddr(PROP_USER, user));
        cpdsRef.add(new StringRefAddr(PROP_PASSWORD, password));

        try {
            initialContext.rebind(name, cpdsRef);
        } catch (NamingException e) {
            String msg = "Error binding name '" + name + "' to " + "the DriverAdapterCPDS reference";
            handleException(msg, e);
        }

        // Construct PerUserPoolDataSource reference
        Reference ref = new Reference("org.apache.commons.dbcp.datasources.PerUserPoolDataSource",
                "org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory", null);

        ref.add(new BinaryRefAddr(PROP_JNDI_ENV, serialize(jndiEnv)));
        ref.add(new StringRefAddr(PROP_DATA_SOURCE_NAME, name));
        ref.add(new StringRefAddr(PROP_DEFAULTMAXACTIVE, maxActive));
        ref.add(new StringRefAddr(PROP_DEFAULTMAXIDLE, maxIdle));
        ref.add(new StringRefAddr(PROP_DEFAULTMAXWAIT, maxWait));

        //set default properties for reference
        setCommonParameters(ref, dsProperties, prefix);

        try {
            initialContext.rebind(dataSourceName, ref);
        } catch (NamingException e) {
            String msg = "Error binding name ' " + dataSourceName + " ' to "
                    + "the PerUserPoolDataSource reference";
            handleException(msg, e);
        }

    } else {
        handleException("Unsupported data source type : " + dsType);
    }
}

From source file:org.apache.synapse.util.DataSourceRegistrar.java

/**
 * Helper method to set all default parameter for naming reference of data source
 *
 * @param reference  The naming reference instance
 * @param properties The properties which contains required parameter value
 * @param prefix     The key prefix for which is used to get data from given properties
 *///from ww  w .jav a  2s .  co  m
private static void setCommonParameters(Reference reference, Properties properties, String prefix) {
    String defaultAutoCommit = getProperty(properties, prefix + PROP_DEFAULTAUTOCOMMIT, String.valueOf(true));
    String defaultReadOnly = getProperty(properties, prefix + PROP_DEFAULTREADONLY, String.valueOf(false));
    String testOnBorrow = getProperty(properties, prefix + PROP_TESTONBORROW, String.valueOf(true));
    String testOnReturn = getProperty(properties, prefix + PROP_TESTONRETURN, String.valueOf(false));
    String timeBetweenEvictionRunsMillis = getProperty(properties, prefix + PROP_TIMEBETWEENEVICTIONRUNSMILLIS,
            String.valueOf(GenericObjectPool.DEFAULT_TIME_BETWEEN_EVICTION_RUNS_MILLIS));
    String numTestsPerEvictionRun = getProperty(properties, prefix + PROP_NUMTESTSPEREVICTIONRUN,
            String.valueOf(GenericObjectPool.DEFAULT_NUM_TESTS_PER_EVICTION_RUN));
    String minEvictableIdleTimeMillis = getProperty(properties, prefix + PROP_MINEVICTABLEIDLETIMEMILLIS,
            String.valueOf(GenericObjectPool.DEFAULT_MIN_EVICTABLE_IDLE_TIME_MILLIS));
    String testWhileIdle = getProperty(properties, prefix + PROP_TESTWHILEIDLE, String.valueOf(false));
    String validationQuery = getProperty(properties, prefix + PROP_VALIDATIONQUERY, null);

    reference.add(new StringRefAddr(PROP_DEFAULTAUTOCOMMIT, defaultAutoCommit));
    reference.add(new StringRefAddr(PROP_DEFAULTREADONLY, defaultReadOnly));
    reference.add(new StringRefAddr(PROP_TESTONBORROW, testOnBorrow));
    reference.add(new StringRefAddr(PROP_TESTONRETURN, testOnReturn));
    reference.add(new StringRefAddr(PROP_TIMEBETWEENEVICTIONRUNSMILLIS, timeBetweenEvictionRunsMillis));
    reference.add(new StringRefAddr(PROP_NUMTESTSPEREVICTIONRUN, numTestsPerEvictionRun));
    reference.add(new StringRefAddr(PROP_MINEVICTABLEIDLETIMEMILLIS, minEvictableIdleTimeMillis));
    reference.add(new StringRefAddr(PROP_TESTWHILEIDLE, testWhileIdle));
    if (validationQuery != null && !"".equals(validationQuery)) {
        reference.add(new StringRefAddr(PROP_VALIDATIONQUERY, validationQuery));
    }
}

From source file:org.apache.synapse.util.DataSourceRegistrar.java

/**
 * Helper method to set all BasicDataSource specific parameter
 *
 * @param reference  The naming reference instance
 * @param properties The properties which contains required parameter value
 * @param prefix     The key prefix for which is used to get data from given properties
 *///from   w w  w . j a va 2 s. co m
private static void setBasicDataSourceParameters(Reference reference, Properties properties, String prefix) {
    String minIdle = getProperty(properties, prefix + PROP_MINIDLE,
            String.valueOf(GenericObjectPool.DEFAULT_MIN_IDLE));
    String initialSize = getProperty(properties, prefix + PROP_INITIALSIZE, String.valueOf(0));
    String defaultTransactionIsolation = getProperty(properties, prefix + PROP_DEFAULTTRANSACTIONISOLATION,
            null);
    String defaultCatalog = getProperty(properties, prefix + PROP_DEFAULTCATALOG, null);
    String accessToUnderlyingConnectionAllowed = getProperty(properties,
            prefix + PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED, String.valueOf(false));
    String removeAbandoned = getProperty(properties, prefix + PROP_REMOVEABANDONED, String.valueOf(false));
    String removeAbandonedTimeout = getProperty(properties, prefix + PROP_REMOVEABANDONEDTIMEOUT,
            String.valueOf(300));
    String logAbandoned = getProperty(properties, prefix + PROP_LOGABANDONED, String.valueOf(false));
    String poolPreparedStatements = getProperty(properties, prefix + PROP_POOLPREPAREDSTATEMENTS,
            String.valueOf(false));
    String maxOpenPreparedStatements = getProperty(properties, prefix + PROP_MAXOPENPREPAREDSTATEMENTS,
            String.valueOf(GenericKeyedObjectPool.DEFAULT_MAX_TOTAL));

    reference.add(new StringRefAddr(PROP_MINIDLE, minIdle));
    if (defaultTransactionIsolation != null && !"".equals(defaultTransactionIsolation)) {
        reference.add(new StringRefAddr(PROP_DEFAULTTRANSACTIONISOLATION, defaultTransactionIsolation));
    }
    reference.add(
            new StringRefAddr(PROP_ACCESSTOUNDERLYINGCONNECTIONALLOWED, accessToUnderlyingConnectionAllowed));
    reference.add(new StringRefAddr(PROP_REMOVEABANDONED, removeAbandoned));
    reference.add(new StringRefAddr(PROP_REMOVEABANDONEDTIMEOUT, removeAbandonedTimeout));
    reference.add(new StringRefAddr(PROP_LOGABANDONED, logAbandoned));
    reference.add(new StringRefAddr(PROP_POOLPREPAREDSTATEMENTS, poolPreparedStatements));
    reference.add(new StringRefAddr(PROP_MAXOPENPREPAREDSTATEMENTS, maxOpenPreparedStatements));
    reference.add(new StringRefAddr(PROP_INITIALSIZE, initialSize));
    if (defaultCatalog != null && !"".equals(defaultCatalog)) {
        reference.add(new StringRefAddr(PROP_DEFAULTCATALOG, defaultCatalog));
    }
}

From source file:org.enhydra.jdbc.pool.StandardPoolDataSource.java

/**
 * Retrieves the Reference of this object. Used at binding time by JNDI
 * to build a reference on this object./*from  w  w w  .j  a  va 2s  .  c o m*/
 *
 * @return  The non-null Reference of this object.
 * @exception  NamingException  If a naming exception was encountered while
 * retrieving the reference.
 */
public Reference getReference() throws NamingException {
    log.debug("StandardPoolDataSource:getReference return a reference of the object");
    Reference ref = super.getReference();
    ref.add(new StringRefAddr("checkLevelObject", Integer.toString(getCheckLevelObject())));
    ref.add(new StringRefAddr("lifeTime", Long.toString(getLifeTime())));
    ref.add(new StringRefAddr("jdbcTestStmt", getJdbcTestStmt()));
    ref.add(new StringRefAddr("maxSize", Integer.toString(getMaxSize())));
    ref.add(new StringRefAddr("minSize", Integer.toString(getMinSize())));
    ref.add(new StringRefAddr("dataSourceName", getDataSourceName()));
    return ref;
}

From source file:org.enhydra.jdbc.pool.StandardXAPoolDataSource.java

/**
 * Retrieves the Reference of this object. Used at binding time by JNDI
 * to build a reference on this object./*from  w w  w  . ja v  a 2  s  . c o  m*/
 *
 * @return  The non-null Reference of this object.
 * @exception  NamingException  If a naming exception was encountered while
 * retrieving the reference.
 */
public Reference getReference() throws NamingException {
    log.debug("StandardXAPoolDataSource:getReference return a reference of the object");
    Reference ref = super.getReference();
    ref.add(new StringRefAddr("transactionManagerName", this.transactionManagerName));

    return ref;
}