> -----Original Message-----
> From: Justin Permar [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 06, 2004 8:52 PM
> To: [EMAIL PROTECTED]
> Subject: merlin's use of .xinfo
>
>
> I noticed maven (xdoclet) generates the .xinfo file from the
> @avalon.component and @avalon.service tags. What does Merlin
> does with the .xinfo files?

The .xinfo file tells Merlin what Type (org.apache.avalon.meta.info.Type) a
given component represents. Although the notion of a Type is much more
complex you could think of a Type as a combination of service and component
where service means interface and component means implementor. Upon
deploying a jar Merlin will scan it for any .xinfo files included and thus
determine which services are provided by this jar. Merlin will use this
information to automagically resolve service dependencies. If you have a
look at HelloComponent in the dependencies tutorial you will notice the

@avalon.dependency type="tutorial.RandomGenerator:1.0"
    key="random"

tag in the service() method. It tells Merlin that this component is
dependent on another component offering the tutorial.RandomGenerator
(Version 1.0) service. You do not need to specify the implementation class
since Merlin will look up a fitting candidate using the .xinfo information.

>
> More specifically, how is the service type (ifc) used in
> Merlin, and does that impact user code at all (component
> code). The only direct thing I can see a component's service
> offering affecting is simply what services other components
> can use. However, in code I've written so far, there is no
> "service browser", "service repository", etc that I use to
> check available service or service interfaces. All I do is
> simply ask for a service by name. Maybe I'm not using the
> service part of the framework yet?
>

Well, why make things more complicated than they need to be? Why would you
want to look for a service if all you have to do is ask for it and Merlin
will deliver? If you are using the ServiceManager you are using the service
part of the framework. You could call the ServiceManager a "service
repository". Merlin goes to great lengths in order to automate dependency
resolution so that you as a client programmer need not worry about these
things. I think it's one of this project's key goals. Sit back and enjoy.

Hope this helps,

Olaf


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

Reply via email to