use of org.jboss.narayana.txframework.impl.handlers.ProtocolHandler in project wildfly by wildfly.
the class XTSPOJOInterceptor method processInvocation.
@Override
public Object processInvocation(InterceptorContext context) throws Exception {
ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class);
Object serviceInstance = componentInstance.getInstance();
Method serviceMethod = context.getMethod();
Class serviceClass = serviceInstance.getClass();
Object result;
ProtocolHandler protocolHandler = HandlerFactory.getInstance(new ServiceInvocationMeta(serviceInstance, serviceClass, serviceMethod));
try {
protocolHandler.preInvocation();
result = context.proceed();
protocolHandler.notifySuccess();
} catch (Exception e) {
protocolHandler.notifyFailure();
throw e;
}
return result;
}
use of org.jboss.narayana.txframework.impl.handlers.ProtocolHandler in project wildfly by wildfly.
the class XTSEJBInterceptor method processInvocation.
@Override
public Object processInvocation(InterceptorContext context) throws Exception {
ComponentView cv = context.getPrivateData(ComponentView.class);
ManagedReference mr = cv.createInstance();
Object serviceInstance = mr.getInstance();
Class serviceClass = context.getTarget().getClass();
Method serviceMethod = context.getMethod();
Object result;
ProtocolHandler protocolHandler = HandlerFactory.getInstance(new ServiceInvocationMeta(serviceInstance, serviceClass, serviceMethod));
try {
protocolHandler.preInvocation();
result = context.proceed();
protocolHandler.notifySuccess();
} catch (Exception e) {
protocolHandler.notifyFailure();
throw e;
}
return result;
}
Aggregations