Search in sources :

Example 1 with TransactionTimeoutMetaData

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());
}
Also used : TransactionTimeoutMetaData(org.jboss.metadata.ejb.jboss.ejb3.TransactionTimeoutMetaData) TimeUnit(java.util.concurrent.TimeUnit)

Aggregations

TimeUnit (java.util.concurrent.TimeUnit)1 TransactionTimeoutMetaData (org.jboss.metadata.ejb.jboss.ejb3.TransactionTimeoutMetaData)1