Fabio Albani wrote:
Hi to all,
I needed that because I'm developing an implementation for Asmeta
language, a language for describing Abstract State Machines. In order to
call methods, with ASM rules, in the way I've developed for my master
degree work, and not the Tuscany's one, I couldn't use the usual way for
resolving models... Now, using an ArtifactProcessor also on the
composite, like in the "AnyElement" class file, I can call, in an
ASM-like way, method on an ASM agent generated on-the-fly which is a
wrapper for any kind of service.
Only a question... how can I get the return value from a service knowing
only parameters and name of the service (and of the component exposing it) ?
I think you mean the return value of a service operation.
1. From the component, get the list of services.
2. From the list of services, get the service (by name matching).
3. From the service, get the InterfaceContract.
4. From the InterfaceContract, get the Interface.
5. Now you need to determine what type of interface it is (e.g., a
JavaInterface), and use language-specific code to introspect the
interface to get the names, parameters, and return type of each
of its operations. Each interface type has a different way of
doing this.
Simon
Thanks for your help :)
Fabio
2010/10/16 Luciano Resende <[email protected]
<mailto:[email protected]>>
On Fri, Oct 15, 2010 at 2:01 AM, Fabio Albani
<[email protected] <mailto:[email protected]>> wrote:
> Hi to all,
> I noticed I've already done that, but I can't manage how to use
> CompositeProcessor in order to use thw whole composite... is it
possibile to
> get ALL the xml of the current composite in use in the extension?
> The problem is that I haven't interface defined and so I use a
custom way to
> call other services from the reference, but I need to read
attributes like
> references, target etc.
> Thank you!
>
Maybe you are trying to do things on the different phase ? In the read
phase, we only delegate to processors that know how to read pieces of
the composite and generate models, we then have a resolve phase where
these models get resolved. Later on, your extension will be
initialized and you will have access to the further runtime artifacts
(see BindingProviderFactory ServiceBindingProviders,
ReferenceBindingProviders) and then the actual invokers or
servletListeners will also be able to play a part during the
invocation. Maybe what you are trying to do fits better to a different
phase or actually during the start or invocation process ?
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/