Methods Summary |
---|
public static javax.ejb.ApplicationException | getApplicationException(java.lang.Class exceptionClass, org.jboss.aop.joinpoint.Invocation invocation)
MethodInvocation ejb = (MethodInvocation) invocation;
EJBContainer container = (EJBContainer) ejb.getAdvisor();
if (exceptionClass.isAnnotationPresent(ApplicationException.class))
return (ApplicationException)exceptionClass.getAnnotation(ApplicationException.class);
AssemblyDescriptor assembly = container.getAssemblyDescriptor();
if (assembly != null)
{
List exceptions = assembly.getApplicationExceptions();
if (exceptions.size() > 0)
{
Iterator exceptionIterator = exceptions.iterator();
while (exceptionIterator.hasNext())
{
org.jboss.ejb3.metamodel.ApplicationException exception = (org.jboss.ejb3.metamodel.ApplicationException)exceptionIterator.next();
if (exception.getExceptionClass().equals(exceptionClass.getName()))
return new ApplicationExceptionImpl(exception.getRollback());
}
}
}
return null;
|
public static javax.ejb.TransactionManagementType | getTransactionManagementType(org.jboss.aop.Advisor c)
TransactionManagement transactionManagement = (TransactionManagement) c.resolveAnnotation(TransactionManagement.class);
if (transactionManagement == null) return TransactionManagementType.CONTAINER;
return transactionManagement.value();
|
public static javax.transaction.TransactionManager | getTransactionManager()
try
{
//return TxManager.getInstance();
InitialContext jndiContext = InitialContextFactory.getInitialContext();
TransactionManager tm = TransactionManagerLocator.getInstance().locate();
return tm;
}
catch (NamingException e)
{
throw new RuntimeException("Unable to lookup TransactionManager", e);
}
|