Let me see if I have this correct. You have N event sources
that get wired to N listener. The wiring is done by the
deployer. There is generally 3 ways to do it in the latest Phoenix
source.

1. Get each listener to depend on an array of sources. This
means postfixing the dependency with "[]" and then wiring
multiple instances in assembly.xml something like

/**
 * @phoenix.dependency type="com.biz.Source[]"
 */
public void service( ServiceManager sm )
{
   _sources = (Source[])sm.lookup( Source[].class.getName() );
}

2. Use a listener to collect all the blocks that implement
the Source interface and then register them with the listeners
in applicationStarted() method.

3. Use linking components. These components have one dependency
on listener and one on source.

(3) is the most flexible as you can easily add metadata to the registration
but it is also the hardest for the deployer as they have to register every
source-listener.

(1) is the easiest to code but it is still fairly hard for the deployer as
they
have to to register every source-listener - though less work than (3).

(2) is easy to code and easy for the deployer as long as the registration
is relatively standard and no need to do too much custom registration it
is probably the easiest.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to