org.picocontainer.defaults
Class DefaultComponentMulticasterAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.DefaultComponentMulticasterAdapter
All Implemented Interfaces:
ComponentMulticasterAdapter, Serializable

public class DefaultComponentMulticasterAdapter
extends Object
implements ComponentMulticasterAdapter, Serializable

A default implementation of the ComponentMulticasterAdapter interface.

Version:
$Revision: 1.4 $
Author:
Aslak Hellesøy, Chris Stevenson, rafal@caltha.pl
See Also:
Serialized Form

Constructor Summary
DefaultComponentMulticasterAdapter()
           
DefaultComponentMulticasterAdapter(ComponentMulticasterFactory factory)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponentMulticasterAdapter

public DefaultComponentMulticasterAdapter()

DefaultComponentMulticasterAdapter

public DefaultComponentMulticasterAdapter(ComponentMulticasterFactory factory)
Method Detail

getComponentMulticaster

public Object getComponentMulticaster(PicoContainer picoContainer,
                                      boolean callInInstantiationOrder)
                               throws PicoException
Description copied from interface: ComponentMulticasterAdapter
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.

Specified by:
getComponentMulticaster in interface ComponentMulticasterAdapter
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.
Throws:
PicoException


Copyright © 2003-2004 Codehaus. All Rights Reserved.