MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPostConstruct(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPreDestroy(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPrePassivate(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPostActivate(methodIdentifier); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass, methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build());
if (postConstructs != null) { for (LifecycleCallbackMetaData postConstruct : postConstructs) { String className = postConstruct.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) { if (preDestroys != null) { for (LifecycleCallbackMetaData preDestroy : preDestroys) { String className = preDestroy.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) {
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPostConstruct(methodIdentifier); if (postConstruct.getClassName() == null || postConstruct.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(postConstruct.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPreDestroy(methodIdentifier); if (preDestroy.getClassName() == null || preDestroy.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(preDestroy.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPrePassivate(methodIdentifier); if (prePassivate.getClassName() == null || prePassivate.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(prePassivate.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPostActivate(methodIdentifier); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(postActivate.getClassName(), builder.build());
for (LifecycleCallbackMetaData callback : this) className = callback.getClassName(); methodName = callback.getMethodName(); Class<?> lifecycleClass = className == null ? defaultClass : cl.loadClass(className);
/** * Process the @PostConstruct annotation * * @param object the Object * @throws IllegalAccessException * @throws InvocationTargetException */ public void postConstruct(Object object) throws IllegalAccessException, InvocationTargetException { if (webDD.getPostConstructs() == null) return; for (LifecycleCallbackMetaData metaData : webDD.getPostConstructs()) { try { Class<?> clazz = webLoader.loadClass(metaData.getClassName()); if (clazz.isAssignableFrom(object.getClass())) { // process LifecycleCallbackMetaData processesLifecycleCallbackMetaData(object, metaData); } } catch (ClassNotFoundException e) { throw new RuntimeException("Error invoking postConstruct method: " + metaData.getMethodName(), e); } } }
private void addInterceptorMethodAnnotation(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, LifecycleCallbacksMetaData callbacks, Class<? extends Annotation> ann, String xmlName) { if (callbacks == null) return; for(LifecycleCallbackMetaData callback : callbacks) { Class<?> callbackClass = loadClass(container, callback.getClassName()); addInterceptorMethodAnnotation(container, callbackClass, callback.getMethodName(), ann, xmlName); } }
/** * Process the @PreDestroy annotation. * * @param object the Object * @throws IllegalAccessException * @throws InvocationTargetException */ public void preDestroy(Object object) throws IllegalAccessException, InvocationTargetException { if (webDD.getPreDestroys() == null) return; for (LifecycleCallbackMetaData metaData : webDD.getPreDestroys()) { try { // Class<?> clazz = webLoader.loadClass(metaData.getClassName()); if (clazz.isAssignableFrom(object.getClass())) { // process LifecycleCallbackMetaData processesLifecycleCallbackMetaData(object, metaData); } } catch (ClassNotFoundException e) { throw new RuntimeException("Error invoking postConstruct method: " + metaData.getMethodName(), e); } } }
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPostConstruct(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPreDestroy(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPrePassivate(methodIdentifier); 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()); final MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName); builder.setPostActivate(methodIdentifier); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { final String className = ClassReflectionIndexUtil.findRequiredMethod(reflectionIndex, componentClass.getModuleClass(), methodIdentifier).getDeclaringClass().getName(); component.addInterceptorMethodOverride(className, builder.build());
if (postConstructs != null) { for (LifecycleCallbackMetaData postConstruct : postConstructs) { String className = postConstruct.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) { if (preDestroys != null) { for (LifecycleCallbackMetaData preDestroy : preDestroys) { String className = preDestroy.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) {
if (postConstructs != null) { for (LifecycleCallbackMetaData postConstruct : postConstructs) { String className = postConstruct.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) { if (preDestroys != null) { for (LifecycleCallbackMetaData preDestroy : preDestroys) { String className = preDestroy.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) {
if (postConstructs != null) { for (LifecycleCallbackMetaData postConstruct : postConstructs) { String className = postConstruct.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) { if (preDestroys != null) { for (LifecycleCallbackMetaData preDestroy : preDestroys) { String className = preDestroy.getClassName(); if (className == null || className.isEmpty()) { if (defaultClassName == null) {
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPostConstruct(methodIdentifier); if (postConstruct.getClassName() == null || postConstruct.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(postConstruct.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPreDestroy(methodIdentifier); if (preDestroy.getClassName() == null || preDestroy.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(preDestroy.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPrePassivate(methodIdentifier); if (prePassivate.getClassName() == null || prePassivate.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(prePassivate.getClassName(), builder.build()); MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(void.class, methodName, InvocationContext.class); builder.setPostActivate(methodIdentifier); if (postActivate.getClassName() == null || postActivate.getClassName().isEmpty()) { eeModuleDescription.addInterceptorMethodOverride(interceptorClassName, builder.build()); } else { eeModuleDescription.addInterceptorMethodOverride(postActivate.getClassName(), builder.build());