On Tuesday 01 June 2004 23:37, Eike Stepper wrote:
> "Niclas Hedhman" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> news:[EMAIL PROTECTED]
>
> > So, you are talking about systems outside the components managed by
> > Merlin??
> >
> > If so, the 'proper' way is to create a "facility", which is a component
> > that is declaring that it wants the composition model in its context.
> > Once the facility gets the Model, it registers itself as a listener to
> > model changes, and can expose the available components to other parties,
> > over whatever medium is most convenenient/necessary.
>
> niclas,
>
> wow, that sounds exactly like what i'm looking for!
>
> how exactly would tha facility expose data to the embedding application?
> is there a better way than using a singleton or some static methods of the
> outside world?

I think I need to know what "outside world" is.
I assumed you were talking about accessing Merlin components from for instance 
SOAP, or maybe some RMI interface.

But the above sounds like you want the 'non-Merlin managed' part of an 
application within the same JVM to lookup components.

If it is the later, get the Model from the Kernel, lookup the componentmodel 
and call resolve(). This is out of my head and could be slightly off;

  String path = "/outcontainer/innercontainer/somename";
  ContainmentModel tlm = kernel.getModel();
  DeploymentModel dm = tlm.getModel( path );
  Object comp = dm.resolve();

You will be returned a proxy to the component, implementing the Service 
interface(s), so you won't have direct access to the implementation class, 
i.e. can't call life cycle methods and such.

(I now see that you can tie the two getModel() method calls together into a 
single kernel.locate( path )  instead. Should be the same thing.


As for how to implement SOAP, RMI, CORBA and so forth is beyond the support I 
am able to give.


Cheers
Niclas

-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+


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

Reply via email to