protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { Method annMethod = (Method)ainfo.getAnnotatedElement(); validateAnnotatedLifecycleMethod(annMethod); String pcMethodName = annMethod.getName(); String pcClassName = annMethod.getDeclaringClass().getName(); for (ResourceContainerContext rcContext : rcContexts) { LifecycleCallbackDescriptor postConstructDesc = new LifecycleCallbackDescriptor(); postConstructDesc.setLifecycleCallbackClass(pcClassName); postConstructDesc.setLifecycleCallbackMethod(pcMethodName); postConstructDesc.setMetadataSource(MetadataSource.ANNOTATION); // override by xml is handled in addPostConstructDescriptor rcContext.addPostConstructDescriptor(postConstructDesc); } return getDefaultProcessedResult(); } }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, ResourceContainerContext[] rcContexts) throws AnnotationProcessorException { PostConstruct postConstructAn = (PostConstruct)ainfo.getAnnotation(); Method annMethod = (Method)ainfo.getAnnotatedElement(); String pcMethodName = annMethod.getName(); String pcClassName = annMethod.getDeclaringClass().getName(); for (ResourceContainerContext rcContext : rcContexts) { LifecycleCallbackDescriptor postConstructDesc = new LifecycleCallbackDescriptor(); postConstructDesc.setLifecycleCallbackClass(pcClassName); postConstructDesc.setLifecycleCallbackMethod(pcMethodName); postConstructDesc.setMetadataSource(MetadataSource.ANNOTATION); // override by xml is handled in addPostConstructDescriptor rcContext.addPostConstructDescriptor(postConstructDesc); } return getDefaultProcessedResult(); } }