public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
public static Method getNonPrivateNonStaticFinalMethod(Class<?> type) { for (Class<?> clazz = type; clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) { for (Method method : AccessController.doPrivileged(new GetDeclaredMethodsAction(clazz))) { if (isFinal(method) && !isPrivate(method) && !isStatic(method)) { return method; } } } return null; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (constructor != null && Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (constructor != null && Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException(ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass().getName(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }
public void init() { initTargetClassInterceptors(); businessMethods = Beans.getInterceptableMethods(annotatedType); initEjbInterceptors(); initCdiInterceptors(); InterceptionModel interceptionModel = builder.build(); if (interceptionModel.getAllInterceptors().size() > 0 || hasSerializationOrInvocationInterceptorMethods) { if (annotatedType.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(annotatedType.getJavaClass()); } if (Reflections.isPrivate(constructor.getJavaMember())) { throw new DeploymentException( ValidatorLogger.LOG.notProxyablePrivateConstructor(annotatedType.getJavaClass(), constructor, annotatedType.getJavaClass())); } manager.getInterceptorModelRegistry().put(annotatedType.slim(), interceptionModel); } }