Refine search
public Object processInvocation(final InterceptorContext context) throws Exception { ComponentInstance componentInstance = context.getPrivateData(ComponentInstance.class); if (componentInstance == null) { throw EeLogger.ROOT_LOGGER.noComponentInstance(); } Method oldMethod = context.getMethod(); try { context.setMethod(componentMethod); context.setTarget(componentInstance.getInstance()); return componentInstance.getInterceptor(componentMethod).processInvocation(context); } finally { context.setMethod(oldMethod); context.setTarget(null); } } }
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentClientInstance instance = context.getPrivateData(ComponentClientInstance.class); final Component component = context.getPrivateData(Component.class); final ComponentInstance componentInstance = component.createInstance(); boolean ok = false; try { context.putPrivateData(ComponentInstance.class, componentInstance); instance.setViewInstanceData(ComponentInstance.class, componentInstance); final Object result = context.proceed(); ok = true; return result; } finally { context.putPrivateData(ComponentInstance.class, null); if (! ok) { componentInstance.destroy(); instance.setViewInstanceData(ComponentInstance.class, null); } } } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { WeldInjectionContext injectionContext = context.getPrivateData(WeldInjectionContext.class); ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(BasicComponentInstance.INSTANCE_KEY); if (reference != null) { injectionContext.inject(reference.getInstance()); } return context.proceed(); } }
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { final Method method = this.method; if (withContext) { final Method oldMethod = context.getMethod(); try { if (this.lifecycleMethod) { context.setMethod(null); return method.invoke(instance, context.getInvocationContext()); } else if (this.changeMethod) {
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { try { return context.proceed(); } finally { final ManagedReference managedReference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); if (managedReference != null) { managedReference.release(); } } } }
@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; } }
context.putPrivateData(ComponentInstance.class, componentInstance); return context.proceed(); } catch (Exception ex) { final EJBComponent ejbComponent = component; if (ejbComponent.getApplicationException(ex.getClass(), context.getMethod()) != null) { componentInstance.destroy();
public Object processInvocation(final InterceptorContext context) throws Exception { final ComponentInstance componentInstance = componentInstanceReference.get(); context.putPrivateData(ComponentInstance.class, componentInstance); try { return context.proceed(); } finally { context.putPrivateData(ComponentInstance.class, null); componentInstance.destroy(); } } }
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
@Override public Object getInstance() { return instance.getInstance(); } }
@Override public synchronized void release() { if (!destroyed) { instance.destroy(); destroyed = true; } }
@Override public InterceptorInstances getInterceptorInstances(ComponentInstance componentInstance) { return (WeldInterceptorInstances) componentInstance.getInstanceData(SerializedCdiInterceptorsKey.class); }
@Override public void setInterceptorInstances(ComponentInstance componentInstance, InterceptorInstances interceptorInstances) { componentInstance.setInstanceData(SerializedCdiInterceptorsKey.class, interceptorInstances); }
final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { final Method method = this.method; if (withContext) { final Method oldMethod = context.getMethod(); try { if (this.lifecycleMethod) { context.setMethod(null); return method.invoke(instance, context.getInvocationContext()); } else if (this.changeMethod) {
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { final ManagedReference reference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); final Object instance = reference.getInstance(); try { return method.invoke(instance, context.getParameters()); } catch (IllegalAccessException e) { final IllegalAccessError n = new IllegalAccessError(e.getMessage()); n.setStackTrace(e.getStackTrace()); throw n; } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
/** * {@inheritDoc} */ public Object processInvocation(final InterceptorContext context) throws Exception { try { return context.proceed(); } finally { final ManagedReference managedReference = (ManagedReference) context.getPrivateData(ComponentInstance.class).getInstanceData(contextKey); if (managedReference != null) { managedReference.release(); } } } }
context.putPrivateData(ComponentInstance.class, componentInstance); return context.proceed(); } catch (Exception ex) { final EJBComponent ejbComponent = component; if (ejbComponent.getApplicationException(ex.getClass(), context.getMethod()) != null) { componentInstance.destroy();
@Override public Object processInvocation(final InterceptorContext context) throws Exception { final Object instance = context.getPrivateData(ComponentInstance.class).getInstance(); try { return method.invoke(instance, context.getPrivateData(PARAMETERS_KEY)); } catch (InvocationTargetException e) { throw Interceptors.rethrow(e.getCause()); } } }
@Override public Object getInstance() { return componentInstance.getInstance(); } };