use of javax.transaction.Transactional.TxType in project aries by apache.
the class ComponentTxData method parseTxData.
private boolean parseTxData(Class<?> c) {
boolean shouldAssignInterceptor = false;
Transactional classAnnotation = c.getAnnotation(Transactional.class);
TxType defaultType = getType(classAnnotation);
if (defaultType != null) {
shouldAssignInterceptor = true;
}
for (Method m : c.getDeclaredMethods()) {
try {
Transactional methodAnnotation = m.getAnnotation(Transactional.class);
TxType t = getType(methodAnnotation);
if (t != null) {
TransactionalAnnotationAttributes txData = new TransactionalAnnotationAttributes(t, methodAnnotation.dontRollbackOn(), methodAnnotation.rollbackOn());
assertAllowedModifier(m);
txMap.put(m, Optional.of(txData));
shouldAssignInterceptor = true;
} else if (defaultType != null) {
txMap.put(m, Optional.of(new TransactionalAnnotationAttributes(defaultType, classAnnotation.dontRollbackOn(), classAnnotation.rollbackOn())));
}
} catch (IllegalStateException e) {
LOG.warn("Invalid transaction annoation found", e);
}
}
return shouldAssignInterceptor;
}
Aggregations