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" <[EMAIL PROTECTED]>
Sent: Tuesday, July 01, 2008 8:57 AM
To: <[email protected]>
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

Attachment: org.apache.tuscany.sca.provider.SCADefinitionsProvider
Description: Binary data

Reply via email to