/** * Handles setting up the ejbCreate and ejbRemove methods for stateless session beans and MDB's * * @param component The component * @param module The module * @param reflectionIndex The reflection index */ private void handleStatelessSessionBean(final EJBComponentDescription component, final Module module, final DeploymentReflectionIndex reflectionIndex) throws ClassNotFoundException, DeploymentUnitProcessingException { final Class<?> componentClass = ClassLoadingUtils.loadClass(component.getComponentClassName(), module); final MethodIdentifier ejbCreateId = MethodIdentifier.getIdentifier(void.class, "ejbCreate"); final Method ejbCreate = ClassReflectionIndexUtil.findMethod(reflectionIndex, componentClass, ejbCreateId); if (ejbCreate != null) { final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(); builder.setPostConstruct(ejbCreateId); component.addInterceptorMethodOverride(ejbCreate.getDeclaringClass().getName(), builder.build()); } final MethodIdentifier ejbRemoveId = MethodIdentifier.getIdentifier(void.class, "ejbRemove"); final Method ejbRemove = ClassReflectionIndexUtil.findMethod(reflectionIndex, componentClass, ejbRemoveId); if (ejbRemove != null) { final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(); builder.setPreDestroy(ejbRemoveId); component.addInterceptorMethodOverride(ejbRemove.getDeclaringClass().getName(), builder.build()); } }
if (aroundInvoke.getClassName() == null || aroundInvoke.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(aroundInvoke.getClassName(), builder.build()); if (postConstruct.getClassName() == null || postConstruct.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(postConstruct.getClassName(), builder.build()); if (preDestroy.getClassName() == null || preDestroy.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(preDestroy.getClassName(), builder.build()); if (prePassivate.getClassName() == null || prePassivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(prePassivate.getClassName(), builder.build()); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(postActivate.getClassName(), builder.build());
/** * Handles setting up the ejbCreate and ejbRemove methods for stateless session beans and MDB's * * @param component The component * @param classIndex The class index * @param reflectionIndex The reflection index */ private void handleStatelessSessionBean(final EJBComponentDescription component, final DeploymentClassIndex classIndex, final DeploymentReflectionIndex reflectionIndex) throws ClassNotFoundException, DeploymentUnitProcessingException { final ClassIndex componentClass = classIndex.classIndex(component.getComponentClassName()); final MethodIdentifier ejbCreateId = MethodIdentifier.getIdentifier(void.class, "ejbCreate"); final Method ejbCreate = ClassReflectionIndexUtil.findMethod(reflectionIndex, componentClass.getModuleClass(), ejbCreateId); if (ejbCreate != null) { final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(); builder.setPostConstruct(ejbCreateId); component.addInterceptorMethodOverride(ejbCreate.getDeclaringClass().getName(), builder.build()); } final MethodIdentifier ejbRemoveId = MethodIdentifier.getIdentifier(void.class, "ejbRemove"); final Method ejbRemove = ClassReflectionIndexUtil.findMethod(reflectionIndex, componentClass.getModuleClass(), ejbRemoveId); if (ejbRemove != null) { final InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(); builder.setPreDestroy(ejbRemoveId); component.addInterceptorMethodOverride(ejbRemove.getDeclaringClass().getName(), builder.build()); } }
if (aroundInvoke.getClassName() == null || aroundInvoke.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(aroundInvoke.getClassName(), builder.build()); if (postConstruct.getClassName() == null || postConstruct.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(postConstruct.getClassName(), builder.build()); if (preDestroy.getClassName() == null || preDestroy.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(preDestroy.getClassName(), builder.build()); if (prePassivate.getClassName() == null || prePassivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(prePassivate.getClassName(), builder.build()); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build()); } else { component.addInterceptorMethodOverride(postActivate.getClassName(), builder.build());