You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Niclas Hedhman <ni...@hedhman.org> on 2003/11/04 07:35:53 UTC

The Eclipse Plug-in

Stephen,
I need to build the dependency model in memory, i.e.

component --- (dependsOn)  --->  service

for the View to show, and the tool to assign (visually and in block.xml) a 
component that fullfils that service.

You must have this already in the server, so instead of re-doing the work, I 
should be able to re-use your code.

Starting simple, if I have grabbed the Type Descriptor, what is a reasonable 
entry point in your current code??

Cheers,
Niclas



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: The Eclipse Plug-in

Posted by Niclas Hedhman <ni...@hedhman.org>.
Thanks,
I think it will, but bear with me; Getting into other people's code is not 
that easy. And that's why so many people "starts fresh" because it is 
"faster", but I'm an old dog, who have learned the opposite over the year, 
that it only "feels" faster.

Cheers,
Niclas

On Wednesday 05 November 2003 06:54, Stephen McConnell wrote:
> Niclas Hedhman wrote:
> >Stephen,
> >I need to build the dependency model in memory, i.e.
> >
> >component --- (dependsOn)  --->  service
> >
> >for the View to show, and the tool to assign (visually and in block.xml) a
> >component that fullfils that service.
> >
> >You must have this already in the server, so instead of re-doing the work,
> > I should be able to re-use your code.
> >
> >Starting simple, if I have grabbed the Type Descriptor, what is a
> > reasonable entry point in your current code??
>
> Lets assume that you have an Eclipse plugin and that you have aquired a
> reference to the root block (an empty block).  At this point, you can
> programatically build a container that is a refection of the development
> environment.  This would involve:
>
> (a) creation of a ContainmentProfile [1]
> (b) addition of the ContainmentProfile to the root block's
> ContainmentModel [2].
>
> To construct a containment profile you need to create a
> ClassLoaderDirective which you would probably do using information from
> the Eclipse environment. When you add you new profile to the root
> block's model you get back a  ContainmentModel which you can usee to
> programatically add sub-containers, component profiles, etc.
>
> [1]
> http://avalon.apache.org/merlin/api/org/apache/avalon/composition/data/Cont
>ainmentProfile.html [2]
> http://avalon.apache.org/merlin/api/org/apache/avalon/composition/model/Con
>tainmentModel.html
>
>
> With a ContainmentModel established, you have a lot of information
> available to you.  Using operations on ContainmentModel you can get the
> ClassLoaderModel and from that get the TypeRepository and
> ProfileRepository which means that you have access to all of the types
> in scope, and all of the profiles for each type.  To actually see a
> dependency graph, you need to assembly your container which is handled
> by classes at the activation package level.  Using the kernel interface
> you can get the Block instance that is responsible for managing you
> container by invoking:
>
>   Block myBlock = getBlock( myContainmentModel );
>
> You can then assemble your block by doing the following:
>
>   ((Composite)myBlock).assemble();
>
> To present the assembly graph, you would need to grab the type
> dependency list and for esch dependnecy, lookup the associated appliance
> using something like
>
>   Appliance appliance = myBlock.locate( aDependency ).
>
> Naturally, a complete meta-model is available for every appliance using
> something like:
>
>   Model model = appliance.getModel();
>
> You can then manipulate info based on the type of model returned
> (DeploymentModel, ContainmentModel, etc.).
>
> Hope that helps.
>
> Cheers, Steve.
>
> >Cheers,
> >Niclas
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
> >For additional commands, e-mail: dev-help@avalon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: The Eclipse Plug-in

Posted by Stephen McConnell <mc...@apache.org>.

Niclas Hedhman wrote:

>Stephen,
>I need to build the dependency model in memory, i.e.
>
>component --- (dependsOn)  --->  service
>
>for the View to show, and the tool to assign (visually and in block.xml) a 
>component that fullfils that service.
>
>You must have this already in the server, so instead of re-doing the work, I 
>should be able to re-use your code.
>
>Starting simple, if I have grabbed the Type Descriptor, what is a reasonable 
>entry point in your current code??
>

Lets assume that you have an Eclipse plugin and that you have aquired a 
reference to the root block (an empty block).  At this point, you can 
programatically build a container that is a refection of the development 
environment.  This would involve:

(a) creation of a ContainmentProfile [1]
(b) addition of the ContainmentProfile to the root block's 
ContainmentModel [2].

To construct a containment profile you need to create a 
ClassLoaderDirective which you would probably do using information from 
the Eclipse environment. When you add you new profile to the root 
block's model you get back a  ContainmentModel which you can usee to 
programatically add sub-containers, component profiles, etc.

[1] 
http://avalon.apache.org/merlin/api/org/apache/avalon/composition/data/ContainmentProfile.html
[2] 
http://avalon.apache.org/merlin/api/org/apache/avalon/composition/model/ContainmentModel.html


With a ContainmentModel established, you have a lot of information 
available to you.  Using operations on ContainmentModel you can get the 
ClassLoaderModel and from that get the TypeRepository and 
ProfileRepository which means that you have access to all of the types 
in scope, and all of the profiles for each type.  To actually see a 
dependency graph, you need to assembly your container which is handled 
by classes at the activation package level.  Using the kernel interface 
you can get the Block instance that is responsible for managing you 
container by invoking:

  Block myBlock = getBlock( myContainmentModel );

You can then assemble your block by doing the following:

  ((Composite)myBlock).assemble();

To present the assembly graph, you would need to grab the type 
dependency list and for esch dependnecy, lookup the associated appliance 
using something like

  Appliance appliance = myBlock.locate( aDependency ).

Naturally, a complete meta-model is available for every appliance using 
something like:

  Model model = appliance.getModel();

You can then manipulate info based on the type of model returned 
(DeploymentModel, ContainmentModel, etc.).

Hope that helps.

Cheers, Steve.

>
>Cheers,
>Niclas
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>  
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org