private void loadLifeCycleCallbacks() throws ConfigurationException {
if (!(getFactory().getDeclaration() instanceof AtomicImplementationDeclaration))
return;
AtomicImplementationDeclaration implementation = (AtomicImplementationDeclaration) getFactory().getDeclaration();
/*
* Add automatically a life-cycle callback in case the class implements directly the APAM component interface
*/
Class<?> pojoClass = this.getClazz();
if (ApamComponent.class.isAssignableFrom(pojoClass)) {
implementation.addCallback(AtomicImplementationDeclaration.Event.INIT, new CallbackDeclaration(implementation, "apamInit"));
implementation.addCallback(AtomicImplementationDeclaration.Event.REMOVE, new CallbackDeclaration(implementation, "apamRemove"));
}
/*
* register callbacks
*/
for (AtomicImplementationDeclaration.Event trigger : AtomicImplementationDeclaration.Event.values()) {
Set<CallbackDeclaration> callbacks = implementation.getCallback(trigger);
if (callbacks == null)
continue;
for (CallbackDeclaration callbackDeclaration : callbacks) {