public void addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc) { String className = postConstructDesc.getLifecycleCallbackClass(); boolean found = false; for (LifecycleCallbackDescriptor next : getPostConstructDescriptors()) { if ( (next.getLifecycleCallbackClass() != null) && next.getLifecycleCallbackClass().equals(className)) { found = true; break; } } if (!found) { getPostConstructDescriptors().add(postConstructDesc); } }
public void addPostConstructDescriptor(LifecycleCallbackDescriptor postConstructDesc) { String className = postConstructDesc.getLifecycleCallbackClass(); boolean found = false; for (LifecycleCallbackDescriptor next : getPostConstructDescriptors()) { if ( (next.getLifecycleCallbackClass() != null) && next.getLifecycleCallbackClass().equals(className)) { found = true; break; } } if (!found) { getPostConstructDescriptors().add(postConstructDesc); } }
/** * visits a appclient descriptor * @param appclientdescriptor the application client descriptor */ public void accept(ApplicationClientDescriptor appclientdescriptor) { bundleDescriptor = appclientdescriptor; // set the default lifecycle callback class for (LifecycleCallbackDescriptor next : appclientdescriptor.getPreDestroyDescriptors()) { next.setDefaultLifecycleCallbackClass( appclientdescriptor.getMainClassName()); } for (LifecycleCallbackDescriptor next : appclientdescriptor.getPostConstructDescriptors()) { next.setDefaultLifecycleCallbackClass( appclientdescriptor.getMainClassName()); } }
@Override public void accept(ApplicationClientDescriptor appclientdescriptor) { bundleDescriptor = appclientdescriptor; application = appclientdescriptor.getApplication(); // set the default lifecycle callback class for (LifecycleCallbackDescriptor next : appclientdescriptor.getPreDestroyDescriptors()) { next.setDefaultLifecycleCallbackClass( appclientdescriptor.getMainClassName()); } for (LifecycleCallbackDescriptor next : appclientdescriptor.getPostConstructDescriptors()) { next.setDefaultLifecycleCallbackClass( appclientdescriptor.getMainClassName()); } } }
writePostConstructDescriptors(appclientNode, appclientDesc.getPostConstructDescriptors().iterator());
writeLifeCycleCallbackDescriptors(appclientNode, TagNames.POST_CONSTRUCT, appclientDesc.getPostConstructDescriptors());