Object tpc = invocation.getMetaData(ClientTxPropagationInterceptor.TRANSACTION_PROPAGATION_CONTEXT, ClientTxPropagationInterceptor.TRANSACTION_PROPAGATION_CONTEXT);
if (tpc != null)
{
Transaction tx = tm.getTransaction();
if (tx != null) throw new RuntimeException("cannot import a transaction context when a transaction is already associated with the thread");
Transaction importedTx = TransactionPropagationContextUtil.getTPCImporter().importTransactionPropagationContext(tpc);
tm.resume(importedTx);
try
{
return invocation.invokeNext();
}
finally
{
tm.suspend();
}
}
else
{
return invocation.invokeNext();
}