FileDocCategorySizeDatePackage
OracleXAExceptionFormatter.javaAPI DocJBoss 4.2.14159Fri Jul 13 21:01:14 BST 2007org.jboss.resource.adapter.jdbc.vendor

OracleXAExceptionFormatter

public class OracleXAExceptionFormatter extends org.jboss.system.ServiceMBeanSupport implements org.jboss.tm.XAExceptionFormatter, OracleXAExceptionFormatterMBean
OracleXAExceptionFormatter
todo
this does not belong in the resource adapter
author
Igor Fedorenko.
author
David Jencks
author
Adrian Brock
version
$Revision: 57189 $

Fields Summary
private static final String
EXCEPTION_CLASS_NAME
private static final Object[]
NOARGS
private ObjectName
transactionManagerService
private Class
oracleXAExceptionClass
private Method
getXAError
private Method
getXAErrorMessage
private Method
getOracleError
private Method
getOracleSQLError
Constructors Summary
public OracleXAExceptionFormatter()


    
   
   
Methods Summary
public voidformatXAException(javax.transaction.xa.XAException xae, org.jboss.logging.Logger log)

      try
      {
         log.warn("xa error: " + getXAError.invoke(xae, NOARGS) + " (" + getXAErrorMessage.invoke(xae, new Object[]
         {getXAError.invoke(xae, NOARGS)}) + "); " + "oracle error: " + getOracleError.invoke(xae, NOARGS) + "; "
               + "oracle sql error: " + getOracleSQLError.invoke(xae, NOARGS) + ";", xae);
      }
      catch (Exception e)
      {
         log.warn("Problem trying to format XAException: ", e);
      }

   
public javax.management.ObjectNamegetTransactionManagerService()

      return transactionManagerService;
   
public voidsetTransactionManagerService(javax.management.ObjectName transactionManagerService)

      this.transactionManagerService = transactionManagerService;
   
protected voidstartService()

      oracleXAExceptionClass = Thread.currentThread().getContextClassLoader().loadClass(EXCEPTION_CLASS_NAME);
      getXAError = oracleXAExceptionClass.getMethod("getXAError", new Class[] {});
      getXAErrorMessage = oracleXAExceptionClass.getMethod("getXAErrorMessage", new Class[] { getXAError.getReturnType() });
      getOracleError = oracleXAExceptionClass.getMethod("getOracleError", new Class[] {});
      getOracleSQLError = oracleXAExceptionClass.getMethod("getOracleSQLError", new Class[] {});

      getServer().invoke(transactionManagerService, "registerXAExceptionFormatter", new Object[] { oracleXAExceptionClass, this}, new String[] { Class.class.getName(), XAExceptionFormatter.class.getName() });
   
protected voidstopService()

      getServer().invoke(transactionManagerService, "unregisterXAExceptionFormatter", new Object[] { oracleXAExceptionClass }, new String[] { Class.class.getName() });

      oracleXAExceptionClass = null;

      getXAError = null;
      getXAErrorMessage = null;
      getOracleError = null;
      getOracleSQLError = null;