tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Feng" <enjoyj...@gmail.com>
Subject Re: How the Intent work
Date Tue, 01 Jul 2008 17:24:00 GMT
Hi,

You are referencing the "legacy" intent and it should be defined in the 
definitions.xml.

For example,

<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0" 
xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" 
targetNamespace="http://legacy/">
<intent name="legacy" constrains="sca:binding">
    <description>
    </description>
</intent>
</definitions>

This defines the {http://legacy/}legacy intent and it can be used to 
constrain all SCA bindings.

Then you need to implement a SCADefinitionsProvider and register it with 
META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider.

Please look at the following code as an example:

[1] 
https://svn.apache.org/repos/asf/tuscany/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/SecurityPolicyDefinitionsProvider.java
[2] 
https://svn.apache.org/repos/asf/tuscany/java/sca/modules/policy-security/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.SCADefinitionsProvider

It's a bit complicated at this moment and we need to have a better story in 
future releases.

Thanks,
Raymond

--------------------------------------------------
From: "Honghsi Lo" <honghsi.lo@oracle.com>
Sent: Tuesday, July 01, 2008 8:57 AM
To: <dev@tuscany.apache.org>
Subject: How the Intent work

> Hi,
>
> I am working on a networking base java binding for Tuscany.  When I 
> specified 'requires="legacy"' in the reference of composite, I got 
> PolicyValidationException generated by PolicyValidationUtils.java because 
> the returned constrained is null.  I checked IntentImpl.java, it has
>
> private List<QName> constrains = new ArrayList<Qname>();
>
> ...
>
> public List<QName> getConstrains() {
>  return constrains;
> }
>
> ....
>
> But there is no way to add anything to the constrains list.  What should I 
> do in my binding to avoid this exception and my binding's invoke method 
> can check this legacy intent?  BTW, I am using version 1.2 binaries.
>
> Regards,
>
> honghsi
> 
Mime
View raw message