Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags.
   * See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
   * of the GNU Lesser General Public License, v. 2.1.
  * This program is distributed in the hope that it will be useful, but WITHOUT A
  * 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,
  * v.2.1 along with this distribution; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
  *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
 /*
  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
  *
  * Arjuna Technologies Ltd.
  * Newcastle upon Tyne,
  * Tyne and Wear,
  * UK.
  *
  * $Id: JNDIManager.java 2342 2006-03-30 13:06:17Z  $
  */
 package com.arjuna.ats.jta.utils;
 
 
 
 public class JNDIManager
 {
Bind the underlying JTA implementations to the appropriate JNDI contexts.

 
 	public static void bindJTAImplementations(InitialContext ctxthrows javax.naming.NamingException
 	{
 	}

    
Bind the underlying JTA implementations to the appropriate JNDI contexts.

 
     public static void bindJTAImplementation() throws javax.naming.NamingException
     {
 	}

Bind the currently configured transaction manager implementation to the default JNDI context.

 
     public static void bindJTATransactionManagerImplementation() throws javax.naming.NamingException
     {
     }

    
Unbind the transaction manager from the default JNDI context.

 
     public static void unbindJTATransactionManagerImplementation() throws javax.naming.NamingException
     {
     }

    
Bind the currently configured transaction manager implementation to the JNDI context passed in.

Parameters:
initialContext
Throws:
javax.naming.NamingException
 
 	public static void bindJTATransactionManagerImplementation(InitialContext initialContextthrows javax.naming.NamingException
 	{
        
Look up and instantiate an instance of the configured transaction manager implementation
 
         String tmImplementation = jtaPropertyManager.getJTAEnvironmentBean().getTransactionManagerClassName();

        
Bind the transaction manager to the appropriate JNDI context
 
         Reference ref = new Reference(tmImplementationtmImplementationnull);
         initialContext.rebind(getTransactionManagerJNDIName(), ref);
 	}

    
Unbind the transaction manager from the provided JNDI context.

Parameters:
initialContext
Throws:
javax.naming.NamingException
    public static void unbindJTATransactionManagerImplementation(InitialContext initialContextthrows javax.naming.NamingException
    {
        initialContext.unbind(getTransactionManagerJNDIName());
    }

    
Bind the currently configured user transaction implementation to the default JNDI context.

    public static void bindJTAUserTransactionImplementation() throws javax.naming.NamingException
    {
    }

    
Bind the currently configured user transaction implementation to the passed in JNDI context.

Parameters:
initialContext
Throws:
javax.naming.NamingException
	public static void bindJTAUserTransactionImplementation(InitialContext initialContextthrows javax.naming.NamingException
	{
        
Look up and instantiate an instance of the configured user transaction implementation
        String utImplementation = jtaPropertyManager.getJTAEnvironmentBean().getUserTransactionClassName();

        
Bind the user transaction to the appropriate JNDI context
        Reference ref = new Reference(utImplementationutImplementationnull);
        initialContext.rebind(getUserTransactionJNDIName(), ref);
	}

Bind the currently configured TransactionSynchronizationRegistry implementation to the default JNDI context.

	{
	}

    
Unbind the TSR from the default JNDI context.

	{
	}

Bind the currently configured TransactionSynchronizationRegistry implementation to the passed in JNDI context.

Parameters:
initialContext
Throws:
javax.naming.NamingException
	{
        
Look up and instantiate an instance of the configured TransactionSynchronizationRegistry implementation
        String tsrImplementation = jtaPropertyManager.getJTAEnvironmentBean().getTransactionSynchronizationRegistryClassName();
        Object tsr = null;
        try {
            tsr = Class.forName(tsrImplementation).newInstance();
        } catch(Exception e) {
            NamingException namingException = new ConfigurationException(..get_utils_JNDIManager_tsr1());
            namingException.setRootCause(e);
            throw namingException;
        }

        
Bind the TransactionSynchronizationRegistry to the appropriate JNDI context
        initialContext.rebind(getTransactionSynchronizationRegistryJNDIName(), tsr);
    }

    
Unbind the TSR from the provided JNDI context.

Parameters:
initialContext
Throws:
javax.naming.NamingException
	{
        initialContext.unbind(getTransactionSynchronizationRegistryJNDIName());
    }
	private final static String getTransactionManagerJNDIName()
	{
        return jtaPropertyManager.getJTAEnvironmentBean().getTransactionManagerJNDIContext();
	}
	private final static String getUserTransactionJNDIName()
	{
        return jtaPropertyManager.getJTAEnvironmentBean().getUserTransactionJNDIContext();
	}
	{
        return jtaPropertyManager.getJTAEnvironmentBean().getTransactionSynchronizationRegistryJNDIContext();
	}
New to GrepCode? Check out our FAQ X