public boolean hasLifecycle(Class type) { return lifecycleStrategy.hasLifecycle(type); }
public void dispose(Object component) { lifecycleStrategy.dispose(component); }
public void start(Object component) { lifecycleStrategy.start(component); }
public void stop(Object component) { lifecycleStrategy.stop(component); }
for (ComponentAdapter componentAdapter : adapters) { if (componentAdapter instanceof LifecycleStrategy) { ((LifecycleStrategy) componentAdapter).stop(getInstance(componentAdapter));
/** * Invokes delegate hasLifecylce(Class) method if the delegate is a LifecycleStrategy * {@inheritDoc} */ public boolean hasLifecycle(Class type) { if ( delegate instanceof LifecycleStrategy ){ return ((LifecycleStrategy)delegate).hasLifecycle(type); } return false; }
/** * Dispose the components of this PicoContainer and all its logical child * containers. Any component implementing the lifecycle interface * {@link org.picocontainer.Disposable} will be disposed. * * @see #makeChildContainer() * @see #addChildContainer(PicoContainer) * @see #removeChildContainer(PicoContainer) */ public void dispose() { if (disposed) throw new IllegalStateException("Already disposed"); for (Iterator iterator = children.iterator(); iterator.hasNext();) { PicoContainer child = (PicoContainer) iterator.next(); child.dispose(); } Collection<ComponentAdapter> adapters = getComponentAdapters(); for (ComponentAdapter componentAdapter : adapters) { if (componentAdapter instanceof LifecycleStrategy) { ((LifecycleStrategy) componentAdapter).dispose(getInstance(componentAdapter)); } } disposed = true; }
/** * Invokes delegate stop method if the delegate is a LifecycleStrategy * {@inheritDoc} */ public void stop(Object component) { if ( delegate instanceof LifecycleStrategy ){ ((LifecycleStrategy)delegate).stop(component); } }
/** * Start the components of this PicoContainer and all its logical child * containers. Any component implementing the lifecycle interface * {@link org.picocontainer.Startable} will be started. * * @see #makeChildContainer() * @see #addChildContainer(PicoContainer) * @see #removeChildContainer(PicoContainer) */ public void start() { if (disposed) throw new IllegalStateException("Already disposed"); if (started) throw new IllegalStateException("Already started"); started = true; Collection<ComponentAdapter> adapters = getComponentAdapters(); for (ComponentAdapter componentAdapter : adapters) { if (componentAdapter instanceof LifecycleStrategy) { ((LifecycleStrategy) componentAdapter).start(getInstance(componentAdapter)); } } childrenStarted.clear(); for (Iterator iterator = children.iterator(); iterator.hasNext();) { PicoContainer child = (PicoContainer) iterator.next(); childrenStarted.add(new Integer(child.hashCode())); child.start(); } }
public boolean hasLifecycle(Class type) { return lifecycleStrategy.hasLifecycle(type); }
/** * Invokes delegate dispose method if the delegate is a LifecycleStrategy * {@inheritDoc} */ public void dispose(Object component) { if ( delegate instanceof LifecycleStrategy ){ ((LifecycleStrategy)delegate).dispose(component); } }
public void stop(Object component) { lifecycleStrategy.stop(componentInstance); }
/** * Invokes delegate start method if the delegate is a LifecycleStrategy * {@inheritDoc} */ public void start(Object component) { if ( delegate instanceof LifecycleStrategy ){ ((LifecycleStrategy)delegate).start(component); } }
public boolean hasLifecycle(Class type) { return lifecycleStrategy.hasLifecycle(type); }
public void dispose(Object component) { lifecycleStrategy.dispose(componentInstance); }
public void stop(Object component) { lifecycleStrategy.stop(component); }
public void start(Object component) { lifecycleStrategy.start(component); }
public CachingComponentAdapter(ComponentAdapter delegate, ObjectReference instanceReference) { super(delegate); this.instanceReference = instanceReference; this.disposed = false; this.started = false; this.delegateHasLifecylce = delegate instanceof LifecycleStrategy && ((LifecycleStrategy) delegate).hasLifecycle(delegate.getComponentImplementation()); }
public void dispose(Object component) { lifecycleStrategy.dispose(component); }
public void start(Object component) { lifecycleStrategy.start(componentInstance); }