public Object processInvocation(InterceptorContext context) throws Exception {
final StatefulSessionComponent component = getComponent(context, StatefulSessionComponent.class);
final StatefulSessionComponentInstance instance = getComponentInstance(context);
final TransactionSynchronizationRegistry transactionSynchronizationRegistry = component.getTransactionSynchronizationRegistry();
final AccessTimeout timeout = component.getAccessTimeout(context.getMethod());
if (log.isTraceEnabled()) {
log.trace("Trying to acquire lock: " + lock + " for stateful component instance: " + instance + " during invocation: " + context);
}
// we obtain a lock in this synchronization interceptor because the lock needs to be tied to the synchronization
// so that it can released on the tx synchronization callbacks
boolean acquired = lock.tryLock(timeout.value(), timeout.unit());
if (!acquired) {
throw new ConcurrentAccessTimeoutException("EJB 3.1 FR 4.3.14.1 concurrent access timeout on " + context
+ " - could not obtain lock within " + timeout.value() + timeout.unit());
}
if (log.isTraceEnabled()) {
log.trace("Acquired lock: " + lock + " for stateful component instance: " + instance + " during invocation: " + context);
}