FileDocCategorySizeDatePackage
Util.javaAPI DocExample3323Mon Jun 04 14:11:10 BST 2007com.sun.xml.ws.tx.common

Util

public class Util extends Object
This class contains various utility methods shared among other modules.
author
Ryan.Shoemaker@Sun.COM
version
$Revision: 1.6.2.2 $
since
1.0

Fields Summary
private static final TxLogger
logger
private static Boolean
hasJTA
Constructors Summary
Methods Summary
public static booleanisClassAvailable(java.lang.String classname)

    
         
        Class tmClass = null;
        try {
            tmClass = Class.forName(classname);
        } catch (ClassNotFoundException ex) {
        }
        return tmClass != null;
    
public static booleanisJTAAvailable()
Identify if Java Transaction API available. If not available, container is not capable of creating a JTA transaction.

    
                            
        
        if (hasJTA == null) {
            // Check for JTA 1.1 API availability.
            hasJTA = isClassAvailable("javax.transaction.TransactionManager") && 
                     isClassAvailable("javax.transaction.TransactionSynchronizationRegistry") ? Boolean.TRUE : Boolean.FALSE;
	    
            if (hasJTA && ! TransactionManagerImpl.getInstance().isTransactionManagerAvailable()) {
                hasJTA = Boolean.FALSE;
            }
        }
        return hasJTA.booleanValue();