From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- .../site-publish/sca-java-definitionsxml.html | 242 +++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 site/trunk/site-publish/sca-java-definitionsxml.html (limited to 'site/trunk/site-publish/sca-java-definitionsxml.html') diff --git a/site/trunk/site-publish/sca-java-definitionsxml.html b/site/trunk/site-publish/sca-java-definitionsxml.html new file mode 100644 index 0000000000..461f7b6ce8 --- /dev/null +++ b/site/trunk/site-publish/sca-java-definitionsxml.html @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + Apache Tuscany : SCA Java definitions.xml + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > SCA Overview > SCA Java > Java SCA Documentation Menu > SCA Java User Guide > SCA Java definitions.xml + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

definitions.xml

+ +

Section 1.8 describes the definitions.xml file as holding all of the artifacts that are useful for configuring an SCA domain but that are not specific to a particular composite or component. It goes on to say that "All of these artifacts within and SCA Domain are defined in a global, SCA Domain-wide file named definitions.xml". To achieve our extensibility goals we, in Tuscany, consider the SCA Domain wide definitions.xml file to be a logical concept that is constructed at runtime from the contents of definitions.xml files provided in contributions and in Tuscany extensions.

+ +

Each definitions.xml file may contain.

+ +
    +
  • Intents
  • +
  • Policy sets
  • +
  • Predefined binding specifications
  • +
  • Binding type descriptions
  • +
  • Implementation type descriptions
  • +
+ + +

Complete Features

+ +

Add Intents and Policy Sets with an Extension

+ +

An extension, such as the modules/policy-security extension relies on some policy sets and intents being available in the SCA Domain. The definitions.xml is the place to define these and hence if you look in this extension module you will find the following.

+ +
+
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ 			targetNamespace="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+
+    <!-- POLICY SETS -->
+    <policySet name="runAs" appliesTo="sca:implementation.java"/>
+    <policySet name="allow" appliesTo="sca:implementation.java"/>
+    <policySet name="rolesAllowed" appliesTo="sca:implementation.java"/>
+    <policySet name="permitAll" appliesTo="sca:implementation.java"/>
+    <policySet name="denyAll" appliesTo="sca:implementation.java"/>
+    
+	<!-- Policy Intents Defined by the SCA Runtime -->
+	<intent name="authentication" 
+	 		constrains="sca:binding">
+		<description>
+			Specifying this intent on references requires necessary authentication information
+			to be sent along with outgoing messages. Specifying this intent on service requires
+			incoming messages to be authenticated
+		</description>
+	</intent>
+	
+	<intent name="confidentiality" 
+	 		constrains="sca:binding">
+		<description>
+			Specifying this intent requires message exchanged to be encrypted
+		</description>
+	</intent>
+	
+	<intent name="integrity" 
+	 		constrains="sca:binding">
+		<description>
+			Specifying this intent requires message exchanged to be signed
+		</description>
+	</intent>
+</definitions>
+
+
+ +

When this module is loaded at runtime the contents of this file are made generally available and hence in you composite you can use statements such at.

+ +
+
+
+<component name="CalculatorServiceComponent">
+    <implementation.java class="calculator.CalculatorServiceImpl"/>
+    <reference name="addService" >
+        <interface.java interface="calculator.AddService" />        
+        <binding.ws uri="http://localhost:8080/sample-calculator-ws-secure-webapp/AddServiceComponent"
+                    requires="authentication" />        
+    </reference>
+</component>
+
+
+ +

Where requires="authentication" refers to intent name="authentication" which is now available as an SCA Domain level definition.

+ +

TODO Features

+ +

Add Intents and Policy Sets with a Contribution

+ +

If contributionA provides a file such as:

+ +
+
+<sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ 			targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
+ 			xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+
+<sca:intent name="specialAuthentication" 
+            constrains="sca:binding.ws">
+    <description>
+        Communitcation thro this binding required Authentication.
+    </description>
+</sca:intent>	
+ 
+</sca:definitions>
+
+
+ +

and ContributionB provides a file such as:

+ +
+
+<sca:policySet name="specialAuthenticationPolicy"
+ 	       provides="tuscany:wsAuthentication"
+ 	       appliesTo="//sca:binding.ws">
+    <tuscany:wsConfigParam>
+        <parameter name="OutflowSecurity">
+            <action>
+                <items>UsernameToken</items>
+                <user>TuscanyWsUser</user>
+                <passwordCallbackClass>my.PWCBHandler</passwordCallbackClass>"
+                <passwordType>PasswordText</passwordType>
+            </action>
+        </parameter>
+    </tuscany:wsConfigParam>
+</sca:policySet>
+
+
+ +

Then both the itent and the policySet should be available in the logical SCA Domain-wide definitions.xml and the policySet "specialAuthenticationPolicy" should successfully find the intent "tuscany:wsAuthentication". Composite files contributed to the domain will successfully be able to reference both the intent and the policy set.

+ +

See:

+ +

https://issues.apache.org/jira/browse/TUSCANY-2499
+http://www.mail-archive.com/dev%40tuscany.apache.org/msg01077.html

+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3