@AroundConstruct public void validateConstructor(InvocationContext context) { System.out.println("MyAroundConstructInterceptor.validateConstructor"); } }
@AroundConstruct public void validateConstructorInvocation(InvocationContext ctx) throws Exception { final boolean isJaxRsConstructor = extension.jaxRsResourceCache.apply(ctx.getConstructor().getDeclaringClass()); if (!isJaxRsConstructor) { interceptor.validateConstructorInvocation(ctx); } } }
@AroundConstruct private Object aroundConstructor(InvocationContext context) throws Exception { return called(context, context.getConstructor()); }
@AroundConstruct public Object onConstruct(InvocationContext context) throws Exception { // null before the InvocationContext.proceed() returns Object target = context.getTarget(); isNull(target); // null in case of AroundConstruct Method method = context.getMethod(); isNull(method); // NOT null in case of AroundConstruct Constructor ctor = context.getConstructor(); isNotNull(ctor); // perform the constructor injection Object result = context.proceed(); isNull(result); // NOT null after the InvocationContext.proceed() completes target = context.getTarget(); isNotNull(target); // a constructor should have been called GreetingBean bean = (GreetingBean) target; isBoolean(bean.isConstructed(), true); isBoolean(bean.isInitialized(), false); // constructor injection should have been done isNotNull(bean.getParam()); return null; }
@AroundConstruct public void validateConstructorInvocation(InvocationContext ctx) throws Exception { ExecutableValidator executableValidator = validator.forExecutables();
@AroundConstruct public Object aroundConstruct(InvocationContext ctx) throws Exception { aroundConstructInterceptorCalled = true; return ctx.proceed(); }
@AroundConstruct public void postConstruct(InvocationContext ctx) throws Exception { aroundConstructCalled = true; ctx.proceed(); }
@AroundConstruct public void intercept3(InvocationContext ctx) { try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); } }
@AroundConstruct public void intercept2(InvocationContext ctx) { try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); } }
@AroundConstruct public Object injectContexts(final InvocationContext ic) throws Exception { doInject(ic); return ic.proceed(); }
@AroundConstruct public void aroundConstructS(InvocationContext ctx) { ActionSequence.addAction("aroundConstruct", SuperDestructionInterceptor.class.getSimpleName()); try { ctx.proceed(); } catch (Throwable e) { throw new RuntimeException(e); } } }
@AroundConstruct public void aroundConstructS(InvocationContext ctx) { ActionSequence.addAction("aroundConstruct", SuperDestructionInterceptor.class.getSimpleName()); try { ctx.proceed(); } catch (Throwable e) { throw new RuntimeException(e); } } }
@AroundConstruct public void onConstruct(final InvocationContext context) throws Exception { workaround.lazyInit(); context.proceed(); }
@AroundConstruct public void aroundConstruct(InvocationContext ctx) { try { ctx.proceed(); fail(); } catch (CharlieException expected) { setInvoked(); throw expected; } catch (Exception e) { fail(); } }
@AroundConstruct public void aroundConstruct(InvocationContext ctx) { ActionSequence.addAction("aroundConstruct", DestructionInterceptor.class.getSimpleName()); try { ctx.proceed(); } catch (Throwable e) { throw new RuntimeException(e); } } }
@AroundConstruct public void intercept1(InvocationContext ctx) { ActionSequence.addAction(SuperInterceptor1.class.getSimpleName()); try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); } } }
@AroundConstruct public Object aroundConstruct(InvocationContext ctx) throws Exception { ctx.proceed(); return new Foo("intercepted"); }
@AroundConstruct public void intercept(InvocationContext ctx) { ActionSequence.addAction(getClass().getSimpleName()); try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(e); } } }
@AroundConstruct public void aroundConstruct(InvocationContext ctx) { try { ctx.proceed(); } catch (Exception e) { throw new RuntimeException(); } setInvoked(); throw new CharlieException(); }
@AroundConstruct public Object onConstructor(final InvocationContext context) throws Exception { findMeter(context.getConstructor()).mark(); return context.proceed(); }