use of org.glassfish.hk2.api.InstanceLifecycleEvent in project Payara by payara.
the class ConfigInstanceListener method lifecycleEvent.
/* (non-Javadoc)
* @see org.glassfish.hk2.api.InstanceLifecycleListener#lifecycleEvent(org.glassfish.hk2.api.InstanceLifecycleEvent)
*/
@Override
public void lifecycleEvent(InstanceLifecycleEvent lifecycleEvent) {
if (!lifecycleEvent.getEventType().equals(InstanceLifecycleEventType.POST_PRODUCTION)) {
return;
}
Map<Injectee, Object> injectees = lifecycleEvent.getKnownInjectees();
if (injectees == null)
return;
ConfigListener listener = (ConfigListener) lifecycleEvent.getLifecycleObject();
for (Object injectee : injectees.values()) {
if (!(injectee instanceof ConfigBeanProxy))
continue;
ConfigBeanProxy configBeanProxy = (ConfigBeanProxy) injectee;
Object impl = ConfigSupport.getImpl(configBeanProxy);
if (!(impl instanceof ObservableBean))
continue;
ObservableBean ob = (ObservableBean) impl;
ob.addListener(listener);
}
}
Aggregations