Guys,
While Aaron is working on some examples in this regard , could some one point that after we do
m_kernel = factory.create( criteria ) and our kernel is created, what steps need to be followed to access a component loaded in a container in this kernel ( or whatever).
Under the current 3.3 (CVS HEAD) you proceed as follows - first off, get the root containment model. Once you have access to the to the root container you can get component models based on their respective addresses. With access to the model you can do a bunch of things like modifying configurations and so on. But what you probably want to do is to get an instance of the component represented by the model. Here is an example:
ContainmentModel root = m_kernel.getModel(); ComponentModel model = root.getModel( "/test/hello" ); Object instance = model.resolve();
If you using 3.2.5 your doing much the same thing except you apply operations against blocks and appliance instances.
For example;
Block root = m_kernel.getBlock(); Appliance appliance = root.locate( "/test/hello" ); Object instance = appliance.resolve();
Just for reference - under 3.3 I've been doing some things to simplify initial context creation and I'll be looking at adding support for the retrieval of models based on a service dependency (both of which should make things easier with embedding applications).
Cheers, Steve.
I have taken a look at the kernel and appliance api docs and with a little guidance might be able to make things work for me.
Or pls point out which specific class or testcase or whatever in CVS is doing such function and I'll follow the steps from there.
Aaron showed how to use the ServiceManager in Fortress but I need it for Merlin.
I kinda need this .
Thanks
From: Niclas Hedhman <[EMAIL PROTECTED]> Reply-To: "Avalon framework users" <[EMAIL PROTECTED]> To: "Avalon framework users" <[EMAIL PROTECTED]> Subject: Re: Accessing components from Non components Date: Tue, 17 Feb 2004 09:33:09 +0800
On Tuesday 17 February 2004 05:19, Vikas Phonsa wrote: > > * A simple webapp which starts up a container and then has a second > > servlet access services via the container > Yeah, very right. This would take things to the next level.
FWIW (not directly related to the line of questioning, but probably interesting in this context), very recently the work of enhancing Merlin with the ability to understand Servlet lifecycles has been started. Some issues remains, but expect completion in this area in the next couple of weeks.
I.e. Merlin loads Jetty as a servlet container, and is the manager of the servlets for Jetty.
Niclas
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Find and compare great deals on Broadband access at the MSN High-Speed Marketplace. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
