You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Yang Lei <ge...@gmail.com> on 2006/08/04 19:33:24 UTC

How can I load SCDL into object model w/o hardcoding the loaders

Hello,

With M1 Driver, I can load a sca.module by creating a StAXLoaderRegistry and
registering loaders into it.  I wonder if Tuscany has a better way for me to
get a StAXLoaderRegistry  (or some other instance) fully loaded with all the
loaders (Tuscany basics or other extensions ) so I can load any SCDL w/o
worrying of what are the current supported loaders...

The purpose of loading the SCDL is to read the defintion to start some
processing w/o creating the moduleContext and start it.

Appreciate your help.

Yang.

Re: How can I load SCDL into object model w/o hardcoding the loaders

Posted by Jim Marino <jm...@myromatours.com>.
On Aug 4, 2006, at 2:04 PM, Yang Lei wrote:

> Thanks Jim,
>
> I used "code gen" as an example as why I need to read SCDL. It is  
> not a
> requirement on Tuscany, nor I want Tuscany to trigger some  
> operation for me
> during starting a SCA module component. And I was not thinking of  
> byte code
> weaving , although allowing them seems cool.
>
> My requirement is simply to get the registry of all the exisiting  
> loaders to
> load SCDL from it: so I can get the chain of information:
> Module->Component->Service/Referece...
>
> From my point of view, both the SCDL object model and the loaders  
> already
> exist, we just need to group them in a way to offer some cool  
> features :
> such as "SCDL4J". I hope there is already the ability. If not , it  
> would be
> better to have one.
I'm not sure I follow what "SCDL4J" would do...Perhaps in a topdown  
case generate implementation skeletons from an assembly or in the  
bottom up case produce an assembly from implementations/component  
types? You could use the loaders but the problem is they presuppose  
portions of the runtime infrastructure that are not relevant in a  
tooling environment. For example, the loaders take a deployment  
context that has a scope container. I think it would be easier to  
just parse the XML as Jeremy mentioned previously and avoid the  
unnecessary runtime infrastructure . Am I misunderstanding what you  
are trying to do?
>
> Yang.
>
>
>
> On 8/4/06, Jim Marino <jm...@myromatours.com> wrote:
>>
>>
>> On Aug 4, 2006, at 1:27 PM, Yang Lei wrote:
>>
>> > Thanks Jeremy,
>> >
>> > Basically, what I need is something like WSDL4J , maybe a "SCDL4J",
>> > which
>> > contains the WSDL object model and a reader/writer. Tuscany already
>> > has the
>> > SCDL object model, also the loaders, I was able to manually
>> > register loaders
>> > (subclass of StAXElementLoader or AbstractLoader , itself a
>> > subclass of
>> > StAXElementLoader ) to StAXLoaderRegistry,  and StAXLoaderRegistry
>> > can load
>> > SCDL and all the information loadable from the loaders.
>> >
>> > Now I need to find a way NOT to do the registration manually.
>> >
>> > The reason we need this feature is: before a sca pacakge is
>> > installed into
>> > Tuscany, I may want to expose some of the SCDL for user to do last
>> > minute
>> > updates,
>> This is really what the override mechanism is for in SCA. The
>> override mechanism was put in place to deal with this use case as
>> well as prohibit random edits at deployment time.
>>
>> > or some definition may trigger some other processing, e.g. some
>> > binding extensions need J2EE side of code gen..
>> Can you explain why the code gen needs to be done, i.e. the specific
>> case, and why it must be done in the loader? If we need to do
>> bytecode manipulation such as AspectJ does (which we should probably
>> allow), we should probably allow a bytecode preprocessor to be
>> invoked prior to referencing a class in the runtime but I think you
>> are getting at something different.
>>
>> > This "SCDL4J" feature can
>> > enable us do it.
>> >
>> > So my question to your suggestion to start a runtime is:
>> > 1. is the runtime a runtimeContext?
>> > 2. how I can get the registry from the runtime? is the registry
>> > StAXLoaderRegistry?
>> >
>> > I tried to see from the class reference of StAXLoaderRegistry and
>> > StAXLoaderRegistryImpl to find clue on how to get it, was not able
>> > too.. All
>> > the current test cases on loader are registering loader manually.
>> >
>> > Appreciate your help.
>> >
>> > Yang
>> >
>> > On 8/4/06, Jeremy Boynes <jb...@apache.org> wrote:
>> >>
>> >> On Aug 4, 2006, at 10:33 AM, Yang Lei wrote:
>> >>
>> >> > Hello,
>> >> >
>> >> > With M1 Driver, I can load a sca.module by creating a
>> >> > StAXLoaderRegistry and
>> >> > registering loaders into it.  I wonder if Tuscany has a  
>> better way
>> >> > for me to
>> >> > get a StAXLoaderRegistry  (or some other instance) fully loaded
>> >> > with all the
>> >> > loaders (Tuscany basics or other extensions ) so I can load any
>> >> > SCDL w/o
>> >> > worrying of what are the current supported loaders...
>> >> >
>> >> > The purpose of loading the SCDL is to read the defintion to
>> >> start some
>> >> > processing w/o creating the moduleContext and start it.
>> >>
>> >> Yang, could you give a little more information on what you are  
>> trying
>> >> to do?
>> >>
>> >> The loader infrastructure is designed to support deployment  
>> scenarios
>> >> where we need to create the runtime artifacts needed to host the
>> >> user's application. This needs a lot of additional  
>> infrastructure to
>> >> capture information not contained in the SCDL (for example,
>> >> introspecting Java classes, loading external files, ...). To do  
>> all
>> >> that you really need the runtime running (as it has the mechanisms
>> >> for loading extensions, introspection, resolving external  
>> artifacts
>> >> and so on). From the running runtime you can access the  
>> registry as a
>> >> service.
>> >>
>> >> On the other hand, if you are in a tooling environment and are  
>> just
>> >> editing the SCDL, you may not need all that. If you're looking to
>> >> slurp in XML, edit it and write it out again, some form of XML  
>> editor
>> >> (e.g. vi) or modeler (e.g. EMF) may be more appropriate.
>> >>
>> >> --
>> >> Jeremy
>> >>
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>> >>
>> >>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>


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


Re: How can I load SCDL into object model w/o hardcoding the loaders

Posted by Yang Lei <ge...@gmail.com>.
Thanks Jim,

I used "code gen" as an example as why I need to read SCDL. It is not a
requirement on Tuscany, nor I want Tuscany to trigger some operation for me
during starting a SCA module component. And I was not thinking of byte code
weaving , although allowing them seems cool.

My requirement is simply to get the registry of all the exisiting loaders to
load SCDL from it: so I can get the chain of information:
Module->Component->Service/Referece...

>From my point of view, both the SCDL object model and the loaders already
exist, we just need to group them in a way to offer some cool features :
such as "SCDL4J". I hope there is already the ability. If not , it would be
better to have one.

Yang.



On 8/4/06, Jim Marino <jm...@myromatours.com> wrote:
>
>
> On Aug 4, 2006, at 1:27 PM, Yang Lei wrote:
>
> > Thanks Jeremy,
> >
> > Basically, what I need is something like WSDL4J , maybe a "SCDL4J",
> > which
> > contains the WSDL object model and a reader/writer. Tuscany already
> > has the
> > SCDL object model, also the loaders, I was able to manually
> > register loaders
> > (subclass of StAXElementLoader or AbstractLoader , itself a
> > subclass of
> > StAXElementLoader ) to StAXLoaderRegistry,  and StAXLoaderRegistry
> > can load
> > SCDL and all the information loadable from the loaders.
> >
> > Now I need to find a way NOT to do the registration manually.
> >
> > The reason we need this feature is: before a sca pacakge is
> > installed into
> > Tuscany, I may want to expose some of the SCDL for user to do last
> > minute
> > updates,
> This is really what the override mechanism is for in SCA. The
> override mechanism was put in place to deal with this use case as
> well as prohibit random edits at deployment time.
>
> > or some definition may trigger some other processing, e.g. some
> > binding extensions need J2EE side of code gen..
> Can you explain why the code gen needs to be done, i.e. the specific
> case, and why it must be done in the loader? If we need to do
> bytecode manipulation such as AspectJ does (which we should probably
> allow), we should probably allow a bytecode preprocessor to be
> invoked prior to referencing a class in the runtime but I think you
> are getting at something different.
>
> > This "SCDL4J" feature can
> > enable us do it.
> >
> > So my question to your suggestion to start a runtime is:
> > 1. is the runtime a runtimeContext?
> > 2. how I can get the registry from the runtime? is the registry
> > StAXLoaderRegistry?
> >
> > I tried to see from the class reference of StAXLoaderRegistry and
> > StAXLoaderRegistryImpl to find clue on how to get it, was not able
> > too.. All
> > the current test cases on loader are registering loader manually.
> >
> > Appreciate your help.
> >
> > Yang
> >
> > On 8/4/06, Jeremy Boynes <jb...@apache.org> wrote:
> >>
> >> On Aug 4, 2006, at 10:33 AM, Yang Lei wrote:
> >>
> >> > Hello,
> >> >
> >> > With M1 Driver, I can load a sca.module by creating a
> >> > StAXLoaderRegistry and
> >> > registering loaders into it.  I wonder if Tuscany has a better way
> >> > for me to
> >> > get a StAXLoaderRegistry  (or some other instance) fully loaded
> >> > with all the
> >> > loaders (Tuscany basics or other extensions ) so I can load any
> >> > SCDL w/o
> >> > worrying of what are the current supported loaders...
> >> >
> >> > The purpose of loading the SCDL is to read the defintion to
> >> start some
> >> > processing w/o creating the moduleContext and start it.
> >>
> >> Yang, could you give a little more information on what you are trying
> >> to do?
> >>
> >> The loader infrastructure is designed to support deployment scenarios
> >> where we need to create the runtime artifacts needed to host the
> >> user's application. This needs a lot of additional infrastructure to
> >> capture information not contained in the SCDL (for example,
> >> introspecting Java classes, loading external files, ...). To do all
> >> that you really need the runtime running (as it has the mechanisms
> >> for loading extensions, introspection, resolving external artifacts
> >> and so on). From the running runtime you can access the registry as a
> >> service.
> >>
> >> On the other hand, if you are in a tooling environment and are just
> >> editing the SCDL, you may not need all that. If you're looking to
> >> slurp in XML, edit it and write it out again, some form of XML editor
> >> (e.g. vi) or modeler (e.g. EMF) may be more appropriate.
> >>
> >> --
> >> Jeremy
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: How can I load SCDL into object model w/o hardcoding the loaders

Posted by Jim Marino <jm...@myromatours.com>.
On Aug 4, 2006, at 1:27 PM, Yang Lei wrote:

> Thanks Jeremy,
>
> Basically, what I need is something like WSDL4J , maybe a "SCDL4J",  
> which
> contains the WSDL object model and a reader/writer. Tuscany already  
> has the
> SCDL object model, also the loaders, I was able to manually  
> register loaders
> (subclass of StAXElementLoader or AbstractLoader , itself a  
> subclass of
> StAXElementLoader ) to StAXLoaderRegistry,  and StAXLoaderRegistry  
> can load
> SCDL and all the information loadable from the loaders.
>
> Now I need to find a way NOT to do the registration manually.
>
> The reason we need this feature is: before a sca pacakge is  
> installed into
> Tuscany, I may want to expose some of the SCDL for user to do last  
> minute
> updates,
This is really what the override mechanism is for in SCA. The  
override mechanism was put in place to deal with this use case as  
well as prohibit random edits at deployment time.

> or some definition may trigger some other processing, e.g. some
> binding extensions need J2EE side of code gen..
Can you explain why the code gen needs to be done, i.e. the specific  
case, and why it must be done in the loader? If we need to do  
bytecode manipulation such as AspectJ does (which we should probably  
allow), we should probably allow a bytecode preprocessor to be  
invoked prior to referencing a class in the runtime but I think you  
are getting at something different.

> This "SCDL4J" feature can
> enable us do it.
>
> So my question to your suggestion to start a runtime is:
> 1. is the runtime a runtimeContext?
> 2. how I can get the registry from the runtime? is the registry
> StAXLoaderRegistry?
>
> I tried to see from the class reference of StAXLoaderRegistry and
> StAXLoaderRegistryImpl to find clue on how to get it, was not able  
> too.. All
> the current test cases on loader are registering loader manually.
>
> Appreciate your help.
>
> Yang
>
> On 8/4/06, Jeremy Boynes <jb...@apache.org> wrote:
>>
>> On Aug 4, 2006, at 10:33 AM, Yang Lei wrote:
>>
>> > Hello,
>> >
>> > With M1 Driver, I can load a sca.module by creating a
>> > StAXLoaderRegistry and
>> > registering loaders into it.  I wonder if Tuscany has a better way
>> > for me to
>> > get a StAXLoaderRegistry  (or some other instance) fully loaded
>> > with all the
>> > loaders (Tuscany basics or other extensions ) so I can load any
>> > SCDL w/o
>> > worrying of what are the current supported loaders...
>> >
>> > The purpose of loading the SCDL is to read the defintion to  
>> start some
>> > processing w/o creating the moduleContext and start it.
>>
>> Yang, could you give a little more information on what you are trying
>> to do?
>>
>> The loader infrastructure is designed to support deployment scenarios
>> where we need to create the runtime artifacts needed to host the
>> user's application. This needs a lot of additional infrastructure to
>> capture information not contained in the SCDL (for example,
>> introspecting Java classes, loading external files, ...). To do all
>> that you really need the runtime running (as it has the mechanisms
>> for loading extensions, introspection, resolving external artifacts
>> and so on). From the running runtime you can access the registry as a
>> service.
>>
>> On the other hand, if you are in a tooling environment and are just
>> editing the SCDL, you may not need all that. If you're looking to
>> slurp in XML, edit it and write it out again, some form of XML editor
>> (e.g. vi) or modeler (e.g. EMF) may be more appropriate.
>>
>> --
>> Jeremy
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>>


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


Re: How can I load SCDL into object model w/o hardcoding the loaders

Posted by Yang Lei <ge...@gmail.com>.
Thanks Jeremy,

Basically, what I need is something like WSDL4J , maybe a "SCDL4J", which
contains the WSDL object model and a reader/writer. Tuscany already has the
SCDL object model, also the loaders, I was able to manually register loaders
(subclass of StAXElementLoader or AbstractLoader , itself a subclass of
StAXElementLoader ) to StAXLoaderRegistry,  and StAXLoaderRegistry can load
SCDL and all the information loadable from the loaders.

Now I need to find a way NOT to do the registration manually.

The reason we need this feature is: before a sca pacakge is installed into
Tuscany, I may want to expose some of the SCDL for user to do last minute
updates, or some definition may trigger some other processing, e.g. some
binding extensions need J2EE side of code gen.. This "SCDL4J" feature can
enable us do it.

So my question to your suggestion to start a runtime is:
1. is the runtime a runtimeContext?
2. how I can get the registry from the runtime? is the registry
StAXLoaderRegistry?

I tried to see from the class reference of StAXLoaderRegistry and
StAXLoaderRegistryImpl to find clue on how to get it, was not able too.. All
the current test cases on loader are registering loader manually.

Appreciate your help.

Yang

On 8/4/06, Jeremy Boynes <jb...@apache.org> wrote:
>
> On Aug 4, 2006, at 10:33 AM, Yang Lei wrote:
>
> > Hello,
> >
> > With M1 Driver, I can load a sca.module by creating a
> > StAXLoaderRegistry and
> > registering loaders into it.  I wonder if Tuscany has a better way
> > for me to
> > get a StAXLoaderRegistry  (or some other instance) fully loaded
> > with all the
> > loaders (Tuscany basics or other extensions ) so I can load any
> > SCDL w/o
> > worrying of what are the current supported loaders...
> >
> > The purpose of loading the SCDL is to read the defintion to start some
> > processing w/o creating the moduleContext and start it.
>
> Yang, could you give a little more information on what you are trying
> to do?
>
> The loader infrastructure is designed to support deployment scenarios
> where we need to create the runtime artifacts needed to host the
> user's application. This needs a lot of additional infrastructure to
> capture information not contained in the SCDL (for example,
> introspecting Java classes, loading external files, ...). To do all
> that you really need the runtime running (as it has the mechanisms
> for loading extensions, introspection, resolving external artifacts
> and so on). From the running runtime you can access the registry as a
> service.
>
> On the other hand, if you are in a tooling environment and are just
> editing the SCDL, you may not need all that. If you're looking to
> slurp in XML, edit it and write it out again, some form of XML editor
> (e.g. vi) or modeler (e.g. EMF) may be more appropriate.
>
> --
> Jeremy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: How can I load SCDL into object model w/o hardcoding the loaders

Posted by Jeremy Boynes <jb...@apache.org>.
On Aug 4, 2006, at 10:33 AM, Yang Lei wrote:

> Hello,
>
> With M1 Driver, I can load a sca.module by creating a  
> StAXLoaderRegistry and
> registering loaders into it.  I wonder if Tuscany has a better way  
> for me to
> get a StAXLoaderRegistry  (or some other instance) fully loaded  
> with all the
> loaders (Tuscany basics or other extensions ) so I can load any  
> SCDL w/o
> worrying of what are the current supported loaders...
>
> The purpose of loading the SCDL is to read the defintion to start some
> processing w/o creating the moduleContext and start it.

Yang, could you give a little more information on what you are trying  
to do?

The loader infrastructure is designed to support deployment scenarios  
where we need to create the runtime artifacts needed to host the  
user's application. This needs a lot of additional infrastructure to  
capture information not contained in the SCDL (for example,  
introspecting Java classes, loading external files, ...). To do all  
that you really need the runtime running (as it has the mechanisms  
for loading extensions, introspection, resolving external artifacts  
and so on). From the running runtime you can access the registry as a  
service.

On the other hand, if you are in a tooling environment and are just  
editing the SCDL, you may not need all that. If you're looking to  
slurp in XML, edit it and write it out again, some form of XML editor  
(e.g. vi) or modeler (e.g. EMF) may be more appropriate.

--
Jeremy


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