// skip ejb modules... they have alreayd been processed
if (module.getType() == ConfigurationModuleType.EJB) {
return;
}
ClassFinder classFinder = module.getClassFinder();
AnnotatedApp annotatedApp = module.getAnnotatedApp();
if (annotatedApp == null) {
throw new NullPointerException("No AnnotatedApp supplied");
}
Map<String, LifecycleCallbackType> postConstructMap = mapLifecycleCallbacks(annotatedApp.getPostConstructArray(), annotatedApp.getComponentType());
Map<String, LifecycleCallbackType> preDestroyMap = mapLifecycleCallbacks(annotatedApp.getPreDestroyArray(), annotatedApp.getComponentType());
if (module.getClassFinder() != null) {
List<Method> postConstructs = classFinder.findAnnotatedMethods(PostConstruct.class);
for (Method m : postConstructs) {
String methodName = m.getName();
String className = m.getDeclaringClass().getName();
if (!postConstructMap.containsKey(className)) {
LifecycleCallbackType callback = annotatedApp.addPostConstruct();
FullyQualifiedClassType classType = callback.addNewLifecycleCallbackClass();
classType.setStringValue(className);
JavaIdentifierType method = callback.addNewLifecycleCallbackMethod();
method.setStringValue(methodName);
postConstructMap.put(className, callback);
}
}
List<Method> preDestroys = classFinder.findAnnotatedMethods(PreDestroy.class);
for (Method m : preDestroys) {
String methodName = m.getName();
String className = m.getDeclaringClass().getName();
if (!preDestroyMap.containsKey(className)) {
LifecycleCallbackType callback = annotatedApp.addPreDestroy();