/** * Changes monitor in the ComponentAdapterFactory, the component adapters * and the child containers, if these support a ComponentMonitorStrategy. * {@inheritDoc} */ public void changeMonitor(ComponentMonitor monitor) { // will also change monitor in lifecycleStrategyForInstanceRegistrations if (componentAdapterFactory instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) componentAdapterFactory).changeMonitor(monitor); } for (Iterator i = compAdapters.iterator(); i.hasNext();) { Object adapter = i.next(); if (adapter instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) adapter).changeMonitor(monitor); } } for (Iterator i = children.iterator(); i.hasNext();) { Object child = i.next(); if (child instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) child).changeMonitor(monitor); } } }
/** * Delegates change of monitor if the delegate supports * a component monitor strategy. * {@inheritDoc} */ public void changeMonitor(ComponentMonitor monitor) { if ( delegate instanceof ComponentMonitorStrategy ){ ((ComponentMonitorStrategy)delegate).changeMonitor(monitor); } }
/** * Changes monitor in the ComponentAdapterFactory, the component adapters * and the child containers, if these support a ComponentMonitorStrategy. * {@inheritDoc} */ public void changeMonitor(ComponentMonitor monitor) { // will also change monitor in lifecycleStrategyForInstanceRegistrations if (componentAdapterFactory instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) componentAdapterFactory).changeMonitor(monitor); } for ( Iterator i = componentAdapters.iterator(); i.hasNext(); ){ Object adapter = i.next(); if ( adapter instanceof ComponentMonitorStrategy ) { ((ComponentMonitorStrategy)adapter).changeMonitor(monitor); } } for (Iterator i = children.iterator(); i.hasNext();) { Object child = i.next(); if (child instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) child).changeMonitor(monitor); } } }
public void changeMonitor(ComponentMonitor monitor) { super.changeMonitor(monitor); if (lifecycleStrategy instanceof ComponentMonitorStrategy) { ((ComponentMonitorStrategy) lifecycleStrategy).changeMonitor(monitor); } }
/** * If the delegate supports a {@link ComponentMonitorStrategy monitor strategy}, * this is used to changed the monitor while keeping the same delegate. * Else the delegate is replaced by the new monitor. * {@inheritDoc} */ public void changeMonitor(ComponentMonitor monitor) { checkMonitor(monitor); if ( delegate instanceof ComponentMonitorStrategy ){ ((ComponentMonitorStrategy)delegate).changeMonitor(monitor); } else { delegate = monitor; } }