use of org.jboss.metadata.ejb.jboss.ejb3.TransactionTimeoutMetaData in project wildfly by wildfly.
the class TransactionAttributeMergingProcessor method timeout.
private static Integer timeout(final ContainerTransactionMetaData containerTransaction) {
final List<TransactionTimeoutMetaData> transactionTimeouts = containerTransaction.getAny(TransactionTimeoutMetaData.class);
if (transactionTimeouts == null || transactionTimeouts.isEmpty())
return null;
final TransactionTimeoutMetaData transactionTimeout = transactionTimeouts.get(0);
final TimeUnit unit = transactionTimeout.getUnit() == null ? TimeUnit.SECONDS : transactionTimeout.getUnit();
return (int) unit.toSeconds(transactionTimeout.getTimeout());
}
Aggregations