@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; }
ExecutableValidator executableValidator = validator.forExecutables(); Set<? extends ConstraintViolation<?>> violations = executableValidator.validateConstructorParameters( ctx.getConstructor(), ctx.getParameters() ); getMessage( ctx.getConstructor(), ctx.getParameters(), violations ), violations ); ctx.getConstructor(), createdObject ); getMessage( ctx.getConstructor(), ctx.getParameters(), violations ), violations );
/** {@inheritDoc} */ @Override public Constructor<?> getConstructor() { return delegate.getConstructor(); } }
@Override public Constructor<?> getConstructor() { return delegateInvocationContext.getConstructor(); }
protected void checkConstructor(InvocationContext ctx, Class<?> expectedDeclaringClass) { Constructor<?> constructor = ctx.getConstructor(); assertNotNull(constructor); assertEquals(expectedDeclaringClass, constructor.getDeclaringClass()); }
protected void checkConstructor(InvocationContext ctx, Class<?> expectedDeclaringClass) { Constructor<?> constructor = ctx.getConstructor(); assertNotNull(constructor); assertEquals(expectedDeclaringClass, constructor.getDeclaringClass()); }
@Override public Constructor<?> getConstructor() { return delegate().getConstructor(); }
@Override public Constructor<?> getConstructor() { return delegate().getConstructor(); }
@Override public Constructor<?> getConstructor() { return delegate().getConstructor(); }
@Override public Constructor<?> getConstructor() { return delegate().getConstructor(); }
@AroundConstruct private Object countedConstructor(InvocationContext context) throws Exception { return countedCallable(context, context.getConstructor()); }
@AroundConstruct private Object timedConstructor(InvocationContext context) throws Exception { return timedCallable(context, context.getConstructor()); }
@AroundConstruct public Object onConstructor(final InvocationContext context) throws Exception { return invoke(context, context.getConstructor()); }
@AroundConstruct private Object timedConstructor(InvocationContext context) throws Exception { return applyInterceptor(context, context.getConstructor()); }
@AroundConstruct private Object countedConstructor(InvocationContext context) throws Exception { return applyInterceptor(context, context.getConstructor()); }
@AroundConstruct private Object countedConstructor(InvocationContext context) throws Exception { return countedCallable(context, context.getConstructor()); }
@AroundConstruct public Object onConstructor(final InvocationContext context) throws Exception { findMeter(context.getConstructor()).mark(); return context.proceed(); }
@AroundConstruct public Object onConstructor(final InvocationContext context) throws Exception { return findTimer(context.getConstructor()).time(context::proceed); }