> -----Original Message-----
> From: Igor A. Deruga [mailto:[EMAIL PROTECTED]
> Sent: 26 October 2004 20:35
> To: 'Avalon framework users'
> Subject: Class servicing
> 
> Dear Friends!
> 
> I have a following entry in one of the .xinfo files:
> 
> ////////////////////code/////////////////////////////
>  <dependencies>
> ..........
>     <dependency key="SocketManager"
> type="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
> ..........
>   </dependencies>
> ////////////////////end of code/////////////////////////////
> 
> But the SocketManager is an interface. That is why the expression
> m_socketManager = (SocketManager)serviceManager.lookup(
"SocketManager" );
> doesnīt have sence!

Merlin maintains a registry of all of the components and a cross
reference to the services that each component is capable of providing
(and a bunch of other useful stuff).  When a lookup is invoked - what's
happening is that Merlin is providing a component that declares that it
supports the service in question (the actual binding happens during an
assembly phase that occurs way before any runtime activity).  This can
be overridden using dependency directives in you block.

> Evidently, serviceManager substitutes SocketManager with some class
that
> implements SocketManager interface and returns this class' instance.
But I
> canīt find where it is written which class to take instead.
> 
> Could you please give me a hint?

http://avalon.apache.org/central/about/tutorials/basic/dependencies/inde
x.html

Cheers, Steve.


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


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

Reply via email to