avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nader Aeinehchi" <na...@aeinehchi.com>
Subject What is the primary purpose of Serviceable interface?
Date Wed, 21 Apr 2004 21:51:31 GMT
Hi

I am trying to understand the primay usage of Serviceable interface.

In Merlin documentation, I find an example where a service consumer looks up for a certain
service.  This service consumer implements Serviceable interface.

1. Do I understand it correctly that Serviceable interface is supposed to be implemented by
service consumers?
2. Can service providers implement Serviceable interface?
3. Intuitively, I would suppose that service providers should Serviceable interface and not
service consumers.  How does Merlin think?

--------------------------------
 

Excerpt from Merlin examples:

public class HelloComponent extends AbstractLogEnabled 
  implements Initializable, Serviceable, Disposable
{
    RandomGenerator m_random = null;
    Identifiable m_identifiable = null;
   /**
    * Servicing of the component by the container during 
    * which service dependencies declared under the component
    * can be resolved using the supplied service manager.
    *
    * @param manager the service manager
    * @avalon.dependency type="tutorial.RandomGenerator:1.0"
    *    key="random"
    * @avalon.dependency type="tutorial.Identifiable"
    */
    public void service( ServiceManager manager )
      throws ServiceException
    {
        m_random = (RandomGenerator) manager.lookup( "random" );
        m_identifiable = 
          (Identifiable) manager.lookup( Identifiable.class.getName() );
    }


Best Regards
 
--
Nader Aeinehchi
Aasenhagen 66 E
2020 Skedsmokorset
NORWAY
Direct and Mobile +47 41 44 29 57
Tel (private): +47 64 83 09 08
Fax +47 64 83 08 07
www.aeinehchi.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message