You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Florian Rosenberg <fr...@us.ibm.com> on 2007/09/23 06:23:17 UTC
retrieve name of component in artifact processor
folks,
I'm writing a component impl type and in my artifact processor I would need
the name attribute from a component defined in the composite file to be
able to use a constistant resolving mechanism for my componentType files
that describe the component.
Example:
<component name="FooComponent">
<tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
path="echo" url="echo" contentType="text/plain" />
<reference name="..." />
</component>
Is there a way to get that name (FooComponent) in the read() or resolve()
method of the StAXArtifactProcessor implementation reading the
implementation.splice attribute? The FooComponent.componentType is then
used to describe the component, its references, etc.
I could not figure out a way to retrieve it, probably I missed something.
Thanks,
-Florian
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: retrieve name of component in artifact processor
Posted by Luciano Resende <lu...@gmail.com>.
If your question is how to use componentTypes, i have an example in
the BPEL implementation.
[1] https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/impl/BPELImplementationProcessor.java
On 9/22/07, Florian Rosenberg <fr...@us.ibm.com> wrote:
>
> folks,
>
> I'm writing a component impl type and in my artifact processor I would need
> the name attribute from a component defined in the composite file to be
> able to use a constistant resolving mechanism for my componentType files
> that describe the component.
>
> Example:
> <component name="FooComponent">
> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
> path="echo" url="echo" contentType="text/plain" />
> <reference name="..." />
> </component>
>
> Is there a way to get that name (FooComponent) in the read() or resolve()
> method of the StAXArtifactProcessor implementation reading the
> implementation.splice attribute? The FooComponent.componentType is then
> used to describe the component, its references, etc.
>
> I could not figure out a way to retrieve it, probably I missed something.
>
> Thanks,
> -Florian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Splice component declaration and componentType, was: retrieve name
of component in artifact processor
Posted by Jean-Sebastien Delfino <js...@apache.org>.
Florian Rosenberg wrote:
> hi raymond,
>
> On Sun, September 23, 2007 2:31 pm, Raymond Feng wrote:
>
>> Hi, Florian.
>>
>> Can you elaborate a bit on why you need the component name during the
>> read/resolve phase for your <implementation.splice>? If such information
>> is
>> needed for the runtime behavior, then
>> org.apache.tuscany.sca.provider.ImplementationProviderFactory.createImplementationProvider(...)
>> will pass in the component and implementation objects.
>>
>
> the reason I've asked was my missinterpretation of componentType, I
> thought it describes a whole component instance (as Mike said
> implementation info is the better name IMHO) no only the implementation. I
> wanted to name the component type file exactly as specified in the name
> attribute of the component tag in the composite file. That was basically
> the origin of my question.
>
> I'll go along with the suggestions that Mike provided for now. In the end
> I want to resolve the componentType automatically from the Splice flow
> anyway but I want a constistent way to do it for now. I checked some
> existing examples in Tuscany and could not figure out a way to name them
> consistently, some componentType names are the same as the composite file
> name, some have the name of the component type. The spec says the name of
> the componentType file and the composite file should match (if I remember
> correctly)/
>
> Thanks,
> -Florian
>
>
>> ----- Original Message -----
>> From: "Florian Rosenberg" <fr...@us.ibm.com>
>> To: <tu...@ws.apache.org>
>> Sent: Saturday, September 22, 2007 9:23 PM
>> Subject: retrieve name of component in artifact processor
>>
>>
>>
>>> folks,
>>>
>>> I'm writing a component impl type and in my artifact processor I would
>>> need
>>> the name attribute from a component defined in the composite file to be
>>> able to use a constistant resolving mechanism for my componentType
>>> files
>>> that describe the component.
>>>
>>> Example:
>>> <component name="FooComponent">
>>> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
>>> path="echo" url="echo" contentType="text/plain" />
>>> <reference name="..." />
>>> </component>
>>>
>>> Is there a way to get that name (FooComponent) in the read() or
>>> resolve()
>>> method of the StAXArtifactProcessor implementation reading the
>>> implementation.splice attribute? The FooComponent.componentType is then
>>> used to describe the component, its references, etc.
>>>
>>> I could not figure out a way to retrieve it, probably I missed
>>> something.
>>>
>>> Thanks,
>>> -Florian
>>>
>>>
>>>
A few thoughts, hoping they'll help the discussion...
As an SCA app developer, I'll need a simple way to point to my component
implementation artifact, because it's what I'm going to reuse in many
components. Having a single or main file for the implementation works
best because people can move it, copy it, edit it by double-clicking on it.
Once I have clearly identified that implementation file, defining the
.componentType is easy... same path as the implementation artifact with
a .componentType extension.
The .componentType does not describe a component, it describes an
implementation, in other words a class of components.
In the splice case, how about saying:
- The implementation artifact is myFlowdir/echo.splice for example.
- The SCA artifact that describes my implementation (if needed) is
myFlowdir/echo.componentType.
- I'm guessing that echo.splice is an XML file, with a targetNamespace
and name, usually to keep things simple I'll want the XML name to match
the file name:
<splice targetNamespace="http://myns" name="echo">
.. splice stuff
</splice>
- To create a component implemented by myFlowdir/echo.splice I could write:
(a)
<component name="MyEchoComponent">
<implementation.splice flow="myFlowDir/echo.splice"/>
</component>
or (b)
<composite ... xmlns:myns="http://myns">
...
<component name="MyEchoComponent">
<implementation.splice flow="myns:echo"/>
</component>
In the rest of SCA assembly we've adopted (b) the more XML oriented
syntax, as pointing to locations tends to be fragile when you move
things around, and also fits well with the SCA contribution packaging
model and the ability to import XML namespaces from other contributions.
Thoughts?
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: Splice component declaration and componentType, was: retrieve name of
component in artifact processor
Posted by Florian Rosenberg <fr...@us.ibm.com>.
Jean-Sebastien Delfino <js...@apache.org> wrote on 09/25/2007 12:24:55
PM:
> Florian Rosenberg wrote:
> > hi raymond,
> >
> > On Sun, September 23, 2007 2:31 pm, Raymond Feng wrote:
> >
> >> Hi, Florian.
> >>
> >> Can you elaborate a bit on why you need the component name during the
> >> read/resolve phase for your <implementation.splice>? If such
information
> >> is
> >> needed for the runtime behavior, then
> >> org.apache.tuscany.sca.provider.ImplementationProviderFactory.
> createImplementationProvider(...)
> >> will pass in the component and implementation objects.
> >>
> >
> > the reason I've asked was my missinterpretation of componentType, I
> > thought it describes a whole component instance (as Mike said
> > implementation info is the better name IMHO) no only the
implementation. I
> > wanted to name the component type file exactly as specified in the name
> > attribute of the component tag in the composite file. That was
basically
> > the origin of my question.
> >
> > I'll go along with the suggestions that Mike provided for now. In the
end
> > I want to resolve the componentType automatically from the Splice flow
> > anyway but I want a constistent way to do it for now. I checked some
> > existing examples in Tuscany and could not figure out a way to name
them
> > consistently, some componentType names are the same as the composite
file
> > name, some have the name of the component type. The spec says the name
of
> > the componentType file and the composite file should match (if I
remember
> > correctly)/
> >
> > Thanks,
> > -Florian
> >
> >
> >> ----- Original Message -----
> >> From: "Florian Rosenberg" <fr...@us.ibm.com>
> >> To: <tu...@ws.apache.org>
> >> Sent: Saturday, September 22, 2007 9:23 PM
> >> Subject: retrieve name of component in artifact processor
> >>
> >>
> >>
> >>> folks,
> >>>
> >>> I'm writing a component impl type and in my artifact processor I
would
> >>> need
> >>> the name attribute from a component defined in the composite file to
be
> >>> able to use a constistant resolving mechanism for my componentType
> >>> files
> >>> that describe the component.
> >>>
> >>> Example:
> >>> <component name="FooComponent">
> >>> <tuscany:implementation.splice
baseDir:="src/test/resources/flowdir/"
> >>> path="echo" url="echo" contentType="text/plain" />
> >>> <reference name="..." />
> >>> </component>
> >>>
> >>> Is there a way to get that name (FooComponent) in the read() or
> >>> resolve()
> >>> method of the StAXArtifactProcessor implementation reading the
> >>> implementation.splice attribute? The FooComponent.componentType is
then
> >>> used to describe the component, its references, etc.
> >>>
> >>> I could not figure out a way to retrieve it, probably I missed
> >>> something.
> >>>
> >>> Thanks,
> >>> -Florian
> >>>
> >>>
> >>>
>
> A few thoughts, hoping they'll help the discussion...
>
> As an SCA app developer, I'll need a simple way to point to my component
> implementation artifact, because it's what I'm going to reuse in many
> components. Having a single or main file for the implementation works
> best because people can move it, copy it, edit it by double-clicking on
it.
>
> Once I have clearly identified that implementation file, defining the
> .componentType is easy... same path as the implementation artifact with
> a .componentType extension.
>
> The .componentType does not describe a component, it describes an
> implementation, in other words a class of components.
>
> In the splice case, how about saying:
>
> - The implementation artifact is myFlowdir/echo.splice for example.
>
> - The SCA artifact that describes my implementation (if needed) is
> myFlowdir/echo.componentType.
>
> - I'm guessing that echo.splice is an XML file, with a targetNamespace
> and name, usually to keep things simple I'll want the XML name to match
> the file name:
> <splice targetNamespace="http://myns" name="echo">
> .. splice stuff
> </splice>
>
> - To create a component implemented by myFlowdir/echo.splice I could
write:
>
> (a)
> <component name="MyEchoComponent">
> <implementation.splice flow="myFlowDir/echo.splice"/>
> </component>
currently we go for (a), mainly because of the way the Splice engine works
now. it has its origins in a Web centric environment>
(servlet container) thus we are a bit restricted to path names etc.
> or (b)
> <composite ... xmlns:myns="http://myns">
> ...
> <component name="MyEchoComponent">
> <implementation.splice flow="myns:echo"/>
> </component>
>
> In the rest of SCA assembly we've adopted (b) the more XML oriented
> syntax, as pointing to locations tends to be fragile when you move
> things around, and also fits well with the SCA contribution packaging
> model and the ability to import XML namespaces from other contributions.
we will definitely go for (b) as soon as as the engine supports it. my
tuscany implementation is basically ready for it so I hope to get it done
soon.
thanks,
-Florian
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Splice component declaration and componentType, was: retrieve name
of component in artifact processor
Posted by Jean-Sebastien Delfino <js...@apache.org>.
Florian Rosenberg wrote:
> hi raymond,
>
> On Sun, September 23, 2007 2:31 pm, Raymond Feng wrote:
>
>> Hi, Florian.
>>
>> Can you elaborate a bit on why you need the component name during the
>> read/resolve phase for your <implementation.splice>? If such information
>> is
>> needed for the runtime behavior, then
>> org.apache.tuscany.sca.provider.ImplementationProviderFactory.createImplementationProvider(...)
>> will pass in the component and implementation objects.
>>
>
> the reason I've asked was my missinterpretation of componentType, I
> thought it describes a whole component instance (as Mike said
> implementation info is the better name IMHO) no only the implementation. I
> wanted to name the component type file exactly as specified in the name
> attribute of the component tag in the composite file. That was basically
> the origin of my question.
>
> I'll go along with the suggestions that Mike provided for now. In the end
> I want to resolve the componentType automatically from the Splice flow
> anyway but I want a constistent way to do it for now. I checked some
> existing examples in Tuscany and could not figure out a way to name them
> consistently, some componentType names are the same as the composite file
> name, some have the name of the component type. The spec says the name of
> the componentType file and the composite file should match (if I remember
> correctly)/
>
> Thanks,
> -Florian
>
>
>> ----- Original Message -----
>> From: "Florian Rosenberg" <fr...@us.ibm.com>
>> To: <tu...@ws.apache.org>
>> Sent: Saturday, September 22, 2007 9:23 PM
>> Subject: retrieve name of component in artifact processor
>>
>>
>>
>>> folks,
>>>
>>> I'm writing a component impl type and in my artifact processor I would
>>> need
>>> the name attribute from a component defined in the composite file to be
>>> able to use a constistant resolving mechanism for my componentType
>>> files
>>> that describe the component.
>>>
>>> Example:
>>> <component name="FooComponent">
>>> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
>>> path="echo" url="echo" contentType="text/plain" />
>>> <reference name="..." />
>>> </component>
>>>
>>> Is there a way to get that name (FooComponent) in the read() or
>>> resolve()
>>> method of the StAXArtifactProcessor implementation reading the
>>> implementation.splice attribute? The FooComponent.componentType is then
>>> used to describe the component, its references, etc.
>>>
>>> I could not figure out a way to retrieve it, probably I missed
>>> something.
>>>
>>> Thanks,
>>> -Florian
>>>
>>>
>>>
A few thoughts, hoping they'll help the discussion...
As an SCA app developer, I'll need a simple way to point to my component
implementation artifact, because it's what I'm going to reuse in many
components. Having a single or main file for the implementation works
best because people can move it, copy it, edit it by double-clicking on it.
Once I have clearly identified that implementation file, defining the
.componentType is easy... same path as the implementation artifact with
a .componentType extension.
The .componentType does not describe a component, it describes an
implementation, in other words a class of components.
In the splice case, how about saying:
- The implementation artifact is myFlowdir/echo.splice for example.
- The SCA artifact that describes my implementation (if needed) is
myFlowdir/echo.componentType.
- I'm guessing that echo.splice is an XML file, with a targetNamespace
and name, usually to keep things simple I'll want the XML name to match
the file name:
<splice targetNamespace="http://myns" name="echo">
.. splice stuff
</splice>
- To create a component implemented by myFlowdir/echo.splice I could write:
(a)
<component name="MyEchoComponent">
<implementation.splice flow="myFlowDir/echo.splice"/>
</component>
or (b)
<composite ... xmlns:myns="http://myns">
...
<component name="MyEchoComponent">
<implementation.splice flow="myns:echo"/>
</component>
In the rest of SCA assembly we've adopted (b) the more XML oriented
syntax, as pointing to locations tends to be fragile when you move
things around, and also fits well with the SCA contribution packaging
model and the ability to import XML namespaces from other contributions.
--
Jean-Sebastien
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: retrieve name of component in artifact processor
Posted by Florian Rosenberg <fl...@vitalab.tuwien.ac.at>.
hi raymond,
On Sun, September 23, 2007 2:31 pm, Raymond Feng wrote:
> Hi, Florian.
>
> Can you elaborate a bit on why you need the component name during the
> read/resolve phase for your <implementation.splice>? If such information
> is
> needed for the runtime behavior, then
> org.apache.tuscany.sca.provider.ImplementationProviderFactory.createImplementationProvider(...)
> will pass in the component and implementation objects.
the reason I've asked was my missinterpretation of componentType, I
thought it describes a whole component instance (as Mike said
implementation info is the better name IMHO) no only the implementation. I
wanted to name the component type file exactly as specified in the name
attribute of the component tag in the composite file. That was basically
the origin of my question.
I'll go along with the suggestions that Mike provided for now. In the end
I want to resolve the componentType automatically from the Splice flow
anyway but I want a constistent way to do it for now. I checked some
existing examples in Tuscany and could not figure out a way to name them
consistently, some componentType names are the same as the composite file
name, some have the name of the component type. The spec says the name of
the componentType file and the composite file should match (if I remember
correctly)/
Thanks,
-Florian
> ----- Original Message -----
> From: "Florian Rosenberg" <fr...@us.ibm.com>
> To: <tu...@ws.apache.org>
> Sent: Saturday, September 22, 2007 9:23 PM
> Subject: retrieve name of component in artifact processor
>
>
>>
>> folks,
>>
>> I'm writing a component impl type and in my artifact processor I would
>> need
>> the name attribute from a component defined in the composite file to be
>> able to use a constistant resolving mechanism for my componentType
>> files
>> that describe the component.
>>
>> Example:
>> <component name="FooComponent">
>> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
>> path="echo" url="echo" contentType="text/plain" />
>> <reference name="..." />
>> </component>
>>
>> Is there a way to get that name (FooComponent) in the read() or
>> resolve()
>> method of the StAXArtifactProcessor implementation reading the
>> implementation.splice attribute? The FooComponent.componentType is then
>> used to describe the component, its references, etc.
>>
>> I could not figure out a way to retrieve it, probably I missed
>> something.
>>
>> Thanks,
>> -Florian
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: retrieve name of component in artifact processor
Posted by Raymond Feng <en...@gmail.com>.
Hi, Florian.
Can you elaborate a bit on why you need the component name during the
read/resolve phase for your <implementation.splice>? If such information is
needed for the runtime behavior, then
org.apache.tuscany.sca.provider.ImplementationProviderFactory.createImplementationProvider(...)
will pass in the component and implementation objects.
Thanks,
Raymond
----- Original Message -----
From: "Florian Rosenberg" <fr...@us.ibm.com>
To: <tu...@ws.apache.org>
Sent: Saturday, September 22, 2007 9:23 PM
Subject: retrieve name of component in artifact processor
>
> folks,
>
> I'm writing a component impl type and in my artifact processor I would
> need
> the name attribute from a component defined in the composite file to be
> able to use a constistant resolving mechanism for my componentType files
> that describe the component.
>
> Example:
> <component name="FooComponent">
> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
> path="echo" url="echo" contentType="text/plain" />
> <reference name="..." />
> </component>
>
> Is there a way to get that name (FooComponent) in the read() or resolve()
> method of the StAXArtifactProcessor implementation reading the
> implementation.splice attribute? The FooComponent.componentType is then
> used to describe the component, its references, etc.
>
> I could not figure out a way to retrieve it, probably I missed something.
>
> Thanks,
> -Florian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: retrieve name of component in artifact processor
Posted by Florian Rosenberg <fr...@us.ibm.com>.
hi mike,
thanks for the answer. some comments inline.
Mike Edwards <mi...@gmail.com> wrote on 09/23/2007
02:08:23 PM:
> Florian,
>
> This isn't quite the way that componentType is intended to work. Let me
> try to explain.
>
> A componentType file is something that is really associated with an
> implementation, not with the component that uses the implementation. In
> effect, "componentType" is really a description of the external
> characteristics of the implementation, which can then be configured by
> the component which uses the implementation. (ie a listing of the
> services, references, properties, of the implementation). Some folks
> have even suggested a better name for the file of "implementationInfo",
> just to drive the point home...
I understand this so far, the name componentType is still missleading. I
would vote for implementationInfo because I makes it clear that it is meta
information about the implementation not the component (what the name now
suggests).
> In many ways, the ideal situation is where the componentType of an
> implementation is derived through inspection / introspection of the
> implementation artifact(s). This is generally the case for Java
> classes, for example.
I also implement that for Splice components at the moment but for now, I
use componentType files to specify references etc.
> SCA allows for the case where implementation types cannot be
> introspected - and this is where the componentType file comes in. The
> componentType file allows the developer of the implementation to
> describe the "external characteristics" of the implementation in an XML
> file. The componentType file is usually placed in a location associated
> with the implementation artifact(s) (eg in the same directory) and
> usually has a name directly related to the name of the implementation
> artifact.
>
> So, let me take a guess that the Splice implementation artifact in your
> example is a file called "echo.splice" in the
> src/test/resources/flowdir/ directory. In this case, if you need to
> supply a componentType file with this, it could be called
> echo.componentType and placed in that same directory alongside the
> echo.splice file.
exactly what I have now. I currently have "invented" name attribute on the
splice.implementation that identifies my .componentType file which resides
in the src/main/resources of a project alongside with the .composite file.
but probably your suggestion to put it alongside with the echo.splice is
better. have to think about that.
> Then, when your implementation processor is told to go retrieve the
> echo.splice implementation, you can find the echo.componentType file by
> a simple search in the same directory...
>
> All this assumes that you can't introspect the splice implementations
> for the relevant information, of course...
i'm working on that right now. should be finished soon.
Thanks again for your insights.
-Florian
> Florian Rosenberg wrote:
> > folks,
> >
> > I'm writing a component impl type and in my artifact processor I would
need
> > the name attribute from a component defined in the composite file to be
> > able to use a constistant resolving mechanism for my componentType
files
> > that describe the component.
> >
> > Example:
> > <component name="FooComponent">
> > <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
> > path="echo" url="echo" contentType="text/plain" />
> > <reference name="..." />
> > </component>
> >
> > Is there a way to get that name (FooComponent) in the read() or resolve
()
> > method of the StAXArtifactProcessor implementation reading the
> > implementation.splice attribute? The FooComponent.componentType is then
> > used to describe the component, its references, etc.
> >
> > I could not figure out a way to retrieve it, probably I missed
something.
> >
> > Thanks,
> > -Florian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: retrieve name of component in artifact processor
Posted by Mike Edwards <mi...@gmail.com>.
Florian,
This isn't quite the way that componentType is intended to work. Let me
try to explain.
A componentType file is something that is really associated with an
implementation, not with the component that uses the implementation. In
effect, "componentType" is really a description of the external
characteristics of the implementation, which can then be configured by
the component which uses the implementation. (ie a listing of the
services, references, properties, of the implementation). Some folks
have even suggested a better name for the file of "implementationInfo",
just to drive the point home...
In many ways, the ideal situation is where the componentType of an
implementation is derived through inspection / introspection of the
implementation artifact(s). This is generally the case for Java
classes, for example.
SCA allows for the case where implementation types cannot be
introspected - and this is where the componentType file comes in. The
componentType file allows the developer of the implementation to
describe the "external characteristics" of the implementation in an XML
file. The componentType file is usually placed in a location associated
with the implementation artifact(s) (eg in the same directory) and
usually has a name directly related to the name of the implementation
artifact.
So, let me take a guess that the Splice implementation artifact in your
example is a file called "echo.splice" in the
src/test/resources/flowdir/ directory. In this case, if you need to
supply a componentType file with this, it could be called
echo.componentType and placed in that same directory alongside the
echo.splice file.
Then, when your implementation processor is told to go retrieve the
echo.splice implementation, you can find the echo.componentType file by
a simple search in the same directory...
All this assumes that you can't introspect the splice implementations
for the relevant information, of course...
After all this, I still hope that you can have some tools generate the
componentType file - it's not much fun building these files by hand. An
example where tools do generate the componentType files is in the case
of C++ implementations - there are annotations in the source code which
can be read by a compile-time processor and used to generate the
componentType file at that point, since runtime introspection of C++
objects is not feasible.
Happy to help further if I can.
Yours, Mike.
Florian Rosenberg wrote:
> folks,
>
> I'm writing a component impl type and in my artifact processor I would need
> the name attribute from a component defined in the composite file to be
> able to use a constistant resolving mechanism for my componentType files
> that describe the component.
>
> Example:
> <component name="FooComponent">
> <tuscany:implementation.splice baseDir:="src/test/resources/flowdir/"
> path="echo" url="echo" contentType="text/plain" />
> <reference name="..." />
> </component>
>
> Is there a way to get that name (FooComponent) in the read() or resolve()
> method of the StAXArtifactProcessor implementation reading the
> implementation.splice attribute? The FooComponent.componentType is then
> used to describe the component, its references, etc.
>
> I could not figure out a way to retrieve it, probably I missed something.
>
> Thanks,
> -Florian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org