use of org.wildfly.iiop.openjdk.tm.ForeignTransaction in project wildfly by wildfly.
the class EjbIIOPTransactionInterceptor method processInvocation.
@Override
public Object processInvocation(final InterceptorContext invocation) throws Exception {
// Do we have a foreign transaction context?
Transaction tx = TxServerInterceptor.getCurrentTransaction();
if (tx instanceof ForeignTransaction) {
final EJBComponent component = (EJBComponent) invocation.getPrivateData(Component.class);
// for timer invocations there is no view, so the methodInf is attached directly
// to the context. Otherwise we retrieve it from the invoked view
MethodIntf methodIntf = invocation.getPrivateData(MethodIntf.class);
if (methodIntf == null) {
final ComponentView componentView = invocation.getPrivateData(ComponentView.class);
if (componentView != null) {
methodIntf = componentView.getPrivateData(MethodIntf.class);
} else {
methodIntf = MethodIntf.BEAN;
}
}
final TransactionAttributeType attr = component.getTransactionAttributeType(methodIntf, invocation.getMethod());
if (attr != TransactionAttributeType.NOT_SUPPORTED && attr != TransactionAttributeType.REQUIRES_NEW) {
throw EjbLogger.ROOT_LOGGER.transactionPropagationNotSupported();
}
}
return invocation.proceed();
}
Aggregations