public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception {
try {
// prepare for invocation
onBeforeInvocation(wsInvocation);
// prepare invocation data
final ComponentView componentView = getComponentView();
final Method method = getEJBMethod(wsInvocation.getJavaMethod(), componentView.getViewMethods());
final InterceptorContext context = new InterceptorContext();
prepareForInvocation(context, wsInvocation);
context.setMethod(method);
context.setParameters(wsInvocation.getArgs());
context.setTarget(reference.getInstance());
context.putPrivateData(Component.class, componentView.getComponent());
context.putPrivateData(ComponentView.class, componentView);
// invoke method
final Object retObj = componentView.invoke(context);
// set return value
wsInvocation.setReturnValue(retObj);
}
catch (Throwable t) {
log.error("Method invocation failed with exception: " + t.getMessage(), t);