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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]