org.picocontainer.defaults
Interface ComponentMulticasterAdapter

All Known Implementing Classes:
DefaultComponentMulticasterAdapter

public interface ComponentMulticasterAdapter

Adds component multicasting capabilities to a pico adapter.

Version:
$Revision: 1.3 $
Author:
Aslak Hellesøy, Chris Stevenson, rafal@caltha.pl

Method Summary
 Object getComponentMulticaster(PicoContainer picoContainer, boolean callInInstantiationOrder)
          Returns an object (in fact, a dynamic proxy) that implements the union of all the interfaces of the currently registered components.
 

Method Detail

getComponentMulticaster

public Object getComponentMulticaster(PicoContainer picoContainer,
                                      boolean callInInstantiationOrder)
Returns an object (in fact, a dynamic proxy) that implements the union of all the interfaces of the currently registered components.

Casting this object to any of those interfaces and then calling a method on it will result in that call being multicast to all the components implementing that given interface.

This is a simple yet extremely powerful way to handle lifecycle of components. Component writers can invent their own lifecycle interfaces, and then use the multicaster to invoke the method in one go.

Parameters:
picoContainer - the container containing the components to multicast to.
callInInstantiationOrder - true if calls should be done in components' instantiation order.
Returns:
a multicaster object.


Copyright © 2003-2004 Codehaus. All Rights Reserved.