summaryrefslogtreecommitdiffstats
path: root/tags/java/spec
diff options
context:
space:
mode:
Diffstat (limited to 'tags/java/spec')
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/LICENSE.txt203
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/NOTICE.txt14
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/pom.xml90
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/CancelTimerListener.java38
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/StopTimerListener.java38
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/Timer.java41
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerListener.java38
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerManager.java79
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/RemoteWorkItem.java41
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/Work.java39
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkCompletedException.java72
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkEvent.java45
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkException.java49
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkItem.java39
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkListener.java44
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkManager.java51
-rw-r--r--tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkRejectedException.java50
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/LICENSE.txt202
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/NOTICE.txt22
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/pom.xml109
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/CallableReference.java65
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ComponentContext.java109
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Constants.java34
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Conversation.java41
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ConversationEndedException.java67
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java68
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/RequestContext.java66
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceReference.java65
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceRuntimeException.java69
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceUnavailableException.java65
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java38
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Authentication.java69
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Callback.java49
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ComponentName.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Confidentiality.java69
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Constructor.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Context.java38
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationAttributes.java56
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationID.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Conversational.java37
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Destroy.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EagerInit.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EndsConversation.java34
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Init.java36
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Integrity.java69
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Intent.java58
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/OneWay.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/PolicySets.java45
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Property.java51
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Qualifier.java35
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Reference.java50
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Remotable.java36
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Requires.java56
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Scope.java48
-rw-r--r--tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Service.java47
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/LICENSE.txt202
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/NOTICE.txt14
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/README.txt35
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/pom.xml90
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CompositeContext.java93
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CurrentCompositeContext.java40
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java68
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/RequestContext.java49
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SCA.java51
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceReference.java69
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceRuntimeException.java69
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceUnavailableException.java66
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SessionEndedException.java68
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/Version.java45
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java38
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Callback.java44
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/ComponentName.java35
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Constructor.java35
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Context.java36
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Destroy.java35
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Init.java41
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/OneWay.java36
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Property.java54
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Reference.java46
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Remotable.java36
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Scope.java44
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Service.java43
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Session.java51
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/SessionID.java35
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-sca.xsd38
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-webservice.xsd39
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-core.xsd233
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-implementation-java.xsd39
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-java.xsd40
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-wsdl.xsd40
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca.xsd34
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java70
-rw-r--r--tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java49
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/BUILDING.txt26
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/LICENSE.txt240
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/NOTICE.txt33
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/STATUS.txt75
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/pom.xml117
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/ChangeSummary.java204
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataGraph.java73
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataObject.java1105
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Property.java79
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Sequence.java131
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Type.java143
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/CopyHelper.java82
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataFactory.java61
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataHelper.java184
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/EqualityHelper.java89
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/TypeHelper.java71
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLDocument.java152
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLHelper.java167
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XSDHelper.java193
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java87
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/HelperProvider.java367
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/NoHelperProviderException.java58
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/datagraph.xsd77
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xml45
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xsd85
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xml87
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xsd217
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xml32
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xsd49
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java90
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/DefaultHelperProvider.java71
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/TCCL1HelperProvider.java71
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider3
-rw-r--r--tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider1
127 files changed, 9799 insertions, 0 deletions
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/LICENSE.txt b/tags/java/spec/commonj/1.0-incubator-M2/LICENSE.txt
new file mode 100644
index 0000000000..6b0b1270ff
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/LICENSE.txt
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/NOTICE.txt b/tags/java/spec/commonj/1.0-incubator-M2/NOTICE.txt
new file mode 100644
index 0000000000..d83ebbe236
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/NOTICE.txt
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/pom.xml b/tags/java/spec/commonj/1.0-incubator-M2/pom.xml
new file mode 100644
index 0000000000..9a1bb21c58
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/pom.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>1-incubator</version>
+ </parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>commonj-api_r${specVersion}</artifactId>
+ <version>1.0-incubator-M2</version>
+ <packaging>osgi-bundle</packaging>
+ <name>Commonj API for Timer and Work Manager</name>
+ <description>Commonj API for Timer and Work Manager</description>
+
+ <properties>
+ <specVersion>1.1</specVersion>
+ </properties>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix.plugins</groupId>
+ <artifactId>maven-osgi-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <osgiManifest>
+ <bundleName>${pom.name}</bundleName>
+ <bundleDescription>${pom.description}</bundleDescription>
+ <bundleVendor>${pom.organization.name}</bundleVendor>
+ <bundleLocalization>plugin</bundleLocalization>
+ <bundleSymbolicName>commonj.twm</bundleSymbolicName>
+ <exportPackage>commonj.timers;version="${specVersion}", commonj.work;version="${specVersion}</exportPackage>
+ </osgiManifest>
+ </configuration>
+ </plugin>
+ </plugins>
+ <defaultGoal>install</defaultGoal>
+ </build>
+</project>
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/CancelTimerListener.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/CancelTimerListener.java
new file mode 100644
index 0000000000..ba252e70dc
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/CancelTimerListener.java
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.timers;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface CancelTimerListener extends TimerListener {
+
+ void timerCancel(Timer timer);
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/StopTimerListener.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/StopTimerListener.java
new file mode 100644
index 0000000000..92defc4bdc
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/StopTimerListener.java
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.timers;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface StopTimerListener extends TimerListener {
+
+ void timerStop(Timer timer);
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/Timer.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/Timer.java
new file mode 100644
index 0000000000..0a5c3b65fb
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/Timer.java
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.timers;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Timer {
+
+ boolean cancel();
+ long getPeriod();
+ long getScheduledExecutionTime() throws IllegalStateException;
+ TimerListener getTimerListener();
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerListener.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerListener.java
new file mode 100644
index 0000000000..6e3733b5f4
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerListener.java
@@ -0,0 +1,38 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.timers;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TimerListener {
+
+ void timerExpired(Timer timer);
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerManager.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerManager.java
new file mode 100644
index 0000000000..c07b6478d5
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/timers/TimerManager.java
@@ -0,0 +1,79 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.timers;
+
+import java.util.Date;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TimerManager {
+
+ static final long IMMEDIATE = 0;
+ static final long INDEFINITE = java.lang.Long.MAX_VALUE;
+
+ boolean isStopped();
+
+ boolean isStopping();
+
+ boolean isSuspended() throws IllegalStateException;
+
+ boolean isSuspending() throws IllegalStateException;
+
+ void resume() throws IllegalStateException;
+
+ Timer schedule(TimerListener listener, long delayInMillis)
+ throws IllegalStateException, IllegalArgumentException;
+
+ Timer schedule(TimerListener listener, long delayInMillis, long repeatIntervalInMillis)
+ throws IllegalStateException, IllegalArgumentException;
+
+ Timer schedule(TimerListener listener, Date scheduleDate)
+ throws IllegalStateException, IllegalArgumentException;
+
+ Timer schedule(TimerListener listener, Date scheduleDate, long repeatIntervalInMillis)
+ throws IllegalStateException, IllegalArgumentException;
+
+ Timer scheduleAtFixedRate(TimerListener listener, long delayInMillis, long repeatIntervalInMillis)
+ throws IllegalStateException, IllegalArgumentException;
+
+ Timer scheduleAtFixedRate(TimerListener listener, Date scheduleDate, long repeatIntervalInMillis)
+ throws IllegalStateException, IllegalArgumentException;
+
+ void stop() throws IllegalStateException;
+
+ void suspend() throws IllegalStateException;
+
+ boolean waitForStop(long timeOut)
+ throws InterruptedException, IllegalArgumentException;
+
+ boolean waitForSuspend(long timOut)
+ throws InterruptedException, IllegalStateException, IllegalArgumentException;
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/RemoteWorkItem.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/RemoteWorkItem.java
new file mode 100644
index 0000000000..aebf40a324
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/RemoteWorkItem.java
@@ -0,0 +1,41 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+import java.util.Collection;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface RemoteWorkItem extends WorkItem {
+
+ WorkManager getPinnedWorkManager();
+ void release();
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/Work.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/Work.java
new file mode 100644
index 0000000000..1071fe4a2e
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/Work.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Work extends Runnable {
+
+ boolean isDaemon();
+ void release();
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkCompletedException.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkCompletedException.java
new file mode 100644
index 0000000000..0edd14c8a0
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkCompletedException.java
@@ -0,0 +1,72 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WorkCompletedException extends WorkException {
+
+ private final List exceptionList;
+
+ public WorkCompletedException() {
+ super();
+ exceptionList = Collections.EMPTY_LIST;
+ }
+ public WorkCompletedException(String message) {
+ super(message);
+ exceptionList = Collections.EMPTY_LIST;
+ }
+ public WorkCompletedException(String message, Throwable cause) {
+ super(message, cause);
+ exceptionList = Collections.singletonList(cause);
+ }
+ public WorkCompletedException(Throwable cause) {
+ super(cause);
+ exceptionList = Collections.singletonList(cause);
+ }
+ public WorkCompletedException(String message, List list) {
+ super(message);
+ if ((list != null) && (list.size() > 0)) {
+ initCause((Throwable) list.get(0));
+ exceptionList = Collections.unmodifiableList(new ArrayList(list));
+ } else {
+ exceptionList = Collections.EMPTY_LIST;
+ }
+ }
+
+ public List getExceptionList() {
+ return exceptionList;
+ }
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkEvent.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkEvent.java
new file mode 100644
index 0000000000..9a7814b860
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkEvent.java
@@ -0,0 +1,45 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WorkEvent {
+
+ static final int WORK_ACCEPTED = 1;
+ static final int WORK_REJECTED = 2;
+ static final int WORK_STARTED = 3;
+ static final int WORK_COMPLETED = 4;
+
+ WorkException getException();
+ int getType();
+ WorkItem getWorkItem();
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkException.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkException.java
new file mode 100644
index 0000000000..f490f2e99e
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkException.java
@@ -0,0 +1,49 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WorkException extends Exception {
+
+ public WorkException() {
+ super();
+ }
+ public WorkException(String message) {
+ super(message);
+ }
+ public WorkException(String message, Throwable cause) {
+ super(message, cause);
+ }
+ public WorkException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkItem.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkItem.java
new file mode 100644
index 0000000000..6b8d3185a1
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkItem.java
@@ -0,0 +1,39 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WorkItem extends Comparable {
+
+ Work getResult() throws WorkException;
+ int getStatus();
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkListener.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkListener.java
new file mode 100644
index 0000000000..9b523f7321
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkListener.java
@@ -0,0 +1,44 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WorkListener {
+
+ static long IMMEDIATE = 0;
+ static long INDEFINITE = java.lang.Long.MAX_VALUE;
+
+ void workAccepted(WorkEvent event);
+ void workCompleted(WorkEvent event);
+ void workRejected(WorkEvent event);
+ void workStarted(WorkEvent event);
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkManager.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkManager.java
new file mode 100644
index 0000000000..2c4167d24c
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkManager.java
@@ -0,0 +1,51 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+import java.util.Collection;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface WorkManager {
+
+ static final long IMMEDIATE = 0;
+ static final long INDEFINITE = java.lang.Long.MAX_VALUE;
+
+ WorkItem schedule(Work work) throws WorkException, IllegalArgumentException;
+
+ WorkItem schedule(Work work, WorkListener listener) throws WorkException, IllegalArgumentException;
+
+ boolean waitForAll(Collection workItems, long timeout)
+ throws InterruptedException, IllegalArgumentException;
+
+ Collection waitForAny(Collection workItems, long timeout)
+ throws InterruptedException, IllegalArgumentException;
+
+}
diff --git a/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkRejectedException.java b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkRejectedException.java
new file mode 100644
index 0000000000..23dcd2294c
--- /dev/null
+++ b/tags/java/spec/commonj/1.0-incubator-M2/src/main/java/commonj/work/WorkRejectedException.java
@@ -0,0 +1,50 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// This source code implements specifications defined by the BEA and IBM.
+// For more information, see:
+// http://dev2dev.bea.com/technologies/commonj/index.jsp
+// or
+// http://www.ibm.com/developerworks/library/j-commonj-sdowmt
+//
+// In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package commonj.work;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WorkRejectedException extends WorkException {
+
+
+ public WorkRejectedException() {
+ super();
+ }
+ public WorkRejectedException(String message) {
+ super(message);
+ }
+ public WorkRejectedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+ public WorkRejectedException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/LICENSE.txt b/tags/java/spec/sca-api-r1.0/1.0-incubating/LICENSE.txt
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/NOTICE.txt b/tags/java/spec/sca-api-r1.0/1.0-incubating/NOTICE.txt
new file mode 100644
index 0000000000..11f12bacd3
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/NOTICE.txt
@@ -0,0 +1,22 @@
+${pom.name}
+Copyright (c) 2005 - 2007 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+This module contains an independent implementation of the SCA specification
+API developed by the Apache Tuscany project under the Apache License 2.0.
+The interfaces here correspond to the APIs documented in the specification,
+including errata recorded at the time of release. The original specification
+can be obtained from the OSOA collaboration here:
+ http://www.osoa.org/display/Supporters/Draft+SCA+1.0+Specifications
+and the errata here:
+ http://www.osoa.org/pages/viewpage.action?pageId=3457
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/pom.xml b/tags/java/spec/sca-api-r1.0/1.0-incubating/pom.xml
new file mode 100644
index 0000000000..05198beacb
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/pom.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>2-incubating</version>
+ </parent>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r${scaSpecVersion}</artifactId>
+ <name>SCA API Version 1.0</name>
+ <description>API classes for the Service Component Architecture</description>
+ <version>1.0-incubating</version>
+
+ <properties>
+ <scaSpecVersion>1.0</scaSpecVersion>
+ </properties>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <!-- release profile that prepares artifacts for release -->
+ <id>release</id>
+ <build>
+ <defaultGoal>verify</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/CallableReference.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/CallableReference.java
new file mode 100644
index 0000000000..c32d229a76
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/CallableReference.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Common superclass for references that can be passed between components.
+ *
+ * @version $Rev$ $Date$
+ * @param <B> the Java interface associated with this reference
+ */
+public interface CallableReference<B> {
+ /**
+ * Returns a type-safe reference to the target of this reference.
+ * The instance returned is guaranteed to implement the business interface for this reference
+ * but may not be a proxy as defined by java.lang.reflect.Proxy.
+ *
+ * @return a proxy to the target that implements the business interface associated with this reference
+ */
+ B getService();
+
+ /**
+ * Returns the Java class for the business interface associated with this reference.
+ *
+ * @return the Class for the business interface associated with this reference
+ */
+ Class<B> getBusinessInterface();
+
+ /**
+ * Returns true if this reference is conversational.
+ *
+ * @return true if this reference is conversational
+ */
+ boolean isConversational();
+
+ /**
+ * Returns the conversation associated with this reference.
+ * Returns null if no conversation is currently active.
+ *
+ * @return the conversation associated with this reference; may be null
+ */
+ Conversation getConversation();
+
+ /**
+ * Returns the callback ID.
+ *
+ * @return the callback ID
+ */
+ Object getCallbackID();
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ComponentContext.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ComponentContext.java
new file mode 100644
index 0000000000..616d4c6338
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ComponentContext.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Interface providing programmatic access to a component's SCA context as an alternative to injection.
+ * It provides access to reference and property values for the component and provides a mechanism for
+ * obtaining a reference to a service that can be passed to other components.
+ * <p/>
+ * SCA components obtain an instance of this interface through injection. Non-SCA client code may also
+ * obtain an instance through runtime-specific mechanisms.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ComponentContext {
+ /**
+ * Returns the absolute URI of the component within the SCA Domain.
+ *
+ * @return the absolute URI of the component
+ */
+ String getURI();
+
+ /**
+ * Cast a type-safe reference to a CallableReference.
+ * Converts a type-safe reference to an equivalent CallableReference; if the target refers to a service
+ * then a ServiceReference will be returned, if the target refers to a callback then a CallableReference
+ * will be returned.
+ *
+ * @param target a reference proxy provided by the SCA runtime
+ * @param <B> the Java type of the business interface for the reference
+ * @param <R> the type of reference to be returned
+ * @return a CallableReference equivalent for the proxy
+ * @throws IllegalArgumentException if the supplied instance is not a reference supplied by the SCA runtime
+ */
+ <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException;
+
+ /**
+ * Returns a proxy for a reference defined by this component.
+ *
+ * @param businessInterface the interface that will be used to invoke the service
+ * @param referenceName the name of the reference
+ * @param <B> the Java type of the business interface for the reference
+ * @return an object that implements the business interface
+ */
+ <B> B getService(Class<B> businessInterface, String referenceName);
+
+ /**
+ * Returns a ServiceReference for a reference defined by this component.
+ *
+ * @param businessInterface the interface that will be used to invoke the service
+ * @param referenceName the name of the reference
+ * @param <B> the Java type of the business interface for the reference
+ * @return a ServiceReference for the designated reference
+ */
+ <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String referenceName);
+
+ /**
+ * Returns the value of an SCA property defined by this component.
+ *
+ * @param type the Java type to be returned for the property
+ * @param propertyName the name of the property whose value should be returned
+ * @param <B> the Java type of the property
+ * @return the property value
+ */
+ <B> B getProperty(Class<B> type, String propertyName);
+
+ /**
+ * Returns a ServiceReference that can be used to invoke this component over the default service.
+ *
+ * @param businessInterface the interface that will be used to invoke the service
+ * @param <B> the Java type of the business interface for the reference
+ * @return a ServiceReference that will invoke this component
+ */
+ <B> ServiceReference<B> createSelfReference(Class<B> businessInterface);
+
+ /**
+ * Returns a ServiceReference that can be used to invoke this component over the designated service.
+ *
+ * @param businessInterface the interface that will be used to invoke the service
+ * @param serviceName the name of the service to invoke
+ * @param <B> the Java type of the business interface for the reference
+ * @return a ServiceReference that will invoke this component
+ */
+ <B> ServiceReference<B> createSelfReference(Class<B> businessInterface, String serviceName);
+
+ /**
+ * Returns the context for the current SCA service request, or null if there is no current request
+ * or if the context is unavailable.
+ *
+ * @return the SCA request context; may be null
+ */
+ RequestContext getRequestContext();
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Constants.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Constants.java
new file mode 100644
index 0000000000..b1b2af8048
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Constants.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Constants {
+ /**
+ * Namespace for intents.
+ */
+ String SCA_NS = "http://www.osoa.org/xmlns/sca/1.0";
+
+ /**
+ * Prefix form of the namespace that can be prepended to intent declarations.
+ */
+ String SCA_PREFIX = '{' + SCA_NS + '}';
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Conversation.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Conversation.java
new file mode 100644
index 0000000000..64423a4aa2
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/Conversation.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Interface representing a Conversation providing access to the conversation id and and a mechanism
+ * to terminate the conversation.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Conversation {
+ /**
+ * Returns the identifier for this conversation.
+ * If a user-defined identity had been supplied for this reference then its value will be returned;
+ * otherwise the identity generated by the system when the conversation was initiated will be returned.
+ *
+ * @return the identifier for this conversation
+ */
+ Object getConversationID();
+
+ /**
+ * End this conversation.
+ */
+ void end();
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ConversationEndedException.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ConversationEndedException.java
new file mode 100644
index 0000000000..63e3907cff
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ConversationEndedException.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception thrown to indicate the conversation being used for a stateful interaction has been ended.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ConversationEndedException extends ServiceRuntimeException {
+ private static final long serialVersionUID = 3734864942222558406L;
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @see ServiceRuntimeException
+ */
+ public ConversationEndedException() {
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public ConversationEndedException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public ConversationEndedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public ConversationEndedException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java
new file mode 100644
index 0000000000..7c067a3a43
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception thrown to indicate that no callback has been registered
+ * when interacting with a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NoRegisteredCallbackException extends ServiceRuntimeException {
+ private static final long serialVersionUID = 3734864942222558406L;
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException() {
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/RequestContext.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/RequestContext.java
new file mode 100644
index 0000000000..900d5eecc1
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/RequestContext.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+import javax.security.auth.Subject;
+
+/**
+ * Interface that provides information on the current request.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RequestContext {
+ /**
+ * Returns the JAAS Subject of the current request.
+ *
+ * @return the Subject of the current request
+ */
+ Subject getSecuritySubject();
+
+ /**
+ * Returns the name of the service that was invoked.
+ *
+ * @return the name of the service that was invoked
+ */
+ String getServiceName();
+
+ /**
+ * Returns a CallableReference for the service that was invoked by the caller.
+ *
+ * @param <B> the Java type of the business interface for the reference
+ * @return a CallableReference for the service that was invoked by the caller
+ */
+ <B> CallableReference<B> getServiceReference();
+
+ /**
+ * Returns a type-safe reference to the callback provided by the caller.
+ *
+ * @param <CB> the Java type of the business interface for the callback
+ * @return a type-safe reference to the callback provided by the caller
+ */
+ <CB> CB getCallback();
+
+ /**
+ * Returns a CallableReference to the callback provided by the caller.
+ *
+ * @param <CB> the Java type of the business interface for the callback
+ * @return a CallableReference to the callback provided by the caller
+ */
+ <CB> CallableReference<CB> getCallbackReference();
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceReference.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceReference.java
new file mode 100644
index 0000000000..8790aac4fb
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceReference.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+
+/**
+ * A ServiceReference represents a client's perspective of a reference to another service.
+ *
+ * @version $Rev$ $Date$
+ * @param <B> the Java interface associated with this reference
+ */
+public interface ServiceReference<B> extends CallableReference<B> {
+ /**
+ * Returns the id supplied by the user that will be associated with conversations initiated through this reference.
+ *
+ * @return the id to associated with any conversation initiated through this reference
+ */
+ Object getConversationID();
+
+ /**
+ * Set the id to associate with any conversation started through this reference.
+ * If the value supplied is null then the id will be generated by the implementation.
+ *
+ * @param conversationId the user-defined id to associated with a conversation
+ * @throws IllegalStateException if a conversation is currently associated with this reference
+ */
+ void setConversationID(Object conversationId) throws IllegalStateException;
+
+ /**
+ * Sets the callback ID.
+ *
+ * @param callbackID the callback ID
+ */
+ void setCallbackID(Object callbackID);
+
+ /**
+ * Returns the callback object.
+ *
+ * @return the callback object
+ */
+ Object getCallback();
+
+ /**
+ * Sets the callback object.
+ *
+ * @param callback the callback object
+ */
+ void setCallback(Object callback);
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceRuntimeException.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceRuntimeException.java
new file mode 100644
index 0000000000..1c6b436afa
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceRuntimeException.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+
+/**
+ * Base for Exceptions that may be raised by an SCA runtime and which typical
+ * application code is not expected to be able to handle.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServiceRuntimeException extends RuntimeException {
+ private static final long serialVersionUID = -3876058842262557092L;
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException() {
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param message passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param message passed to RuntimeException
+ * @param cause passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param cause passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceUnavailableException.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceUnavailableException.java
new file mode 100644
index 0000000000..d3543799ed
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/ServiceUnavailableException.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception used to indicate that a runtime exception occurred during the invocation of and external service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServiceUnavailableException extends ServiceRuntimeException {
+
+ private static final long serialVersionUID = -5869397223249401047L;
+
+ /**
+ * Constructs a new ServiceUnavailableException.
+ */
+ public ServiceUnavailableException() {
+ super((Throwable) null);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified detail message.
+ *
+ * @param message The detail message (which is saved to later retrieval by the getMessage() method).
+ */
+ public ServiceUnavailableException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified cause.
+ *
+ * @param cause The cause (which is saved to later retrieval by the getCause() method).
+ */
+ public ServiceUnavailableException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified detail message and cause.
+ *
+ * @param message The message (which is saved to later retrieval by the getMessage() method).
+ * @param cause The cause (which is saved to later retrieval by the getCause() method).
+ */
+ public ServiceUnavailableException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java
new file mode 100644
index 0000000000..dcf16126da
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation on a method that indicates that its parameters may safely
+ * be passed by reference. The annotation may also be placed on an interface
+ * or class to indicate that all declared methods support this optimization.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface AllowsPassByReference {
+}
+
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Authentication.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Authentication.java
new file mode 100644
index 0000000000..290ec05b7f
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Authentication.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import static org.osoa.sca.Constants.SCA_PREFIX;
+
+/**
+ * Annotation denoting the intent that service operations require authentication.
+ * <p/>
+ * Applied to the injection site (field, method or constructor parameter) for a reference,
+ * it indicates that all invocations through that reference require authentication.
+ * <p/>
+ * Applied to a interface method on a service contract, it indicates that all invocations
+ * of that service operation require authentication; applied to the type of a service contract,
+ * it indicates that all service operations on that interface require authentication.
+ * <p/>
+ * Applied to a method on an implementation class, it indicates that all invocations that
+ * are dispatched to that implementation method (through any service) require authentication.
+ * Applied to a interface implemented by an implementation class, it indicates that all
+ * invocations that are dispatched to the implementation method for that interface operation
+ * require authentication.
+ * <p/>
+ * Applied to an implementation class, it indicates that all invocations of that implementation
+ * and that all invocations made by that implementation require authentication.
+ *
+ * @version $Rev$ $Date$
+ */
+@Inherited
+@Target({TYPE, FIELD, METHOD, PARAMETER})
+@Retention(RUNTIME)
+@Intent(Authentication.AUTHENTICATION)
+public @interface Authentication {
+ String AUTHENTICATION = SCA_PREFIX + "authentication";
+ String AUTHENTICATION_MESSAGE = AUTHENTICATION + "message";
+ String AUTHENTICATION_TRANSPORT = AUTHENTICATION + "transport";
+
+ /**
+ * List of authentication qualifiers (such as "message" or "transport").
+ *
+ * @return authentication qualifiers
+ */
+ @Qualifier
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Callback.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Callback.java
new file mode 100644
index 0000000000..6b3e51211a
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Callback.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * When placed on a service interface, this annotation specifies the interface
+ * to be used for callbacks.
+ * <p/>
+ * When placed on a method or field, this annotation denotes the injection
+ * site to be used for a callback reference.
+ * <p/>
+ * There is a error in the 1.00 draft spec in the declaration of this interface.
+ * The form defined here is a proposed correction for that error.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Callback {
+ /**
+ * The Class of the associated callback interface.
+ *
+ * @return the associated callback interface
+ */
+ Class<?> value() default Void.class;
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ComponentName.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ComponentName.java
new file mode 100644
index 0000000000..0ad13831c2
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ComponentName.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or method that is used to inject the component's name.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface ComponentName {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Confidentiality.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Confidentiality.java
new file mode 100644
index 0000000000..e8b0721ce5
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Confidentiality.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import static org.osoa.sca.Constants.SCA_PREFIX;
+
+/**
+ * Annotation denoting the intent that service operations require confidentiality.
+ * <p/>
+ * Applied to the injection site (field, method or constructor parameter) for a reference,
+ * it indicates that all invocations through that reference require confidentiality.
+ * <p/>
+ * Applied to a interface method on a service contract, it indicates that all invocations
+ * of that service operation require confidentiality; applied to the type of a service contract,
+ * it indicates that all service operations on that interface require confidentiality.
+ * <p/>
+ * Applied to a method on an implementation class, it indicates that all invocations that
+ * are dispatched to that implementation method (through any service) require confidentiality.
+ * Applied to a interface implemented by an implementation class, it indicates that all
+ * invocations that are dispatched to the implementation method for that interface operation
+ * require confidentiality.
+ * <p/>
+ * Applied to an implementation class, it indicates that all invocations of that implementation
+ * and that all invocations made by that implementation require confidentiality.
+ *
+ * @version $Rev$ $Date$
+ */
+@Inherited
+@Target({TYPE, FIELD, METHOD, PARAMETER})
+@Retention(RUNTIME)
+@Intent(Confidentiality.CONFIDENTIALITY)
+public @interface Confidentiality {
+ String CONFIDENTIALITY = SCA_PREFIX + "confidentiality";
+ String CONFIDENTIALITY_MESSAGE = CONFIDENTIALITY + ".message";
+ String CONFIDENTIALITY_TRANSPORT = CONFIDENTIALITY + ".transport";
+
+ /**
+ * List of confidentiality qualifiers (such as "message" or "transport").
+ *
+ * @return confidentiality qualifiers
+ */
+ @Qualifier
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Constructor.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Constructor.java
new file mode 100644
index 0000000000..8480b38926
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Constructor.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Used to indicate the constructor the runtime is to use when instantiating a component implementation instance
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(CONSTRUCTOR)
+@Retention(RUNTIME)
+public @interface Constructor {
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Context.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Context.java
new file mode 100644
index 0000000000..c02e220d3c
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Context.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or setter method that is used to inject an SCA context.
+ * The type of context injected is determined by the type of the field or the parameter
+ * to the setter method and is typically a ComponentContext or RequestContext.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Context {
+}
+
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationAttributes.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationAttributes.java
new file mode 100644
index 0000000000..edd2307de8
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationAttributes.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate the characteristics of a conversation.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(ElementType.TYPE)
+@Retention(RUNTIME)
+public @interface ConversationAttributes {
+ /**
+ * The maximum time that can pass between operations in a single conversation. If this time is exceeded the
+ * container may end the conversation.
+ *
+ * @return the maximum time that can pass between operations in a single conversation
+ */
+ public String maxIdleTime() default "";
+
+ /**
+ * The maximum time that a conversation may remain active. If this time is exceeded the container may end the
+ * conversation.
+ *
+ * @return the maximum time that a conversation may remain active
+ */
+ public String maxAge() default "";
+
+ /**
+ * If true, indicates that only the user that initiated the conversation has the authority to continue it.
+ *
+ * @return true if only the user that initiated the conversation has the authority to continue it
+ */
+ public boolean singlePrincipal() default false;
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationID.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationID.java
new file mode 100644
index 0000000000..e521b91797
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/ConversationID.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or method that is used to inject the conversation ID.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface ConversationID {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Conversational.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Conversational.java
new file mode 100644
index 0000000000..c2e6e7fe0f
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Conversational.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Used on a Java interface to denote a conversational service contract.
+ * <p/>
+ * The draft spec erroneously defines the targets for this as {TYPE, METHOD, FIELD}
+ * but this annotation is only applicable to interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface Conversational {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Destroy.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Destroy.java
new file mode 100644
index 0000000000..0a81dbe14c
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Destroy.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a method that will be called by the container when the
+ * scope defined for the local service ends.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+public @interface Destroy {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EagerInit.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EagerInit.java
new file mode 100644
index 0000000000..5a2fdd7518
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EagerInit.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate an instance should be eagerly initialized.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface EagerInit {
+
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EndsConversation.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EndsConversation.java
new file mode 100644
index 0000000000..021900752c
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/EndsConversation.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a method ends a conversation.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+public @interface EndsConversation {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Init.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Init.java
new file mode 100644
index 0000000000..957bec262c
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Init.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a method that will be called by the container when the scope defined for the local
+ * service begins.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+public @interface Init {
+
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Integrity.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Integrity.java
new file mode 100644
index 0000000000..11f266ac5e
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Integrity.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+import static org.osoa.sca.Constants.SCA_PREFIX;
+
+/**
+ * Annotation denoting the intent that service operations require integrity.
+ * <p/>
+ * Applied to the injection site (field, method or constructor parameter) for a reference,
+ * it indicates that all invocations through that reference require integrity.
+ * <p/>
+ * Applied to a interface method on a service contract, it indicates that all invocations
+ * of that service operation require integrity; applied to the type of a service contract,
+ * it indicates that all service operations on that interface require integrity.
+ * <p/>
+ * Applied to a method on an implementation class, it indicates that all invocations that
+ * are dispatched to that implementation method (through any service) require integrity.
+ * Applied to a interface implemented by an implementation class, it indicates that all
+ * invocations that are dispatched to the implementation method for that interface operation
+ * require integrity.
+ * <p/>
+ * Applied to an implementation class, it indicates that all invocations of that implementation
+ * and that all invocations made by that implementation require integrity.
+ *
+ * @version $Rev$ $Date$
+ */
+@Inherited
+@Target({TYPE, FIELD, METHOD, PARAMETER})
+@Retention(RUNTIME)
+@Intent(Integrity.INTEGRITY)
+public @interface Integrity {
+ String INTEGRITY = SCA_PREFIX + "integrity";
+ String INTEGRITY_MESSAGE = INTEGRITY + "message";
+ String INTEGRITY_TRANSPORT = INTEGRITY + "transport";
+
+ /**
+ * List of integrity qualifiers (such as "message" or "transport").
+ *
+ * @return integrity qualifiers
+ */
+ @Qualifier
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Intent.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Intent.java
new file mode 100644
index 0000000000..c655495e74
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Intent.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation that can be applied to annotations that describe SCA intents.
+ * Adding this annotation allows SCA runtimes to automatically detect user-defined intents.
+ * <p/>
+ * Applications must specify a value, a pairing of targetNamespace and localPort, or both.
+ * If both value and pairing are supplied they must define the name qualified name.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({ANNOTATION_TYPE})
+@Retention(RUNTIME)
+public @interface Intent {
+ /**
+ * The qualified name of the intent, in the form defined by {@link javax.xml.namespace.QName#toString}.
+ *
+ * @return the qualified name of the intent
+ */
+ String value() default "";
+
+ /**
+ * The XML namespace for the intent.
+ *
+ * @return the XML namespace for the intent
+ */
+ String targetNamespace() default "";
+
+ /**
+ * The name of the intent within its namespace.
+ *
+ * @return name of the intent within its namespace
+ */
+ String localPart() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/OneWay.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/OneWay.java
new file mode 100644
index 0000000000..37fbaf96cd
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/OneWay.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation on a method that indicates that the method is non-blocking and communication
+ * with the service provider may use buffer the requests and send them at some later time.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+public @interface OneWay {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/PolicySets.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/PolicySets.java
new file mode 100644
index 0000000000..5bf43b0539
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/PolicySets.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation that allows application of SCA Policy Sets.
+ * <p/>
+ * Each policy set is specified using its XML QName in the form defined by {@link javax.xml.namespace.QName#toString()}.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE, FIELD, METHOD, PARAMETER})
+@Retention(RUNTIME)
+public @interface PolicySets {
+ /**
+ * Returns the policy sets to be applied.
+ *
+ * @return the policy sets to be applied
+ */
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Property.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Property.java
new file mode 100644
index 0000000000..c3b563d985
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Property.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a constructor parameter, field or method that is
+ * used to inject a configuration property value.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD, PARAMETER})
+@Retention(RUNTIME)
+public @interface Property {
+ /**
+ * The name of the property. If not specified then the name will be derived
+ * from the annotated field or method.
+ *
+ * @return the name of the property
+ */
+ String name() default "";
+
+ /**
+ * Indicates whether a value for the property must be provided.
+ *
+ * @return true if a value must be provided
+ */
+ boolean required() default false;
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Qualifier.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Qualifier.java
new file mode 100644
index 0000000000..9875891460
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Qualifier.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation that can be applied to an attribute of an @Intent annotation to indicate the
+ * attribute provides qualifiers for the intent.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+public @interface Qualifier {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Reference.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Reference.java
new file mode 100644
index 0000000000..f6f6797ccc
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Reference.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a constructor parameter, field or method that is used to inject a reference.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD, PARAMETER})
+@Retention(RUNTIME)
+public @interface Reference {
+ /**
+ * The name of the reference. If not specified then the name will be derived from the annotated field or method.
+ *
+ * @return the name of the reference
+ */
+ public String name() default "";
+
+ /**
+ * Indicates if a reference must be specified.
+ *
+ * @return true if a reference must be specified
+ */
+ public boolean required() default false;
+}
+
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Remotable.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Remotable.java
new file mode 100644
index 0000000000..f447a4126d
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Remotable.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a Java interface as remotable.
+ * Remotable interfaces use pass-by-value semantics, can be published as entry points
+ * and used for external services.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Remotable {
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Requires.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Requires.java
new file mode 100644
index 0000000000..2f14ab59f6
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Requires.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation that allows the attachment of any intent to a Java Class or interface or to members of that
+ * class such as methods, fields or constructor parameters.
+ * <p/>
+ * Intents are specified as XML QNames in the representation defined by
+ * {@link javax.xml.namespace.QName#toString()}. Intents may be qualified with one or more
+ * suffixes separated by a "." such as:
+ * <ul>
+ * <li>{http://www.osoa.org/xmlns/sca/1.0}confidentiality</li>
+ * <li>{http://www.osoa.org/xmlns/sca/1.0}confidentiality.message</li>
+ * </ul>
+ * This annotation supports general purpose intents specified as strings. Users may also define
+ * specific intents using the {@link @org.osoa.sca.annotations.Intent} annotation.
+ *
+ * @version $Rev$ $Date$
+ */
+@Inherited
+@Retention(RUNTIME)
+@Target({TYPE, METHOD, FIELD, PARAMETER})
+public @interface Requires {
+ /**
+ * Returns the attached intents.
+ *
+ * @return the attached intents
+ */
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Scope.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Scope.java
new file mode 100644
index 0000000000..9f82fbc283
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Scope.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a scoped service.
+ * <p/>
+ * The spec refers to but does not describe an eager() attribute; this is an error in the draft.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Scope {
+ /**
+ * The name of the scope. Values currently defined by the specification are:
+ * <ul>
+ * <li>STATELESS (default)</li>
+ * <li>REQUEST</li>
+ * <li>CONVERSATION</li>
+ * <li>COMPOSITE</li>
+ * </ul>
+ *
+ * @return the name of the scope
+ */
+ String value() default "STATELESS";
+}
diff --git a/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Service.java b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Service.java
new file mode 100644
index 0000000000..99d3dbfebe
--- /dev/null
+++ b/tags/java/spec/sca-api-r1.0/1.0-incubating/src/main/java/org/osoa/sca/annotations/Service.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate the service interfaces exposed by a Java class.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface Service {
+ /**
+ * Array of interfaces that should be exposed as services.
+ *
+ * @return a list of interfaces that should be exposed as services
+ */
+ Class<?>[] interfaces() default {};
+
+ /**
+ * Shortcut allowing a single interface to be exposed.
+ *
+ * @return a single service interfaces to be exposed
+ */
+ Class<?> value() default Void.class;
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/LICENSE.txt b/tags/java/spec/sca/1.0-incubator-M2/LICENSE.txt
new file mode 100644
index 0000000000..d645695673
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/tags/java/spec/sca/1.0-incubator-M2/NOTICE.txt b/tags/java/spec/sca/1.0-incubator-M2/NOTICE.txt
new file mode 100644
index 0000000000..d83ebbe236
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/NOTICE.txt
@@ -0,0 +1,14 @@
+${pom.name}
+Copyright (c) 2005 - 2006 The Apache Software Foundation
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software
+Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is
+required of all newly accepted projects until a further review indicates that
+the infrastructure, communications, and decision making process have stabilized
+in a manner consistent with other successful ASF projects. While incubation
+status is not necessarily a reflection of the completeness or stability of the
+code, it does indicate that the project has yet to be fully endorsed by the ASF.
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/tags/java/spec/sca/1.0-incubator-M2/README.txt b/tags/java/spec/sca/1.0-incubator-M2/README.txt
new file mode 100644
index 0000000000..9b26d1690a
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/README.txt
@@ -0,0 +1,35 @@
+Apache Tuscany M1 build (May, 2006)
+===================================
+
+http://incubator.apache.org/tuscany/
+
+Tuscany is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Web Services PMC.
+
+Incubation is required of all newly accepted projects until a further review
+indicates that the infrastructure, communications, and decision making process
+have stabilized in a manner consistent with other successful ASF projects.
+
+While incubation status is not necessarily a reflection of the completeness or
+stability of the code, it does indicate that the project has yet to be fully
+endorsed by the ASF.
+
+
+Support
+-------
+
+Any problem with this release can be reported to the Tuscany mailing list
+or in the JIRA issue tracker.
+
+Mailing list subscription:
+ tuscany-dev-subscribe@ws.apache.org
+
+Jira:
+ http://issues.apache.org/jira/browse/Tuscany
+
+
+Thank you for using Tuscany!
+
+
+The Tuscany Team.
+
diff --git a/tags/java/spec/sca/1.0-incubator-M2/pom.xml b/tags/java/spec/sca/1.0-incubator-M2/pom.xml
new file mode 100644
index 0000000000..4700ac3dab
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/pom.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>1-incubator</version>
+ </parent>
+ <groupId>org.osoa</groupId>
+ <artifactId>sca-api-r${specVersion}</artifactId>
+ <name>SCA API</name>
+ <description>API classes for the Service Component Architecture</description>
+ <version>1.0-incubator-M2</version>
+ <packaging>osgi-bundle</packaging>
+
+ <properties>
+ <specVersion>0.95</specVersion>
+ </properties>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix.plugins</groupId>
+ <artifactId>maven-osgi-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <osgiManifest>
+ <bundleName>${pom.name}</bundleName>
+ <bundleDescription>${pom.description}</bundleDescription>
+ <bundleVendor>${pom.organization.name}</bundleVendor>
+ <bundleLocalization>plugin</bundleLocalization>
+ <bundleSymbolicName>org.osoa.sca</bundleSymbolicName>
+ <exportPackage>org.osoa.sca;version="${specVersion}", org.osoa.sca.annotations;version="${specVersion}"</exportPackage>
+ </osgiManifest>
+ </configuration>
+ </plugin>
+ </plugins>
+ <defaultGoal>install</defaultGoal>
+ </build>
+</project>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CompositeContext.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CompositeContext.java
new file mode 100644
index 0000000000..91017a9f4a
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CompositeContext.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+
+/**
+ * Interface used by SCA Components to access their context
+ *
+ * @version $Rev$ $Date$
+ */
+public interface CompositeContext {
+
+ /**
+ * Returns the name of the parent composite.
+ *
+ * @return the name of the module
+ */
+ String getCompositeName();
+
+ /**
+ * Returns the absolute URI of the composite component.
+ *
+ * @return the absolute URI of the module component
+ */
+ String getCompositeURI();
+
+ /**
+ * Returns the request context that corresponds to the last remotable service invocation. If this is
+ * invoked from outside an SCA component then <tt>null</tt> is returned.
+ *
+ * @return the current request context
+ */
+ RequestContext getRequestContext();
+
+ /**
+ * Returns an object implementing the interface defined for the named service.
+ *
+ * @param serviceName the name of another service in the current module
+ * @return an object that implements the service's interface
+ */
+ <T> T locateService(Class<T> serviceType, String serviceName);
+
+ /**
+ * Create a reference to the supplied component. The component must define only one service.
+ *
+ * @param self the component to be referenced
+ * @return a reference to the component
+ */
+ ServiceReference createServiceReferenceForSession(Object self);
+
+ /**
+ * Create a reference to the named service implemented by the supplied component.
+ *
+ * @param self the component to be referenced
+ * @param serviceName the service to be referenced
+ * @return a reference to the service
+ */
+ ServiceReference createServiceReferenceForSession(Object self, String serviceName);
+
+ /**
+ * Create a new session for stateful interaction with the named service.
+ *
+ * @param serviceName the name of the service to interact with
+ * @return a reference to the service
+ */
+ ServiceReference newSession(String serviceName);
+
+ /**
+ * Create a new session for stateful interaction with the named service using an application-supplied
+ * session identifier.
+ *
+ * @param serviceName the name of the service to interact with
+ * @param sessionId a token that identifies this session
+ * @return a reference to the service
+ */
+ ServiceReference newSession(String serviceName, Object sessionId);
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CurrentCompositeContext.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CurrentCompositeContext.java
new file mode 100644
index 0000000000..ee89077121
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/CurrentCompositeContext.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Class providing access to the current CompositeComponent.
+ *
+ * @version $Rev$ $Date$
+ */
+public final class CurrentCompositeContext {
+ private static final ThreadLocal<CompositeContext> CURRENT_COMPONENT =
+ new InheritableThreadLocal<CompositeContext>();
+
+ /**
+ * Return the current composite context
+ */
+ public static CompositeContext getContext() {
+ return CURRENT_COMPONENT.get();
+ }
+
+ static void setContext(CompositeContext component) {
+ CURRENT_COMPONENT.set(component);
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java
new file mode 100644
index 0000000000..afccfd400d
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception thrown to indicate that no callback has been registered
+ * when interacting with a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NoRegisteredCallbackException extends ServiceRuntimeException {
+ private static final long serialVersionUID = 3734864942222558406L;
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException() {
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public NoRegisteredCallbackException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/RequestContext.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/RequestContext.java
new file mode 100644
index 0000000000..9d1b09f757
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/RequestContext.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+import javax.security.auth.Subject;
+
+/**
+ * Interface that provides information on the current request.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface RequestContext {
+ /**
+ * Returns the JAAS Subject of the current request.
+ *
+ * @return the Subject of the current request
+ */
+ Subject getSecuritySubject();
+
+ /**
+ * Returns the name of the service that was invoked.
+ *
+ * @return the name of the service that was invoked
+ */
+ String getServiceName();
+
+ /**
+ * Returns a reference to the service that was invoked.
+ *
+ * @return a reference to the service that was invoked
+ */
+ ServiceReference getServiceReference();
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SCA.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SCA.java
new file mode 100644
index 0000000000..c405b3e3f4
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SCA.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Class providing access to an SCA implementation.
+ * SCA implementation providers may allow applications to bootstrap an SCA environment
+ * by providing a publically available subclass.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class SCA {
+ /**
+ * Protected method that allows an SCA implementation to set the current module context
+ * that will be returned by {@link org.osoa.sca.CurrentCompositeContext#getContext()}.
+ *
+ * @param ctx the new current composite context
+ */
+ protected static void setCompositeContext(CompositeContext ctx) {
+ CurrentCompositeContext.setContext(ctx);
+ }
+
+ /**
+ * Start the SCA implementation.
+ * If this method completes successfully then a module context will be associated with the current thread.
+ */
+ public abstract void start();
+
+ /**
+ * Stop the SCA implementation.
+ * Once this method completes (successfully or abnormally) then no module context will be associated
+ * with the current thread.
+ */
+ public abstract void stop();
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceReference.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceReference.java
new file mode 100644
index 0000000000..5290c1d2fb
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceReference.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+
+/**
+ * Interface that provides access to other services.
+ * Any ServiceReference can be cast to the business interface of the service to
+ * which it refers.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ServiceReference {
+ /**
+ * Returns the session ID.
+ *
+ * @return the session ID
+ */
+ Object getSessionID();
+
+ /**
+ * End the client's session with the referenced service.
+ */
+ void endSession();
+
+ /**
+ * Returns the callback ID.
+ *
+ * @return the callback ID
+ */
+ Object getCallbackID();
+
+ /**
+ * Sets the callback ID.
+ *
+ * @param callbackID the callback ID
+ */
+ void setCallbackID(Object callbackID);
+
+ /**
+ * Returns the callback object.
+ *
+ * @return the callback object
+ */
+ Object getCallback();
+
+ /**
+ * Sets the callback object.
+ *
+ * @param callback the callback object
+ */
+ void setCallback(Object callback);
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceRuntimeException.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceRuntimeException.java
new file mode 100644
index 0000000000..460e0b720e
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceRuntimeException.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+
+/**
+ * Base for Exceptions that may be raised by an SCA runtime and which typical
+ * application code is not expected to be able to handle.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServiceRuntimeException extends RuntimeException {
+ private static final long serialVersionUID = -3876058842262557092L;
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException() {
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param message passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param message passed to RuntimeException
+ * @param cause passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from RuntimeException.
+ *
+ * @param cause passed to RuntimeException
+ * @see RuntimeException
+ */
+ public ServiceRuntimeException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceUnavailableException.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceUnavailableException.java
new file mode 100644
index 0000000000..edb0593ab2
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/ServiceUnavailableException.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception used to indicate that a runtime exception occurred during the invocation of and external service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServiceUnavailableException extends ServiceRuntimeException {
+
+ private static final long serialVersionUID = -5869397223249401047L;
+
+ /**
+ * Constructs a new ServiceUnavailableException.
+ */
+ public ServiceUnavailableException() {
+ super((Throwable) null);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified detail message.
+ *
+ * @param message The detail message (which is saved to later retrieval by the getMessage() method).
+ */
+ public ServiceUnavailableException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified cause.
+ *
+ * @param cause The cause (which is saved to later retrieval by the getCause() method).
+ */
+ public ServiceUnavailableException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new ServiceUnavailableException with the specified detail message and cause.
+ * @param message
+ * The message (which is saved to later retrieval by the getMessage() method).
+ * @param cause
+ * The cause (which is saved to later retrieval by the getCause() method).
+ */
+ public ServiceUnavailableException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SessionEndedException.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SessionEndedException.java
new file mode 100644
index 0000000000..8592397d33
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/SessionEndedException.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Exception thrown to indicate the session being used for a stateful
+ * interaction has been ended.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SessionEndedException extends ServiceRuntimeException {
+ private static final long serialVersionUID = 3734864942222558406L;
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @see ServiceRuntimeException
+ */
+ public SessionEndedException() {
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public SessionEndedException(String message) {
+ super(message);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param message passed to ServiceRuntimeException
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public SessionEndedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Override constructor from ServiceRuntimeException.
+ *
+ * @param cause passed to ServiceRuntimeException
+ * @see ServiceRuntimeException
+ */
+ public SessionEndedException(Throwable cause) {
+ super(cause);
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/Version.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/Version.java
new file mode 100644
index 0000000000..76034f3a2c
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/Version.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca;
+
+/**
+ * Class providing information on the version of the specification
+ * supported by these API classes.
+ *
+ * @version $Rev$ $Date$
+ */
+public final class Version {
+ /**
+ * Identifier for version 1.0
+ */
+ public static final String VERSION_1_0 = "1.0";
+
+ /**
+ * Identifier for the XML Namespace for version 1.0
+ */
+ public static final String XML_NAMESPACE_1_0 = "http://www.osoa.org/xmlns/sca/1.0";
+
+ /**
+ * The specification version of these API classes.
+ */
+ public static final String API_VERSION = VERSION_1_0;
+
+ private Version() {
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java
new file mode 100644
index 0000000000..dcf16126da
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation on a method that indicates that its parameters may safely
+ * be passed by reference. The annotation may also be placed on an interface
+ * or class to indicate that all declared methods support this optimization.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE, METHOD})
+@Retention(RUNTIME)
+public @interface AllowsPassByReference {
+}
+
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Callback.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Callback.java
new file mode 100644
index 0000000000..dbfdce7e7c
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Callback.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * When placed on a service interface, this annotation specifies the interface
+ * to be used for callbacks.
+ * <p/>
+ * When placed on a method or field, this annotation denotes the injection
+ * site to be used for a callback reference.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Callback {
+ /**
+ * The Class of the callback interface.
+ */
+ Class<?> value() default Void.class;
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/ComponentName.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/ComponentName.java
new file mode 100644
index 0000000000..0ad13831c2
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/ComponentName.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or method that is used to inject the component's name.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface ComponentName {
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Constructor.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Constructor.java
new file mode 100644
index 0000000000..8480b38926
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Constructor.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.CONSTRUCTOR;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Used to indicate the constructor the runtime is to use when instantiating a component implementation instance
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(CONSTRUCTOR)
+@Retention(RUNTIME)
+public @interface Constructor {
+ String[] value() default "";
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Context.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Context.java
new file mode 100644
index 0000000000..93f6710578
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Context.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or method that is used to inject the component's CompositeContext.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Context {
+}
+
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Destroy.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Destroy.java
new file mode 100644
index 0000000000..0a81dbe14c
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Destroy.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a method that will be called by the container when the
+ * scope defined for the local service ends.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+public @interface Destroy {
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Init.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Init.java
new file mode 100644
index 0000000000..00ca24a39e
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Init.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a method that will be called by the container when the
+ * scope defined for the local service begins.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(METHOD)
+@Retention(RUNTIME)
+public @interface Init {
+ /**
+ * Instructs the container when a component instance should be instantiated.
+ * If true, then the component will be instantiated when its scope begins;
+ * if false it will be instantiated when first referenced.
+ */
+ public boolean eager() default false;
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/OneWay.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/OneWay.java
new file mode 100644
index 0000000000..fbc7398da4
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/OneWay.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation on a method that indicates that the method is non-blocking and communication
+ * with the service provider may use buffer the requests and send them at some later time.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+public @interface OneWay {
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Property.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Property.java
new file mode 100644
index 0000000000..acbc35a1ec
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Property.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a constructor parameter, field or method that is
+ * used to inject a configuration property value.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target( {METHOD, FIELD, PARAMETER})
+@Retention(RUNTIME)
+public @interface Property {
+ /**
+ * The name of the property. If not specified then the name will be derived
+ * from the annotated field.
+ */
+ public String name() default "";
+
+ /**
+ * Indicates if a value must be specified.
+ */
+ public String override() default "may";
+
+ /**
+ * The XML Type in a QName format
+ */
+ public String xmlType() default "";
+
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Reference.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Reference.java
new file mode 100644
index 0000000000..7fceafadf3
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Reference.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a constructor parameter, field or method that is used to inject a reference.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD, PARAMETER})
+@Retention(RUNTIME)
+public @interface Reference {
+ /**
+ * The name of the reference. If not specified then the name will be derived from the annotated field.
+ */
+ public String name() default "";
+
+ /**
+ * Indicates if a reference must be specified.
+ */
+ public boolean required() default false;
+}
+
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Remotable.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Remotable.java
new file mode 100644
index 0000000000..f447a4126d
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Remotable.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a Java interface as remotable.
+ * Remotable interfaces use pass-by-value semantics, can be published as entry points
+ * and used for external services.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Remotable {
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Scope.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Scope.java
new file mode 100644
index 0000000000..17f274c9fa
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Scope.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a scoped service.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Scope {
+ /**
+ * The name of the scope. Values currently defined by the specification are:
+ * <ul>
+ * <li>stateless (default)</li>
+ * <li>request</li>
+ * <li>session</li>
+ * <li>module</li>
+ * </ul>
+ */
+ String value() default "STATELESS";
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Service.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Service.java
new file mode 100644
index 0000000000..33e7a93ea3
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Service.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate the service interfaces exposed by a Java class.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface Service {
+ /**
+ * Array of interfaces that should be exposed as services.
+ */
+ Class<?>[] interfaces() default {};
+
+ /**
+ * Shortcut allowing a single interface to be exposed.
+ */
+ Class<?> value() default Void.class;
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Session.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Session.java
new file mode 100644
index 0000000000..048716802a
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/Session.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.TYPE;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate the characteristics of a session.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Session {
+ /**
+ * The maximum time that can pass between operations in a single conversation.
+ * If this time is exceeded the container may end the conversation.
+ */
+ public String maxIdleTime() default "";
+
+ /**
+ * The maximum time that a conversation may remain active.
+ * If this time is exceeded the container may end the conversation.
+ */
+ public String maxAge() default "";
+
+ /**
+ * If true, indicates that only the user that initiated the conversation
+ * has the authority to continue it.
+ */
+ public boolean singlePrincipal() default false;
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/SessionID.java b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/SessionID.java
new file mode 100644
index 0000000000..5e5358cb3d
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/java/org/osoa/sca/annotations/SessionID.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Target;
+
+/**
+ * Annotation used to indicate a field or method that is used to inject the session ID.
+ *
+ * @version $Rev$ $Date$
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface SessionID {
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-sca.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-sca.xsd
new file mode 100644
index 0000000000..a501639e78
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-sca.xsd
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="binding.sca" type="sca:SCABinding" substitutionGroup="sca:binding"/>
+ <complexType name="SCABinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-webservice.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-webservice.xsd
new file mode 100644
index 0000000000..0ddaf95697
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-binding-webservice.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="binding.ws" type="sca:WebServiceBinding" substitutionGroup="sca:binding"/>
+ <complexType name="WebServiceBinding">
+ <complexContent>
+ <extension base="sca:Binding">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="port" type="anyURI" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-core.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-core.xsd
new file mode 100644
index 0000000000..fad0304c0d
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-core.xsd
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <element name="componentType" type="sca:ComponentType"/>
+ <complexType name="ComponentType">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="service" type="sca:Service"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="reference" type="sca:Reference"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="property" type="sca:Property"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Service">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="interface" type="sca:Interface"/>
+ <complexType name="Interface"/>
+
+ <complexType name="Reference">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="Property">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="type" type="QName" use="required"/>
+ <attribute name="many" type="boolean" default="false" use="optional"/>
+ <attribute name="required" type="boolean" default="false" use="optional"/>
+ <attribute name="default" type="string" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <element name="moduleFragment" type="sca:ModuleFragment"/>
+ <complexType name="ModuleFragment">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="component" type="sca:Component"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:ModuleWire"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="module" type="sca:Module"/>
+ <complexType name="Module">
+ <complexContent>
+ <extension base="sca:ModuleFragment"/>
+ </complexContent>
+ </complexType>
+
+ <complexType name="EntryPoint">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" ref="sca:interface"/>
+ <element minOccurs="1" maxOccurs="unbounded" ref="sca:binding"/>
+ <element minOccurs="1" maxOccurs="unbounded" name="reference" type="anyURI"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="multiplicity" type="sca:Multiplicity" use="optional" default="1..1"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+ <!-- a multiplicity 1..1 or 0..n sample
+ <reference>StockQuoteComponent</reference> - type must be URI
+ a multiplicity 1..n or 0..n sample
+ <reference>StockQuoteComponent1</reference> - type must be URI
+ <reference>StockQuoteComponent2</reference>
+ -->
+
+ <element name="binding" type="sca:Binding"/>
+ <complexType name="Binding">
+ <attribute name="uri" type="anyURI" use="optional"/>
+ </complexType>
+
+ <complexType name="Component">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:implementation"/>
+ <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
+ <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+ <!-- a multiplicity 1..1 or 0..1 sample
+ <references>
+ <v:stockQuote>StockQuoteComponent</v:stockquote> - type must be URI
+ </references>
+ a multiplicity 1..n or 0..n sample
+ <references>
+ <v:stockQuote>StockQuoteComponent1</v:stockQuote> - type must be URI
+ <v:stockQuote>StockQuoteComponent2</v:stockQuote>
+ </references>
+ -->
+
+ <element name="implementation" type="sca:Implementation"/>
+ <complexType name="Implementation"/>
+
+ <complexType name="PropertyValues">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="ReferenceValues">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <complexType name="ExternalService">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:interface"/>
+ <element minOccurs="0" maxOccurs="unbounded" ref="sca:binding"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="overridable" type="sca:OverrideOptions" default="may" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+
+ <complexType name="ModuleWire">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:source.uri"/>
+ <element minOccurs="1" maxOccurs="1" ref="sca:target.uri"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <element name="source" type="anyType"/>
+ <element name="target" type="anyType"/>
+
+ <element name="source.uri" type="anyURI" substitutionGroup="sca:source"/>
+ <element name="target.uri" type="anyURI" substitutionGroup="sca:target"/>
+
+ <element name="subsystem" type="sca:Subsystem"/>
+ <complexType name="Subsystem">
+ <sequence>
+ <element minOccurs="0" maxOccurs="unbounded" name="entryPoint" type="sca:EntryPoint"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="moduleComponent" type="sca:ModuleComponent"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="externalService" type="sca:ExternalService"/>
+ <element minOccurs="0" maxOccurs="unbounded" name="wire" type="sca:SystemWire"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="uri" type="anyURI" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="ModuleComponent">
+ <sequence>
+ <element minOccurs="0" maxOccurs="1" name="properties" type="sca:PropertyValues"/>
+ <element minOccurs="0" maxOccurs="1" name="references" type="sca:ReferenceValues"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="module" type="NCName" use="required"/>
+ <attribute name="uri" type="anyURI" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </complexType>
+
+ <complexType name="SystemWire">
+ <sequence>
+ <element minOccurs="1" maxOccurs="1" ref="sca:source"/>
+ <element minOccurs="1" maxOccurs="1" ref="sca:target"/>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ </complexType>
+
+ <element name="source.epr" type="anyType" substitutionGroup="sca:source"/>
+ <element name="target.epr" type="anyType" substitutionGroup="sca:target"/>
+
+ <simpleType name="Multiplicity">
+ <restriction base="string">
+ <enumeration value="0..1"/>
+ <enumeration value="1..1"/>
+ <enumeration value="0..n"/>
+ <enumeration value="1..n"/>
+ </restriction>
+ </simpleType>
+
+ <simpleType name="OverrideOptions">
+ <restriction base="string">
+ <enumeration value="no"/>
+ <enumeration value="may"/>
+ <enumeration value="must"/>
+ </restriction>
+ </simpleType>
+
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-implementation-java.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-implementation-java.xsd
new file mode 100644
index 0000000000..1395086cc5
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-implementation-java.xsd
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="implementation.java" type="sca:JavaImplementation" substitutionGroup="sca:implementation"/>
+ <complexType name="JavaImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="class" type="NCName" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-java.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-java.xsd
new file mode 100644
index 0000000000..113176a545
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-java.xsd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="interface.java" type="sca:JavaInterface" substitutionGroup="sca:interface"/>
+ <complexType name="JavaInterface">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="interface" type="NCName" use="required"/>
+ <attribute name="callbackInterface" type="NCName" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-wsdl.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-wsdl.xsd
new file mode 100644
index 0000000000..5114c8db06
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca-interface-wsdl.xsd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <element name="interface.wsdl" type="sca:WSDLPortType" substitutionGroup="sca:interface"/>
+ <complexType name="WSDLPortType">
+ <complexContent>
+ <extension base="sca:Interface">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="interface" type="anyURI" use="required"/>
+ <attribute name="callbackInterface" type="anyURI" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca.xsd b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca.xsd
new file mode 100644
index 0000000000..62b1c265d0
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/main/resources/schemas/sca.xsd
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.osoa.org/xmlns/sca/0.9"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/0.9">
+
+ <include schemaLocation="sca-core.xsd"/>
+
+ <include schemaLocation="sca-interface-java.xsd"/>
+ <include schemaLocation="sca-interface-wsdl.xsd"/>
+
+ <include schemaLocation="sca-implementation-java.xsd"/>
+
+ <include schemaLocation="sca-binding-webservice.xsd"/>
+ <include schemaLocation="sca-binding-sca.xsd"/>
+
+</schema>
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java b/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java
new file mode 100644
index 0000000000..c4506713f6
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import junit.framework.TestCase;
+import org.osoa.sca.annotations.usage.CallbackType;
+
+/**
+ * Test case for callback annotation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CallbackTestCase extends TestCase {
+ private Class<?> type;
+ private Field field;
+ private Method method;
+
+ /**
+ * Test annotation of a callback interface.
+ */
+ public void testTypeDeclaration() {
+ assertTrue(type.isAnnotationPresent(Callback.class));
+ Callback callback = type.getAnnotation(Callback.class);
+ assertEquals(Object.class, callback.value());
+ }
+
+ /**
+ * Test annotation of a private field.
+ */
+ public void testField() {
+ assertTrue(field.isAnnotationPresent(Callback.class));
+ Callback callback = field.getAnnotation(Callback.class);
+ assertEquals(Void.class, callback.value());
+ }
+
+ /**
+ * Test annotation of a method.
+ */
+ public void testMethod() {
+ assertTrue(method.isAnnotationPresent(Callback.class));
+ Callback callback = method.getAnnotation(Callback.class);
+ assertEquals(Void.class, callback.value());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ type = CallbackType.class;
+ field = type.getDeclaredField("cbField");
+ method = type.getMethod("cbMethod");
+ }
+}
diff --git a/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java b/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java
new file mode 100644
index 0000000000..962c7bef51
--- /dev/null
+++ b/tags/java/spec/sca/1.0-incubator-M2/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.osoa.sca.annotations.usage;
+
+import org.osoa.sca.annotations.Callback;
+
+/**
+ * Mock object for callback annotation tests.
+ *
+ * @version $Rev$ $Date$
+ */
+@Callback(Object.class)
+public class CallbackType {
+ @Callback
+ private Object cbField;
+
+ /**
+ * Site for testing annotation of a public method.
+ */
+ @Callback
+ public void cbMethod() {
+ cbField = new Object();
+ }
+
+ /**
+ * Mock method to make IDEs stop complaining.
+ *
+ * @return nothing
+ */
+ public Object getCbField() {
+ return cbField;
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/BUILDING.txt b/tags/java/spec/sdo/1.0-incubator-M2/BUILDING.txt
new file mode 100644
index 0000000000..1b5cc24880
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/BUILDING.txt
@@ -0,0 +1,26 @@
+Building the SDO Java Specification Project from the source distribution
+=========================================================================
+(note, these instructions are for building the SDO binary release from
+source, not for establishing a development environment. If you wish to
+participate in sdo development, follow the instructions at
+http://incubator.apache.org/tuscany/java_sdo_overview.html)
+
+Initial Setup
+-------------
+
+1) Install J2SE JDK 1.4.2 or above
+2) Install Maven:
+Download Maven 2.0.4 (download from http://maven.apache.org/download.html).
+
+
+
+Building
+--------
+
+1) Change to the top level directory of the Tuscany SDO Java Spec project (sdo-api) of this source distribution.
+2) Execute: mvn
+This will build an artefact in your local maven repository that the SDO implementation can use.
+
+Note: Depending on the load being experienced by remote Maven 2.0 repositories you may have to execute mvn several times
+ until required dependencies are all located in your local maven repository. After you have completed a full successful
+ build you can use "mvn -o" which is much faster.
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/LICENSE.txt b/tags/java/spec/sdo/1.0-incubator-M2/LICENSE.txt
new file mode 100644
index 0000000000..1f4c1af73a
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/LICENSE.txt
@@ -0,0 +1,240 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+
+
+===============================================================================================================
+
+
+License for the Service Data Objects JavaDoc and Interface Definition files.
+
+Permission to copy, make derivative works of, and distribute the Service Data Objects
+JavaDoc and Interface Definition Files files in any medium without fee or royalty as part
+of a compliant implementation of the Service Data Objects Specification is hereby granted.
+The Service Data Objects Specification may be found at any of the following locations:
+
+http://dev2dev.bea.com/technologies/commonj/index.jsp
+http://www.ibm.com/developerworks/library/specification/ws-sdo/
+http://oracle.com/technology/webservices/sca
+https://www.sdn.sap.com/
+http://www.xcalia/xdn/specs/sdo
+
+THE SERVICE DATA OBJECTS SPECIFICATION AND THE JAVADOC AND INTERFACE DEFINITION FILES
+ARE PROVIDED "AS IS," AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS
+SPECIFICATION OR THE JAVADOC AND INTERFACE DEFINITION FILES AND THE IMPLEMENTATION OF THEIR CONTENTS,
+INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
+NON-INFRINGEMENT OR TITLE. THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
+INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY USE OR DISTRIBUTION OF THE
+SERVICE DATA OBJECTS SPECIFICATION OR THE JAVADOC OR INTERFACE DEFINTION FILES.
+
+The name and trademarks of the Authors may NOT be used in any manner, including advertising or
+publicity pertaining to the Service Component Architecture Specification or its contents without specific,
+written prior permission. Title to copyright in the Service Data Objects Specification and the
+JavaDoc and Interface Definition Files will at all times remain with the Authors.
+
+No other rights are granted by implication, estoppel or otherwise.
+
+
+
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/NOTICE.txt b/tags/java/spec/sdo/1.0-incubator-M2/NOTICE.txt
new file mode 100644
index 0000000000..32e5f84d1c
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/NOTICE.txt
@@ -0,0 +1,33 @@
+Apache Tuscany SDO for Java
+Copyright 2006 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Apache Tuscany is an effort undergoing incubation at The Apache Software Foundation (ASF),
+sponsored by the Apache Web Services PMC. Incubation is required of all newly accepted
+projects until a further review indicates that the infrastructure, communications,
+and decision making process have stabilized in a manner consistent with other successful
+ASF projects. While incubation status is not necessarily a reflection of the completeness
+or stability of the code, it does indicate that the project has yet to be fully endorsed
+by the ASF.
+
+Unless otherwise indicated, all distribution made available by the Apache Software Foundation
+is provided to you under the terms and conditions of the Apache License Version 2.0 ("AL").
+A copy of the AL is provided with this distribution as the LICENSE.txt file present in the
+root directory, and is also available at http://www.apache.org/licenses/.
+
+The terms and conditions governing the distribution may refer to the AL or other license
+agreements, notices or terms and conditions. Some of these other license agreements may
+include (but are not limited to):
+
+ . Eclipse Public License Version 1.0 (available at http://www.eclipse.org/legal/epl-v10.html)
+ . Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)
+
+It is your obligation to read and accept all such terms and conditions prior to use of the
+distribution. If term or condition is provided, please contact the Apache Software Foundation
+to determine what terms and conditions govern that particular distribution.
+
+This product also includes software developed by the Open Service Oriented Architecture organisation
+(http://osoa.org). The license for this software may be found in the LICENSE.txt file contained in this
+distribution.
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/STATUS.txt b/tags/java/spec/sdo/1.0-incubator-M2/STATUS.txt
new file mode 100644
index 0000000000..ae734dfa96
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/STATUS.txt
@@ -0,0 +1,75 @@
+Apache Tuscany Status
+
+Tuscany provides multiple language implementations of the Service Component Architecture (SCA) specifications and related technologies such as SDO.
+
+PROJECT STATUS
+==============
+
+ Tuscany is being incubated at the request of the Apache Web Services PMC.
+ For information on incubation please visit the project page at
+ http://incubator.apache.org/projects/tuscany.html
+
+
+Pending Issues
+==============
+none
+
+RESOLVED ISSUES SINCE LAST STATUS
+=================================
+2005-12-28 CCLA received for IBM's contribution of a C++ implementation
+2005-12-28 CCLA received for BEA and IBM joint contribution of a Java implementation
+
+OTHER NEWS
+==========
+
+2006-10-19 Voted to release pom and buildtools for Java M2 release
+2006-09-29 Vote to add Ignacio Silva-Lepe as a new committer
+2006-09-18 Vote to add Venkata Krishnan as a new committer
+2006-08-10 Vote to add Andrew Borley as a new committer
+2006-08-07 Vote to add Meeraj Kunnumpurath as a new committer
+2006-08-07 Vote to add Kelvin Goodson as a new committer
+2006-08-06 Vote to add Brent Daniel as a new committer
+2006-08-04 Vote to add Raymond Feng as a new committer
+2006-08-01 C++ Milestone 1 release
+2006-06-07 Java Milestone 1 release
+2006-05-02 Vote to add Dan Kulp as a new committer
+
+2006-01-05 Contribution of Java implementation by BEA and IBM committed
+2006-01-05 Contribution of C+ implementation by IBM committed
+
+RELEASE STATUS
+==============
+None
+
+REFERENCES
+==========
+Status file http://svn.apache.org/repos/asf/incubator/tuscany/STATUS
+User List tuscany-user@ws.apache.org
+Developer List tuscany-dev@ws.apache.org
+Commits List tuscany-commits@ws.apache.org
+Source Code http://svn.apache.org/repos/asf/incubator/tuscany/
+Issue Tracking http://issues.apache.org/jira/browse/TUSCANY
+
+Committers
+ ajborley Andrew Borley
+ antelder Ant Elder
+ bdaniel Brent Daniel
+ dkulp Dan Kulp
+ dims Davanum Srinivas
+ edslattery Ed Slattery
+ ekoneil Eddie O'Neil
+ frankb Frank Budinsky
+ geirm Geir Magnusson Jr
+ isilval Ignacio Silva-Lepe
+ jsdelfino Jean-Sebastien Delfino
+ jboynes Jeremy Boynes
+ jmarino Jim Marino
+ kelvingoodson Kelvin Goodson
+ kentam Ken Tam
+ kwilliams Kevin Williams
+ edwardsmj Mike Edwards
+ meerajk Meeraj Kunnumpurath
+ rfeng Raymond Feng
+ robbinspg Pete Robbins
+ rineholt Rick Rineholt
+ svkrish Venkata Krishnan \ No newline at end of file
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/pom.xml b/tags/java/spec/sdo/1.0-incubator-M2/pom.xml
new file mode 100644
index 0000000000..54ebc69e3e
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany</groupId>
+ <artifactId>parent</artifactId>
+ <version>1-incubator</version>
+ </parent>
+ <groupId>commonj</groupId>
+ <artifactId>sdo-api-r${specVersion}</artifactId>
+ <packaging>osgi-bundle</packaging>
+ <version>1.0-incubator-M2</version>
+ <name>SDO API</name>
+ <description>API classes for Service Data Objects</description>
+
+ <properties>
+ <specVersion>2.0.1</specVersion>
+ </properties>
+
+ <!-- definition of repositories where the parent pom can be found -->
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <id>apache.incubator</id>
+ <name>Apache Incubator Repository</name>
+ <url>http://people.apache.org/repo/m2-incubating-repository/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix.plugins</groupId>
+ <artifactId>maven-osgi-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <osgiManifest>
+ <bundleName>${pom.name}</bundleName>
+ <bundleDescription>${pom.description}</bundleDescription>
+ <bundleVendor>${pom.organization.name}</bundleVendor>
+ <bundleLocalization>plugin</bundleLocalization>
+ <bundleSymbolicName>commonj.sdo</bundleSymbolicName>
+ <exportPackage>commonj.sdo;version="${specVersion}", commonj.sdo.helper;version="${specVersion}, commonj.sdo.impl;version="${specVersion}"</exportPackage>
+ </osgiManifest>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <version>2.0</version>
+ </configuration>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <defaultGoal>install</defaultGoal>
+ </build>
+</project>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/ChangeSummary.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/ChangeSummary.java
new file mode 100644
index 0000000000..3eeacf4c01
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/ChangeSummary.java
@@ -0,0 +1,204 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A change summary is used to record changes to DataObjects,
+ * allowing applications to efficiently and incrementally update back-end storage when required.
+ */
+public interface ChangeSummary
+{
+ /**
+ * Indicates whether change logging is on (<code>true</code>) or off (<code>false</code>).
+ * @return <code>true</code> if change logging is on.
+ * @see #beginLogging
+ * @see #endLogging
+ */
+ boolean isLogging();
+
+ /**
+ * Returns the {@link DataGraph data graph} associated with this change summary or null.
+ * @return the data graph.
+ * @see DataGraph#getChangeSummary
+ */
+ DataGraph getDataGraph();
+
+ /**
+ * Returns a list consisting of all the {@link DataObject data objects} that have been changed while {@link #isLogging logging}.
+ * <p>
+ * The {@link #isCreated new} and {@link #isModified modified} objects in the List are references to objects
+ * associated with this ChangeSummary.
+ * The {@link #isDeleted deleted} objects in the List are references to objects
+ * at the time that event logging was enabled;
+ * <p> Each changed object must have exactly one of the following methods return true:
+ * {@link #isCreated isCreated},
+ * {@link #isDeleted isDeleted}, or
+ * {@link #isModified isModified}.
+ * @return a list of changed data objects.
+ * @see #isCreated(DataObject)
+ * @see #isDeleted(DataObject)
+ * @see #isModified(DataObject)
+ */
+ List /*DataObject*/ getChangedDataObjects();
+
+ /**
+ * Returns whether or not the specified data object was created while {@link #isLogging logging}.
+ * Any object that was added to the scope
+ * but was not in the scope when logging began,
+ * will be considered created.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was created.
+ * @see #getChangedDataObjects
+ */
+ boolean isCreated(DataObject dataObject);
+
+ /**
+ * Returns whether or not the specified data object was deleted while {@link #isLogging logging}.
+ * Any object that is not in scope but was in scope when logging began
+ * will be considered deleted.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was deleted.
+ * @see #getChangedDataObjects
+ */
+ boolean isDeleted(DataObject dataObject);
+
+ /**
+ * A setting encapsulates a {@link Property property} and a corresponding single value of the property's {@link Property#getType type}.
+ */
+ public interface Setting
+ {
+ /**
+ * Returns the property of the setting.
+ * @return the setting property.
+ */
+ Property getProperty();
+
+ /**
+ * Returns the value of the setting.
+ * @return the setting value.
+ */
+ Object getValue();
+
+ /**
+ * Returns whether or not the property is set.
+ * @return <code>true</code> if the property is set.
+ */
+ boolean isSet();
+ }
+
+ /**
+ * Returns a list of {@link ChangeSummary.Setting settings}
+ * that represent the property values of the given <code>dataObject</code>
+ * at the point when logging {@link #beginLogging() began}.
+ * <p>In the case of a {@link #isDeleted(DataObject) deleted} object,
+ * the List will include settings for all the Properties.
+ * <p> An old value setting indicates the value at the
+ * point logging begins. A setting is only produced for
+ * {@link #isModified modified} objects if
+ * either the old value differs from the current value or
+ * if the isSet differs from the current value.
+ * <p> No settings are produced for {@link #isCreated created} objects.
+ * @param dataObject the object in question.
+ * @return a list of settings.
+ * @see #getChangedDataObjects
+ */
+ List /*ChangeSummary.Setting*/ getOldValues(DataObject dataObject);
+
+ /**
+ * Clears the List of {@link #getChangedDataObjects changes} and turns change logging on.
+ * No operation occurs if logging is already on.
+ * @see #endLogging
+ * @see #isLogging
+ */
+ void beginLogging();
+
+ /**
+ * An implementation that requires logging may throw an UnsupportedOperationException.
+ * Turns change logging off. No operation occurs if logging is already off.
+ * @see #beginLogging
+ * @see #isLogging
+ */
+ void endLogging();
+
+
+ /**
+ * Returns whether or not the specified data object was updated while {@link #isLogging logging}.
+ * An object that was contained in the scope when logging began
+ * and remains in the scope when logging ends will be considered potentially modified.
+ * <p> An object considered modified must have at least one old value setting.
+ * @param dataObject the data object in question.
+ * @return <code>true</code> if the specified data object was modified.
+ * @see #getChangedDataObjects
+ */
+ boolean isModified(DataObject dataObject);
+
+ /**
+ * Returns the ChangeSummary root DataObject - the object from which
+ * changes are tracked.
+ * When a DataGraph is used, this is the same as getDataGraph().getRootObject().
+ * @return the ChangeSummary root DataObject
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns a {@link ChangeSummary.Setting setting} for the specified property
+ * representing the property value of the given <code>dataObject</code>
+ * at the point when logging {@link #beginLogging() began}.
+ * <p>Returns null if the property was not modified and
+ * has not been {@link #isDeleted(DataObject) deleted}.
+ * @param dataObject the object in question.
+ * @param property the property of the object.
+ * @return the Setting for the specified property.
+ * @see #getChangedDataObjects
+ */
+ Setting getOldValue(DataObject dataObject, Property property);
+
+ /**
+ * Returns the value of the {@link DataObject#getContainer container} data object
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old container data object.
+ */
+ DataObject getOldContainer(DataObject dataObject);
+
+ /**
+ * Returns the value of the {@link DataObject#getContainmentProperty containment property} data object property
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old containment property.
+ */
+ Property getOldContainmentProperty(DataObject dataObject);
+
+ /**
+ * Returns the value of the {@link DataObject#getSequence sequence} for the data object
+ * at the point when logging {@link #beginLogging() began}.
+ * @param dataObject the object in question.
+ * @return the old containment property.
+ */
+ Sequence getOldSequence(DataObject dataObject);
+
+ /**
+ * This method is intended for use by service implementations only.
+ * Undoes all changes in the log to restore the tree of
+ * DataObjects to its original state when logging began.
+ * isLogging() is unchanged. The log is cleared.
+ * @see #beginLogging
+ * @see #endLogging
+ * @see #isLogging
+ */
+ void undoChanges();
+
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataGraph.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataGraph.java
new file mode 100644
index 0000000000..78bc7227a1
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataGraph.java
@@ -0,0 +1,73 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.io.Serializable;
+
+/**
+ * A data graph is used to package a graph of {@link DataObject data objects} along with their
+ * metadata, that is, data describing the data.
+ * A data graph also contains a {@link #getChangeSummary change summary}
+ * which is used to record changes made to the objects in the graph.
+ */
+
+public interface DataGraph extends Serializable
+{
+ /**
+ * Returns the root {@link DataObject data object} of this data graph.
+ * @return the root data object.
+ * @see DataObject#getDataGraph
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns the {@link ChangeSummary change summary} associated with this data graph.
+ * @return the change summary.
+ * @see ChangeSummary#getDataGraph
+ */
+ ChangeSummary getChangeSummary();
+
+ /**
+ * Returns the {@link Type type} with the given the {@link Type#getURI() URI},
+ * or contained by the resource at the given URI,
+ * and with the given {@link Type#getName name}.
+ * @param uri the namespace URI of a type or the location URI of a resource containing a type.
+ * @param typeName name of a type.
+ * @return the type with the corresponding namespace and name.
+ */
+ Type getType(String uri, String typeName);
+
+ /**
+ * Creates a new root data object of the {@link #getType specified type}.
+ * An exception is thrown if a root object exists.
+ * @param namespaceURI namespace of the type.
+ * @param typeName name of the type.
+ * @return the new root.
+ * @throws IllegalStateException if the root object already exists.
+ * @see #createRootObject(Type)
+ * @see #getType(String, String)
+ */
+ DataObject createRootObject(String namespaceURI, String typeName);
+
+ /**
+ * Creates a new root data object of the specified type.
+ * An exception is thrown if a root object exists.
+ * @param type the type of the new root.
+ * @return the new root.
+ * @throws IllegalStateException if the root object already exists.
+ * @see #createRootObject(String, String)
+ */
+ DataObject createRootObject(Type type);
+
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataObject.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataObject.java
new file mode 100644
index 0000000000..8a1819f475
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/DataObject.java
@@ -0,0 +1,1105 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * A data object is a representation of some structured data.
+ * It is the fundamental component in the SDO (Service Data Objects) package.
+ * Data objects support reflection, path-based accesss, convenience creation and deletion methods,
+ * and the ability to be part of a {@link DataGraph data graph}.
+ * <p>
+ * Each data object holds its data as a series of {@link Property Properties}.
+ * Properties can be accessed by name, property index, or using the property meta object itself.
+ * A data object can also contain references to other data objects, through reference-type Properties.
+ * <p>
+ * A data object has a series of convenience accessors for its Properties.
+ * These methods either use a path (String),
+ * a property index,
+ * or the {@link Property property's meta object} itself, to identify the property.
+ * Some examples of the path-based accessors are as follows:
+ *<pre>
+ * DataObject company = ...;
+ * company.get("name"); is the same as company.get(company.getType().getProperty("name"))
+ * company.set("name", "acme");
+ * company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name")
+ * .n indexes from 0 ... implies the name property of the first department
+ * company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department
+ * company.get("department[number=123]") returns the first department where number=123
+ * company.get("..") returns the containing data object
+ * company.get("/") returns the root containing data object
+ *</pre>
+ * <p> There are general accessors for Properties, i.e., {@link #get(Property) get} and {@link #set(Property, Object) set},
+ * as well as specific accessors for the primitive types and commonly used data types like
+ * String, Date, List, BigInteger, and BigDecimal.
+ */
+public interface DataObject extends Serializable
+{
+ /**
+ * Returns the value of a property of either this object or an object reachable from it, as identified by the
+ * specified path.
+ * @param path the path to a valid object and property.
+ * @return the value of the specified property.
+ * @see #get(Property)
+ */
+ Object get(String path);
+
+ /**
+ * Sets a property of either this object or an object reachable from it, as identified by the specified path,
+ * to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void set(String path, Object value);
+
+ /**
+ * Returns whether a property of either this object or an object reachable from it, as identified by the specified path,
+ * is considered to be set.
+ * @param path the path to a valid object and property.
+ * @see #isSet(Property)
+ */
+ boolean isSet(String path);
+
+ /**
+ * Unsets a property of either this object or an object reachable from it, as identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @see #unset(Property)
+ */
+ void unset(String path);
+
+ /**
+ * Returns the value of a <code>boolean</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(String)
+ */
+ boolean getBoolean(String path);
+
+ /**
+ * Returns the value of a <code>byte</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(String)
+ */
+ byte getByte(String path);
+
+ /**
+ * Returns the value of a <code>char</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(String)
+ */
+ char getChar(String path);
+
+ /**
+ * Returns the value of a <code>double</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(String)
+ */
+ double getDouble(String path);
+
+ /**
+ * Returns the value of a <code>float</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(String)
+ */
+ float getFloat(String path);
+
+ /**
+ * Returns the value of a <code>int</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(String)
+ */
+ int getInt(String path);
+
+ /**
+ * Returns the value of a <code>long</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(String)
+ */
+ long getLong(String path);
+
+ /**
+ * Returns the value of a <code>short</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(String)
+ */
+ short getShort(String path);
+
+ /**
+ * Returns the value of a <code>byte[]</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(String)
+ */
+ byte[] getBytes(String path);
+
+ /**
+ * Returns the value of a <code>BigDecimal</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(String)
+ */
+ BigDecimal getBigDecimal(String path);
+
+ /**
+ * Returns the value of a <code>BigInteger</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(String)
+ */
+ BigInteger getBigInteger(String path);
+
+ /**
+ * Returns the value of a <code>DataObject</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(String)
+ */
+ DataObject getDataObject(String path);
+
+ /**
+ * Returns the value of a <code>Date</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(String)
+ */
+ Date getDate(String path);
+
+ /**
+ * Returns the value of a <code>String</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(String)
+ */
+ String getString(String path);
+
+ /**
+ * Returns the value of a <code>List</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(String)
+ */
+ List getList(String path);
+
+ /**
+ * Returns the value of a <code>Sequence</code> property identified by the specified path.
+ * @param path the path to a valid object and property.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(String)
+ */
+ Sequence getSequence(String path);
+
+ /**
+ * Sets the value of a <code>boolean</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBoolean(String path, boolean value);
+
+ /**
+ * Sets the value of a <code>byte</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setByte(String path, byte value);
+
+ /**
+ * Sets the value of a <code>char</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setChar(String path, char value);
+
+ /**
+ * Sets the value of a <code>double</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDouble(String path, double value);
+
+ /**
+ * Sets the value of a <code>float</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setFloat(String path, float value);
+
+ /**
+ * Sets the value of a <code>int</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setInt(String path, int value);
+
+ /**
+ * Sets the value of a <code>long</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setLong(String path, long value);
+
+ /**
+ * Sets the value of a <code>short</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setShort(String path, short value);
+
+ /**
+ * Sets the value of a <code>byte[]</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBytes(String path, byte[] value);
+
+ /**
+ * Sets the value of a <code>BigDecimal</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBigDecimal(String path, BigDecimal value);
+
+ /**
+ * Sets the value of a <code>BigInteger</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setBigInteger(String path, BigInteger value);
+
+ /**
+ * Sets the value of a <code>DataObject</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDataObject(String path, DataObject value);
+
+ /**
+ * Sets the value of a <code>Date</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setDate(String path, Date value);
+
+ /**
+ * Sets the value of a <code>String</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ */
+ void setString(String path, String value);
+
+ /**
+ * Sets the value of a <code>List</code> property identified by the specified path, to the specified value.
+ * @param path the path to a valid object and property.
+ * @param value the new value for the property.
+ * @see #set(String, Object)
+ * @see #setList(Property, List)
+ */
+ void setList(String path, List value);
+
+ /**
+ * Returns the value of the property at the specified index in {@link Type#getProperties property list}
+ * of this object's {@link Type type}.
+ * @param propertyIndex the index of the property.
+ * @return the value of the specified property.
+ * @see #get(Property)
+ */
+ Object get(int propertyIndex);
+
+ /**
+ * Sets the property at the specified index in {@link Type#getProperties property list} of this object's
+ * {@link Type type}, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void set(int propertyIndex, Object value);
+
+ /**
+ * Returns whether the the property at the specified index in {@link Type#getProperties property list} of this object's
+ * {@link Type type}, is considered to be set.
+ * @param propertyIndex the index of the property.
+ * @return whether the specified property is set.
+ * @see #isSet(Property)
+ */
+ boolean isSet(int propertyIndex);
+
+ /**
+ * Unsets the property at the specified index in {@link Type#getProperties property list} of this object's {@link Type type}.
+ * @param propertyIndex the index of the property.
+ * @see #unset(Property)
+ */
+ void unset(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>boolean</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(int)
+ */
+ boolean getBoolean(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>byte</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(int)
+ */
+ byte getByte(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>char</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(int)
+ */
+ char getChar(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>double</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(int)
+ */
+ double getDouble(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>float</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(int)
+ */
+ float getFloat(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>int</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(int)
+ */
+ int getInt(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>long</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(int)
+ */
+ long getLong(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>short</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(int)
+ */
+ short getShort(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>byte[]</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(int)
+ */
+ byte[] getBytes(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>BigDecimal</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(int)
+ */
+ BigDecimal getBigDecimal(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>BigInteger</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(int)
+ */
+ BigInteger getBigInteger(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>DataObject</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(int)
+ */
+ DataObject getDataObject(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>Date</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(int)
+ */
+ Date getDate(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>String</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(int)
+ */
+ String getString(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>List</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(int)
+ */
+ List getList(int propertyIndex);
+
+ /**
+ * Returns the value of a <code>Sequence</code> property identified by the specified property index.
+ * @param propertyIndex the index of the property.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(int)
+ */
+ Sequence getSequence(int propertyIndex);
+
+ /**
+ * Sets the value of a <code>boolean</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBoolean(int propertyIndex, boolean value);
+
+ /**
+ * Sets the value of a <code>byte</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setByte(int propertyIndex, byte value);
+
+ /**
+ * Sets the value of a <code>char</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setChar(int propertyIndex, char value);
+
+ /**
+ * Sets the value of a <code>double</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDouble(int propertyIndex, double value);
+
+ /**
+ * Sets the value of a <code>float</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setFloat(int propertyIndex, float value);
+
+ /**
+ * Sets the value of a <code>int</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setInt(int propertyIndex, int value);
+
+ /**
+ * Sets the value of a <code>long</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setLong(int propertyIndex, long value);
+
+ /**
+ * Sets the value of a <code>short</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setShort(int propertyIndex, short value);
+
+ /**
+ * Sets the value of a <code>byte[]</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBytes(int propertyIndex, byte[] value);
+
+ /**
+ * Sets the value of a <code>BigDecimal</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBigDecimal(int propertyIndex, BigDecimal value);
+
+ /**
+ * Sets the value of a <code>BigInteger</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setBigInteger(int propertyIndex, BigInteger value);
+
+ /**
+ * Sets the value of a <code>DataObject</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDataObject(int propertyIndex, DataObject value);
+
+ /**
+ * Sets the value of a <code>Date</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setDate(int propertyIndex, Date value);
+
+ /**
+ * Sets the value of a <code>String</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ */
+ void setString(int propertyIndex, String value);
+
+ /**
+ * Sets the value of a <code>List</code> property identified by the specified property index, to the specified value.
+ * @param propertyIndex the index of the property.
+ * @param value the new value for the property.
+ * @see #set(int, Object)
+ * @see #setList(Property, List)
+ */
+ void setList(int propertyIndex, List value);
+
+ /**
+ * Returns the value of the given property of this object.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the result will be a {@link java.util.List}
+ * and each object in the List will be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type}.
+ * Otherwise the result will directly be an instance of the property's type.
+ * @param property the property of the value to fetch.
+ * @return the value of the given property of the object.
+ * @see #set(Property, Object)
+ * @see #unset(Property)
+ * @see #isSet(Property)
+ */
+ Object get(Property property);
+
+ /**
+ * Sets the value of the given property of the object to the new value.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the new value must be a {@link java.util.List}
+ * and each object in that list must be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type};
+ * the existing contents are cleared and the contents of the new value are added.
+ * Otherwise the new value directly must be an instance of the property's type
+ * and it becomes the new value of the property of the object.
+ * @param property the property of the value to set.
+ * @param value the new value for the property.
+ * @see #unset(Property)
+ * @see #isSet(Property)
+ * @see #get(Property)
+ */
+ void set(Property property, Object value);
+
+ /**
+ * Returns whether the property of the object is considered to be set.
+ * <p>
+ * isSet() for many-valued Properties returns true if the List is not empty and
+ * false if the List is empty. For single-valued Properties:
+ * <ul><li>If the Property has not been set() or has been unset() then isSet() returns false.</li>
+ * <li>If the current value is not the Property's default or null, isSet() returns true.</li>
+ * <li>For the remaining cases the implementation may decide between two policies: </li>
+ * <ol><li>any call to set() without a call to unset() will cause isSet() to return true, or </li>
+ * <li>the current value is compared to the default value and isSet() returns true when they differ.</li>
+ * </ol></ul><p>
+ * @param property the property in question.
+ * @return whether the property of the object is set.
+ * @see #set(Property, Object)
+ * @see #unset(Property)
+ * @see #get(Property)
+ */
+ boolean isSet(Property property);
+
+ /**
+ * Unsets the property of the object.
+ * <p>
+ * If the property is {@link Property#isMany many-valued},
+ * the value must be an {@link java.util.List}
+ * and that list is cleared.
+ * Otherwise,
+ * the value of the property of the object
+ * is set to the property's {@link Property#getDefault default value}.
+ * The property will no longer be considered {@link #isSet set}.
+ * @param property the property in question.
+ * @see #isSet(Property)
+ * @see #set(Property, Object)
+ * @see #get(Property)
+ */
+ void unset(Property property);
+
+ /**
+ * Returns the value of the specified <code>boolean</code> property.
+ * @param property the property to get.
+ * @return the <code>boolean</code> value of the specified property.
+ * @see #get(Property)
+ */
+ boolean getBoolean(Property property);
+
+ /**
+ * Returns the value of the specified <code>byte</code> property.
+ * @param property the property to get.
+ * @return the <code>byte</code> value of the specified property.
+ * @see #get(Property)
+ */
+ byte getByte(Property property);
+
+ /**
+ * Returns the value of the specified <code>char</code> property.
+ * @param property the property to get.
+ * @return the <code>char</code> value of the specified property.
+ * @see #get(Property)
+ */
+ char getChar(Property property);
+
+ /**
+ * Returns the value of the specified <code>double</code> property.
+ * @param property the property to get.
+ * @return the <code>double</code> value of the specified property.
+ * @see #get(Property)
+ */
+ double getDouble(Property property);
+
+ /**
+ * Returns the value of the specified <code>float</code> property.
+ * @param property the property to get.
+ * @return the <code>float</code> value of the specified property.
+ * @see #get(Property)
+ */
+ float getFloat(Property property);
+
+ /**
+ * Returns the value of the specified <code>int</code> property.
+ * @param property the property to get.
+ * @return the <code>int</code> value of the specified property.
+ * @see #get(Property)
+ */
+ int getInt(Property property);
+
+ /**
+ * Returns the value of the specified <code>long</code> property.
+ * @param property the property to get.
+ * @return the <code>long</code> value of the specified property.
+ * @see #get(Property)
+ */
+ long getLong(Property property);
+
+ /**
+ * Returns the value of the specified <code>short</code> property.
+ * @param property the property to get.
+ * @return the <code>short</code> value of the specified property.
+ * @see #get(Property)
+ */
+ short getShort(Property property);
+
+ /**
+ * Returns the value of the specified <code>byte[]</code> property.
+ * @param property the property to get.
+ * @return the <code>byte[]</code> value of the specified property.
+ * @see #get(Property)
+ */
+ byte[] getBytes(Property property);
+
+ /**
+ * Returns the value of the specified <code>BigDecimal</code> property.
+ * @param property the property to get.
+ * @return the <code>BigDecimal</code> value of the specified property.
+ * @see #get(Property)
+ */
+ BigDecimal getBigDecimal(Property property);
+
+ /**
+ * Returns the value of the specified <code>BigInteger</code> property.
+ * @param property the property to get.
+ * @return the <code>BigInteger</code> value of the specified property.
+ * @see #get(Property)
+ */
+ BigInteger getBigInteger(Property property);
+
+ /**
+ * Returns the value of the specified <code>DataObject</code> property.
+ * @param property the property to get.
+ * @return the <code>DataObject</code> value of the specified property.
+ * @see #get(Property)
+ */
+ DataObject getDataObject(Property property);
+
+ /**
+ * Returns the value of the specified <code>Date</code> property.
+ * @param property the property to get.
+ * @return the <code>Date</code> value of the specified property.
+ * @see #get(Property)
+ */
+ Date getDate(Property property);
+
+ /**
+ * Returns the value of the specified <code>String</code> property.
+ * @param property the property to get.
+ * @return the <code>String</code> value of the specified property.
+ * @see #get(Property)
+ */
+ String getString(Property property);
+
+ /**
+ * Returns the value of the specified <code>List</code> property.
+ * The List returned contains the current values.
+ * Updates through the List interface operate on the current values of the DataObject.
+ * Each access returns the same List object.
+ * @param property the property to get.
+ * @return the <code>List</code> value of the specified property.
+ * @see #get(Property)
+ */
+ List getList(Property property);
+
+ /**
+ * Returns the value of the specified <code>Sequence</code> property.
+ * @param property the property to get.
+ * @return the <code>Sequence</code> value of the specified property.
+ * @see #get(Property)
+ */
+ Sequence getSequence(Property property);
+
+ /**
+ * Sets the value of the specified <code>boolean</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBoolean(Property property, boolean value);
+
+ /**
+ * Sets the value of the specified <code>byte</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setByte(Property property, byte value);
+
+ /**
+ * Sets the value of the specified <code>char</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setChar(Property property, char value);
+
+ /**
+ * Sets the value of the specified <code>double</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDouble(Property property, double value);
+
+ /**
+ * Sets the value of the specified <code>float</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setFloat(Property property, float value);
+
+ /**
+ * Sets the value of the specified <code>int</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setInt(Property property, int value);
+
+ /**
+ * Sets the value of the specified <code>long</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setLong(Property property, long value);
+
+ /**
+ * Sets the value of the specified <code>short</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setShort(Property property, short value);
+
+ /**
+ * Sets the value of the specified <code>byte[]</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBytes(Property property, byte[] value);
+
+ /**
+ * Sets the value of the specified <code>BigDecimal</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBigDecimal(Property property, BigDecimal value);
+
+ /**
+ * Sets the value of the specified <code>BigInteger</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setBigInteger(Property property, BigInteger value);
+
+ /**
+ * Sets the value of the specified <code>DataObject</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDataObject(Property property, DataObject value);
+
+ /**
+ * Sets the value of the specified <code>Date</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setDate(Property property, Date value);
+
+ /**
+ * Sets the value of the specified <code>String</code> property, to the specified value.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setString(Property property, String value);
+
+ /**
+ * Sets the value of the specified <code>List</code> property, to the specified value.
+ * <p> The new value must be a {@link java.util.List}
+ * and each object in that list must be {@link Type#isInstance an instance of}
+ * the property's {@link Property#getType type};
+ * the existing contents are cleared and the contents of the new value are added.
+ * @param property the property to set.
+ * @param value the new value for the property.
+ * @see #set(Property, Object)
+ */
+ void setList(Property property, List value);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param propertyName the name of the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(String, String, String)
+ */
+ DataObject createDataObject(String propertyName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param propertyIndex the index of the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(int, String, String)
+ */
+ DataObject createDataObject(int propertyIndex);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is the {@link Property#getType declared type} of the specified property.
+ * @param property the specified containment property.
+ * @return the created data object.
+ * @see #createDataObject(Property, Type)
+ */
+ DataObject createDataObject(Property property);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is specified by the packageURI and typeName arguments.
+ * The specified type must be a compatible target for the property identified by propertyName.
+ * @param propertyName the name of the specified containment property.
+ * @param namespaceURI the namespace URI of the package containing the type of object to be created.
+ * @param typeName the name of a type in the specified package.
+ * @return the created data object.
+ * @see #createDataObject(String)
+ * @see DataGraph#getType
+ */
+ DataObject createDataObject(String propertyName, String namespaceURI, String typeName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be a {@link Property#isContainment containment property}.
+ * The type of the created object is specified by the packageURI and typeName arguments.
+ * The specified type must be a compatible target for the property identified by propertyIndex.
+ * @param propertyIndex the index of the specified containment property.
+ * @param namespaceURI the namespace URI of the package containing the type of object to be created.
+ * @param typeName the name of a type in the specified package.
+ * @return the created data object.
+ * @see #createDataObject(int)
+ * @see DataGraph#getType
+ */
+ DataObject createDataObject(int propertyIndex, String namespaceURI, String typeName);
+
+ /**
+ * Returns a new {@link DataObject data object} contained by this object using the specified property,
+ * which must be of {@link Property#isContainment containment type}.
+ * The type of the created object is specified by the type argument,
+ * which must be a compatible target for the speicifed property.
+ * @param property a containment property of this object.
+ * @param type the type of object to be created.
+ * @return the created data object.
+ * @see #createDataObject(int)
+ */
+ DataObject createDataObject(Property property, Type type);
+
+ /**
+ * Remove this object from its container and then unset all its non-{@link Property#isReadOnly readOnly} Properties.
+ * If this object is contained by a {@link Property#isReadOnly readOnly} {@link Property#isContainment containment property}, its non-{@link Property#isReadOnly readOnly} Properties will be unset but the object will not be removed from its container.
+ * All DataObjects recursively contained by {@link Property#isContainment containment Properties} will also be deleted.
+ */
+ void delete();
+
+ /**
+ * Returns the containing {@link DataObject data object}
+ * or <code>null</code> if there is no container.
+ * @return the containing data object or <code>null</code>.
+ */
+ DataObject getContainer();
+
+ /**
+ * Return the Property of the {@link DataObject data object} containing this data object
+ * or <code>null</code> if there is no container.
+ * @return the property containing this data object.
+ */
+ Property getContainmentProperty();
+
+ /**
+ * Returns the {@link DataGraph data graph} for this object or <code>null</code> if there isn't one.
+ * @return the containing data graph or <code>null</code>.
+ */
+ DataGraph getDataGraph();
+
+ /**
+ * Returns the data object's type.
+ * <p>
+ * The type defines the Properties available for reflective access.
+ * @return the type.
+ */
+ Type getType();
+
+ /**
+ * Returns the <code>Sequence</code> for this DataObject.
+ * When getType().isSequencedType() == true,
+ * the Sequence of a DataObject corresponds to the
+ * XML elements representing the values of its Properties.
+ * Updates through DataObject and the Lists or Sequences returned
+ * from DataObject operate on the same data.
+ * When getType().isSequencedType() == false, null is returned.
+ * @return the <code>Sequence</code> or null.
+ */
+ Sequence getSequence();
+
+ /**
+ * Returns a read-only List of the Properties currently used in this DataObject.
+ * This list will contain all of the Properties in getType().getProperties()
+ * and any Properties where isSet(property) is true.
+ * For example, Properties resulting from the use of
+ * open or mixed XML content are present if allowed by the Type.
+ * the List does not contain duplicates.
+ * The order of the Properties in the List begins with getType().getProperties()
+ * and the order of the remaining Properties is determined by the implementation.
+ * The same list will be returned unless the DataObject is updated so that
+ * the contents of the List change.
+ * @return the List of Properties currently used in this DataObject.
+ */
+ List /* Property */ getInstanceProperties();
+
+ /**
+ * Returns the named Property from the current instance properties,
+ * or null if not found. The instance properties are getInstanceProperties().
+ * @param propertyName the name of the Property
+ * @return the named Property from the DataObject's current instance properties, or null.
+ */
+ Property getProperty(String propertyName);
+
+ /**
+ * Returns the root {@link DataObject data object}.
+ * @return the root data object.
+ */
+ DataObject getRootObject();
+
+ /**
+ * Returns the ChangeSummary with scope covering this dataObject, or null
+ * if there is no ChangeSummary.
+ * @return the ChangeSummary with scope covering this dataObject, or null.
+ */
+ ChangeSummary getChangeSummary();
+
+ /**
+ * Removes this DataObject from its container, if any.
+ * Same as
+ * getContainer().getList(getContainmentProperty()).remove(this) or
+ * getContainer().unset(getContainmentProperty())
+ * depending on getContainmentProperty().isMany() respectively.
+ */
+ void detach();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Property.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Property.java
new file mode 100644
index 0000000000..cc96e90b44
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Property.java
@@ -0,0 +1,79 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A representation of a Property in the {@link Type type} of a {@link DataObject data object}.
+ */
+public interface Property
+{
+ /**
+ * Returns the name of the Property.
+ * @return the Property name.
+ */
+ String getName();
+
+ /**
+ * Returns the type of the Property.
+ * @return the Property type.
+ */
+ Type getType();
+
+ /**
+ * Returns whether the Property is many-valued.
+ * @return <code>true</code> if the Property is many-valued.
+ */
+ boolean isMany();
+
+ /**
+ * Returns whether the Property is containment, i.e., whether it represents by-value composition.
+ * @return <code>true</code> if the Property is containment.
+ */
+ boolean isContainment();
+
+ /**
+ * Returns the containing type of this Property.
+ * @return the Property's containing type.
+ * @see Type#getProperties()
+ */
+ Type getContainingType();
+
+ /**
+ * Returns the default value this Property will have in a {@link DataObject data object} where the Property hasn't been set.
+ * @return the default value.
+ */
+ Object getDefault();
+
+ /**
+ * Returns true if values for this Property cannot be modified using the SDO APIs.
+ * When true, DataObject.set(Property property, Object value) throws an exception.
+ * Values may change due to other factors, such as services operating on DataObjects.
+ * @return true if values for this Property cannot be modified.
+ */
+ boolean isReadOnly();
+
+ /**
+ * Returns the opposite Property if the Property is bi-directional or null otherwise.
+ * @return the opposite Property if the Property is bi-directional or null
+ */
+ Property getOpposite();
+
+ /**
+ * Return a list of alias names for this Property.
+ * @return a list of alias names for this Property.
+ */
+ List /*String*/ getAliasNames();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Sequence.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Sequence.java
new file mode 100644
index 0000000000..b46a5be7e0
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Sequence.java
@@ -0,0 +1,131 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+/**
+ * A sequence is a heterogeneous list of {@link Property properties} and corresponding values.
+ * It represents an ordered arbitrary mixture of data values from more than one property of a {@link DataObject data object}.
+ */
+public interface Sequence
+{
+ /**
+ * Returns the number of entries in the sequence.
+ * @return the number of entries.
+ */
+ int size();
+
+ /**
+ * Returns the property for the given entry index.
+ * Returns <code>null</code> for mixed text entries.
+ * @param index the index of the entry.
+ * @return the property or <code>null</code> for the given entry index.
+ */
+ Property getProperty(int index);
+
+ /**
+ * Returns the property value for the given entry index.
+ * @param index the index of the entry.
+ * @return the value for the given entry index.
+ */
+ Object getValue(int index);
+
+ /**
+ * Sets the entry at a specified index to the new value.
+ * @param index the index of the entry.
+ * @param value the new value for the entry.
+ */
+ Object setValue(int index, Object value);
+
+ /**
+ * Adds a new entry with the specified property name and value
+ * to the end of the entries.
+ * @param propertyName the name of the entry's property.
+ * @param value the value for the entry.
+ */
+ boolean add(String propertyName, Object value);
+
+ /**
+ * Adds a new entry with the specified property index and value
+ * to the end of the entries.
+ * @param propertyIndex the index of the entry's property.
+ * @param value the value for the entry.
+ */
+ boolean add(int propertyIndex, Object value);
+
+ /**
+ * Adds a new entry with the specified property and value
+ * to the end of the entries.
+ * @param property the property of the entry.
+ * @param value the value for the entry.
+ */
+ boolean add(Property property, Object value);
+
+ /**
+ * Adds a new entry with the specified property name and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param propertyName the name of the entry's property.
+ * @param value the value for the entry.
+ */
+ void add(int index, String propertyName, Object value);
+
+ /**
+ * Adds a new entry with the specified property index and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param propertyIndex the index of the entry's property.
+ * @param value the value for the entry.
+ */
+ void add(int index, int propertyIndex, Object value);
+
+ /**
+ * Adds a new entry with the specified property and value
+ * at the specified entry index.
+ * @param index the index at which to add the entry.
+ * @param property the property of the entry.
+ * @param value the value for the entry.
+ */
+ void add(int index, Property property, Object value);
+
+ /**
+ * Removes the entry at the given entry index.
+ * @param index the index of the entry.
+ */
+ void remove(int index);
+
+ /**
+ * Moves the entry at <code>fromIndex</code> to <code>toIndex</code>.
+ * @param toIndex the index of the entry destination.
+ * @param fromIndex the index of the entry to move.
+ */
+ void move(int toIndex, int fromIndex);
+
+ /**
+ * Adds a new entry with the SDO text Property
+ * to the end of the Sequence.
+ * Same as add(property, text) where property is the SDO text Property.
+ * @param text value of the entry.
+ */
+ void add(String text);
+
+ /**
+ * Adds a new entry with the SDO text Property
+ * at the given index.
+ * Same as add(index, property, text) where property is the SDO text Property.
+ * @param index the index at which to add the entry.
+ * @param text value of the entry.
+ */
+ void add(int index, String text);
+
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Type.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Type.java
new file mode 100644
index 0000000000..85d43aad60
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/Type.java
@@ -0,0 +1,143 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo;
+
+import java.util.List;
+
+/**
+ * A representation of the type of a {@link Property property} of a {@link DataObject data object}.
+ */
+public interface Type
+{
+ /**
+ * Returns the name of the type.
+ * @return the type name.
+ */
+ String getName();
+
+ /**
+ * Returns the namespace URI of the type.
+ * @return the namespace URI.
+ */
+ String getURI();
+
+ /**
+ * Returns the Java class that this type represents.
+ * @return the Java class.
+ */
+ Class getInstanceClass();
+
+ /**
+ * Returns whether the specified object is an instance of this type.
+ * @param object the object in question.
+ * @return <code>true</code> if the object is an instance.
+ * @see Class#isInstance
+ */
+ boolean isInstance(Object object);
+
+ /**
+ * Returns the List of the {@link Property Properties} of this type.
+ * <p>
+ * The expression
+ *<pre>
+ * type.getProperties().indexOf(property)
+ *</pre>
+ * yields the property's index relative to this type.
+ * As such, these expressions are equivalent:
+ *<pre>
+ * dataObject.{@link DataObject#get(int) get}(i)
+ * dataObject.{@link DataObject#get(Property) get}((Property)dataObject.getType().getProperties().get(i));
+ *</pre>
+ * </p>
+ * @return the Properties of the type.
+ * @see Property#getContainingType
+ */
+ List /*Property*/ getProperties();
+
+ /**
+ * Returns from {@link #getProperties all the Properties} of this type, the one with the specified name.
+ * As such, these expressions are equivalent:
+ *<pre>
+ * dataObject.{@link DataObject#get(String) get}("name")
+ * dataObject.{@link DataObject#get(Property) get}(dataObject.getType().getProperty("name"))
+ *</pre>
+ * </p>
+ * @return the Property with the specified name.
+ * @see #getProperties
+ */
+ Property getProperty(String propertyName);
+
+ /**
+ * Indicates if this Type specifies DataTypes (true) or DataObjects (false).
+ * When false, any object that is an instance of this type
+ * also implements the DataObject interface.
+ * True for simple types such as Strings and numbers.
+ * For any object:
+ * <pre>
+ * isInstance(object) && !isDataType() implies
+ * DataObject.class.isInstance(object) returns true.
+ * </pre>
+ * @return true if Type specifies DataTypes, false for DataObjects.
+ */
+ boolean isDataType();
+
+ /**
+ * Indicates if this Type allows any form of open content. If false,
+ * dataObject.getInstanceProperties() must be the same as
+ * dataObject.getType().getProperties() for any DataObject dataObject of this Type.
+ * @return true if this Type allows open content.
+ */
+ boolean isOpen();
+
+ /**
+ * Indicates if this Type specifies Sequenced DataObjects.
+ * Sequenced DataObjects are used when the order of values
+ * between Properties must be preserved.
+ * When true, a DataObject will return a Sequence. For example,
+ * <pre>
+ * Sequence elements = dataObject.{@link DataObject#getSequence() getSequence}();
+ * </pre>
+ * @return true if this Type specifies Sequenced DataObjects.
+ */
+ boolean isSequenced();
+
+ /**
+ * Indicates if this Type is abstract. If true, this Type cannot be
+ * instantiated. Abstract types cannot be used in DataObject or
+ * DataFactory create methods.
+ * @return true if this Type is abstract.
+ */
+ boolean isAbstract();
+
+ /**
+ * Returns the List of base Types for this Type. The List is empty
+ * if there are no base Types. XSD <extension>, <restriction>, and
+ * Java extends keyword are mapped to this list.
+ * @return the List of base Types for this Type.
+ */
+ List /*Type*/ getBaseTypes();
+
+ /**
+ * Returns the Properties declared in this Type as opposed to
+ * those declared in base Types.
+ * @return the Properties declared in this Type.
+ */
+ List /*Property*/ getDeclaredProperties();
+
+ /**
+ * Return a list of alias names for this Type.
+ * @return a list of alias names for this Type.
+ */
+ List /*String*/ getAliasNames();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/CopyHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/CopyHelper.java
new file mode 100644
index 0000000000..f0bf98aada
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/CopyHelper.java
@@ -0,0 +1,82 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper for copying DataObjects.
+ */
+public interface CopyHelper
+{
+ /**
+ * Create a shallow copy of the DataObject dataObject:
+ * Creates a new DataObject copiedDataObject with the same values
+ * as the source dataObject for each property where
+ * property.getType().isDataType() is true.
+ * The value of such a Property property in copiedDataObject is:
+ * dataObject.get(property) for single-valued Properties
+ * (copiedDataObject.get(property) equals() dataObject.get(property)), or
+ * a List where each member is equal to the member at the
+ * same index in dataObject for multi-valued Properties
+ * copiedDataObject.getList(property).get(i) equals() dataObject.getList(property).get(i)
+ * The copied Object is unset for each Property where
+ * property.getType().isDataType() is false
+ * since they are not copied.
+ * Read-only properties are copied.
+ * A copied object shares metadata with the source object
+ * sourceDO.getType() == copiedDO.getType()
+ * If a ChangeSummary is part of the source DataObject
+ * the copy has a new, empty ChangeSummary.
+ * Logging state is the same as the source ChangeSummary.
+ *
+ * @param dataObject to be copied
+ * @return copy of dataObject
+ */
+ DataObject copyShallow(DataObject dataObject);
+
+ /**
+ * Create a deep copy of the DataObject tree:
+ * Copies the dataObject and all its {@link commonj.sdo.Property#isContainment() contained}
+ * DataObjects recursively.
+ * Values of Properties are copied as in shallow copy,
+ * and values of Properties where
+ * property.getType().isDataType() is false
+ * are copied where each value copied must be a
+ * DataObject contained by the source dataObject.
+ * If a DataObject is outside the DataObject tree and the
+ * property is bidirectional, then the DataObject is skipped.
+ * If a DataObject is outside the DataObject tree and the
+ * property is unidirectional, then the same DataObject is referenced.
+ * Read-only properties are copied.
+ * If any DataObject referenced is not in the containment
+ * tree an IllegalArgumentException is thrown.
+ * If a ChangeSummary is part of the copy tree the new
+ * ChangeSummary refers to objects in the new DataObject tree.
+ * Logging state is the same as the source ChangeSummary.
+ *
+ * @param dataObject to be copied.
+ * @return copy of dataObject
+ * @throws IllegalArgumentException if any referenced DataObject
+ * is not part of the containment tree.
+ */
+ DataObject copy(DataObject dataObject);
+
+ /**
+ * The default CopyHelper.
+ */
+ CopyHelper INSTANCE = HelperProvider.getCopyHelper();
+
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataFactory.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataFactory.java
new file mode 100644
index 0000000000..fc9bf96ba4
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataFactory.java
@@ -0,0 +1,61 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A Factory for creating DataObjects.
+ * The created DataObjects are not connected to any other DataObjects.
+ */
+public interface DataFactory
+{
+ /**
+ * Create a DataObject of the Type specified by typeName with the given package uri.
+ * @param uri The uri of the Type.
+ * @param typeName The name of the Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the uri and typeName does
+ * not correspond to a Type this factory can instantiate.
+ */
+ DataObject create(String uri, String typeName);
+
+ /**
+ * Create a DataObject supporting the given interface.
+ * InterfaceClass is the interface for the DataObject's Type.
+ * The DataObject created is an instance of the interfaceClass.
+ * @param interfaceClass is the interface for the DataObject's Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the instanceClass does
+ * not correspond to a Type this factory can instantiate.
+ */
+ DataObject create(Class interfaceClass);
+
+ /**
+ * Create a DataObject of the Type specified.
+ * @param type The Type.
+ * @return the created DataObject.
+ * @throws IllegalArgumentException if the Type
+ * cannot be instantiaed by this factory.
+ */
+ DataObject create(Type type);
+
+ /**
+ * The default DataFactory.
+ */
+ DataFactory INSTANCE = HelperProvider.getDataFactory();
+
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataHelper.java
new file mode 100644
index 0000000000..1a630e4118
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/DataHelper.java
@@ -0,0 +1,184 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Data helper methods.
+ */
+public interface DataHelper
+{
+ /**
+ * Convert from a String representation of an SDO date type to a Date.
+ * @param dateString the String representation of an SDO date type
+ * @return a Date representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Date toDate(String dateString);
+
+ /**
+ * Convert from a String representation of an SDO date type to a Calendar using the
+ * default locale. Same as toCalendar(dateString, null).
+ * @param dateString the String representation of an SDO date type
+ * @return a Calendar representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Calendar toCalendar(String dateString);
+
+ /**
+ * Convert from a String representation of an SDO date type to a Calendar using the
+ * specified locale, or the default locale if the locale is null.
+ * @param dateString the String representation of an SDO date type
+ * @param locale the locale or null for default locale.
+ * @return a Calendar representation of an SDO date type.
+ * @throws IllegalArgumentException for invalid formats.
+ */
+ Calendar toCalendar(String dateString, Locale locale);
+
+ /**
+ * Convert from a Date to a String representation of the DateTime type.
+ * @param date the date
+ * @return a Date to a String representation of the DateTime type.
+ */
+ String toDateTime(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Duration type.
+ * @param date the date
+ * @return a Date to a String representation of the Duration type.
+ */
+ String toDuration(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Time type.
+ * @param date the date
+ * @return a Date to a String representation of the Time type.
+ */
+ String toTime(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Day type.
+ * @param date the date
+ * @return a Date to a String representation of the Day type.
+ */
+ String toDay(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Month type.
+ * @param date the date
+ * @return a Date to a String representation of the Month type.
+ */
+ String toMonth(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the MonthDay type.
+ * @param date the date
+ * @return a Date to a String representation of the MonthDay type.
+ */
+ String toMonthDay(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the Year type.
+ * @param date the date
+ * @return a Date to a String representation of the Year type.
+ */
+ String toYear(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the YearMonth type.
+ * @param date the date
+ * @return a Date to a String representation of the YearMonth type.
+ */
+ String toYearMonth(Date date);
+
+ /**
+ * Convert from a Date to a String representation of the YearMonthDay type.
+ * @param date the date
+ * @return a Date to a String representation of the YearMonthDay type.
+ */
+ String toYearMonthDay(Date date);
+
+ /**
+ * Convert from a Calendar to a String representation of the DateTime type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the DateTime type.
+ */
+ String toDateTime(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Duration type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Duration type.
+ */
+ String toDuration(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Time type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Time type.
+ */
+ String toTime(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Day type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Day type.
+ */
+ String toDay(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Month type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Month type.
+ */
+ String toMonth(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the MonthDay type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the MonthDay type.
+ */
+ String toMonthDay(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the Year type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the Year type.
+ */
+ String toYear(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the YearMonth type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the YearMonth type.
+ */
+ String toYearMonth(Calendar calendar);
+
+ /**
+ * Convert from a Calendar to a String representation of the YearMonthDay type.
+ * @param calendar the calendar to convert
+ * @return a Calendar to a String representation of the YearMonthDay type.
+ */
+ String toYearMonthDay(Calendar calendar);
+
+ /**
+ * The default TypeHelper.
+ */
+ DataHelper INSTANCE = HelperProvider.getDataHelper();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/EqualityHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/EqualityHelper.java
new file mode 100644
index 0000000000..6214020701
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/EqualityHelper.java
@@ -0,0 +1,89 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper for comparing DataObjects.
+ */
+public interface EqualityHelper
+{
+ /**
+ * <p>Two DataObjects are equalShallow if
+ * they have the same {@link DataObject#getType Type}
+ * and all their compared Properties are equal.
+ * The set of Properties compared are the
+ * {@link DataObject#getInstanceProperties() instance properties}
+ * where property.getType().isDataType() is true
+ * and property.getType() is not ChangeSummaryType.
+ * <br/>Two of these Property values are equal if they are both not
+ * {@link DataObject#isSet(Property) set}, or set to an equal value
+ * dataObject1.get(property).equals(dataObject2.get(property))
+ * <br/>If the type is a sequenced type, the sequence entries must be the same.
+ * For each entry x in the sequence where the property is used in the comparison,
+ * dataObject1.getSequence().getValue(x).equals(
+ * dataObject2.getSequence().getValue(x)) and
+ * dataObject1.getSequence().getProperty(x) ==
+ * dataObject2.getSequence().getProperty(x)
+ * must be true.
+ * </p>
+ * Returns true the objects have the same Type and all values of all compared Properties are equal.
+ * @param dataObject1 DataObject to be compared
+ * @param dataObject2 DataObject to be compared
+ * @return true the objects have the same Type and all values of all compared Properties are equal.
+ */
+ boolean equalShallow(DataObject dataObject1, DataObject dataObject2);
+
+ /**
+ * <p>Two DataObjects are equal(Deep) if they are equalShallow,
+ * all their compared Properties are equal, and all reachable DataObjects in their
+ * graphs excluding containers are equal.
+ * The set of Properties compared are the
+ * {@link DataObject#getInstanceProperties() instance properties}
+ * where property.getType().isDataType() is false,
+ * and is not a container property, ie !property.getOpposite().isContainment()
+ * <br/>Two of these Property values are equal if they are both not
+ * {@link DataObject#isSet(Property) set}, or all the DataObjects
+ * they refer to are {@link #equal(DataObject, DataObject) equal} in the
+ * context of dataObject1 and dataObject2.
+ * <br/>Note that properties to a containing DataObject are not compared
+ * which means two DataObject trees can be equal even if their containers are not equal.
+ * <br/>If the type is a sequenced type, the sequence entries must be the same.
+ * For each entry x in the sequence where the property is used in the comparison,
+ * equal(dataObject1.getSequence().getValue(x),
+ * dataObject2.getSequence().getValue(x)) and
+ * dataObject1.getSequence().getProperty(x) ==
+ * dataObject2.getSequence().getProperty(x)
+ * must be true.
+ * </p><p>
+ * A DataObject directly or indirectly referenced by dataObject1 or dataObject2
+ * can only be equal to exactly one DataObject directly or indirectly referenced
+ * by dataObject1 or dataObject2, respectively.
+ * This ensures that dataObject1 and dataObject2 are equal if the graph formed by
+ * all their referenced DataObjects have the same shape.
+ * </p>
+ * Returns true if the trees of DataObjects are equal(Deep).
+ * @param dataObject1 DataObject to be compared
+ * @param dataObject2 DataObject to be compared
+ * @return true if the trees of DataObjects are equal(Deep).
+ */
+ boolean equal(DataObject dataObject1, DataObject dataObject2);
+
+ /**
+ * The default EqualityHelper.
+ */
+ EqualityHelper INSTANCE = HelperProvider.getEqualityHelper();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/TypeHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/TypeHelper.java
new file mode 100644
index 0000000000..d178789a67
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/TypeHelper.java
@@ -0,0 +1,71 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.util.List;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Look up a Type given the uri and typeName or interfaceClass.
+ * SDO Types are available through the
+ * getType("commonj.sdo", typeName) method.
+ * Defines Types from DataObjects.
+ */
+public interface TypeHelper
+{
+ /**
+ * Return the Type specified by typeName with the given uri,
+ * or null if not found.
+ * @param uri The uri of the Type - type.getURI();
+ * @param typeName The name of the Type - type.getName();
+ * @return the Type specified by typeName with the given uri,
+ * or null if not found.
+ */
+ Type getType(String uri, String typeName);
+
+ /**
+ * Return the Type for this interfaceClass or null if not found.
+ * @param interfaceClass is the interface for the DataObject's Type -
+ * type.getInstanceClass();
+ * @return the Type for this interfaceClass or null if not found.
+ */
+ Type getType(Class interfaceClass);
+
+ /**
+ * Define the DataObject as a Type.
+ * The Type is available through TypeHelper and DataGraph getType() methods.
+ * @param type the DataObject representing the Type.
+ * @return the defined Type.
+ * @throws IllegalArgumentException if the Type could not be defined.
+ */
+ Type define(DataObject type);
+
+ /**
+ * Define the list of DataObjects as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param types a List of DataObjects representing the Types.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(List /*DataObject*/ types);
+
+ /**
+ * The default TypeHelper.
+ */
+ TypeHelper INSTANCE = HelperProvider.getTypeHelper();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLDocument.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLDocument.java
new file mode 100644
index 0000000000..3ef7fd70c8
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLDocument.java
@@ -0,0 +1,152 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import commonj.sdo.DataObject;
+
+/**
+ * Represents an XML Document containing a tree of DataObjects.
+ *
+ * An example XMLDocument fragment is:
+ * <?xml version="1.0"?>
+ * <purchaseOrder orderDate="1999-10-20">
+ *
+ * created from this XML Schema fragment:
+ * <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ * <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+ * <xsd:complexType name="PurchaseOrderType">
+ *
+ * Upon loading this XMLDocument:
+ * DataObject is an instance of Type PurchaseOrderType.
+ * RootElementURI is null because the XSD has no targetNamespace URI.
+ * RootElementName is purchaseOrder.
+ * Encoding is null because the document did not specify an encoding.
+ * XMLDeclaration is true because the document contained an XML declaration.
+ * XMLVersion is 1.0
+ * SchemaLocation and noNamespaceSchemaLocation are null because they are
+ * not specified in the document.
+ *
+ * When saving the root element, if the type of the root dataObject is not the
+ * type of global element specified by rootElementURI and rootElementName,
+ * or if a global element does not exist for rootElementURI and rootElementName,
+ * then an xsi:type declaration is written to record the root DataObject's Type.
+ *
+ * When loading the root element and an xsi:type declaration is found
+ * it is used as the type of the root DataObject. In this case,
+ * if validation is not being performed, it is not an error if the
+ * rootElementName is not a global element.
+ */
+public interface XMLDocument
+{
+ /**
+ * Return the root DataObject for the XMLDocument.
+ * @return root DataObject for the XMLDocument.
+ */
+ DataObject getRootObject();
+
+ /**
+ * Return the targetNamespace URI for the root element.
+ * If there is no targetNamespace URI, the value is null.
+ * The root element is a global element of the XML Schema
+ * with a type compatible to the DataObject.
+ * @return the targetNamespace URI for the root element.
+ */
+ String getRootElementURI();
+
+ /**
+ * Return the name of the root element.
+ * The root element is a global element of the XML Schema
+ * with a type compatible to the DataObject.
+ * @return the name of the root element.
+ */
+ String getRootElementName();
+
+ /**
+ * Return the XML encoding of the document, or null if not specified.
+ * The default value is "UTF-8".
+ * Specification of other values is implementation-dependent.
+ * @return the XML encoding of the document, or null if not specified.
+ */
+ String getEncoding();
+
+ /**
+ * Set the XML encoding of the document, or null if not specified.
+ * @param encoding
+ */
+ void setEncoding(String encoding);
+
+ /**
+ * Return the XML declaration of the document. If true,
+ * XMLHelper save() will produce a declaration of the form:
+ * <?xml version="1.0" encoding="UTF-8"?>
+ * Encoding will be suppressed if getEncoding() is null.
+ * The default value is true.
+ * @return the XML declaration of the document.
+ */
+ boolean isXMLDeclaration();
+
+ /**
+ * Set the XML declaration version of the document.
+ * @param xmlDeclaration the XML declaration version of the document.
+ */
+ void setXMLDeclaration(boolean xmlDeclaration);
+
+ /**
+ * Return the XML version of the document, or null if not specified.
+ * The default value is "1.0".
+ * Specification of other values is implementation-dependent.
+ * @return the XML version of the document, or null if not specified.
+ */
+ String getXMLVersion();
+
+ /**
+ * Set the XML version of the document, or null if not specified.
+ * @param xmlVersion the XML version of the document, or null if not specified.
+ */
+ void setXMLVersion(String xmlVersion);
+
+ /**
+ * Return the value of the schemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if not present.
+ * @return the value of the schemaLocation declaration,
+ * or null if not present.
+ */
+ String getSchemaLocation();
+
+ /**
+ * Sets the value of the schemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if it should not be present.
+ * @param schemaLocation the value of the schemaLocation declaration, or null.
+ */
+ void setSchemaLocation(String schemaLocation);
+
+ /**
+ * Return the value of the noNamespaceSchemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if not present.
+ * @return the value of the noNamespaceSchemaLocation declaration,
+ * or null if not present.
+ */
+ String getNoNamespaceSchemaLocation();
+
+ /**
+ * Sets the value of the noNamespaceSchemaLocation declaration
+ * for the http://www.w3.org/2001/XMLSchema-instance namespace in the
+ * root element, or null if it should not be present.
+ * @param schemaLocation the value of the noNamespaceSchemaLocation declaration, or null.
+ */
+ void setNoNamespaceSchemaLocation(String schemaLocation);
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLHelper.java
new file mode 100644
index 0000000000..1d0c6ca127
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XMLHelper.java
@@ -0,0 +1,167 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * A helper to convert XML documents into DataObects and
+ * DataObjects into XML documnets.
+ */
+public interface XMLHelper
+{
+ /**
+ * Creates and returns an XMLDocument from the input String.
+ * By default does not perform XSD validation.
+ * Same as
+ * load(new StringReader(inputString), null, null);
+ *
+ * @param inputString specifies the String to read from
+ * @return the new XMLDocument loaded
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(String inputString);
+
+ /**
+ * Creates and returns an XMLDocument from the inputStream.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * Same as
+ * load(inputStream, null, null);
+ *
+ * @param inputStream specifies the InputStream to read from
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(InputStream inputStream) throws IOException;
+
+ /**
+ * Creates and returns an XMLDocument from the inputStream.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * @param inputStream specifies the InputStream to read from
+ * @param locationURI specifies the URI of the document for relative schema locations
+ * @param options implementation-specific options.
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(InputStream inputStream, String locationURI, Object options) throws IOException;
+
+ /**
+ * Creates and returns an XMLDocument from the inputReader.
+ * The InputStream will be closed after reading.
+ * By default does not perform XSD validation.
+ * @param inputReader specifies the Reader to read from
+ * @param locationURI specifies the URI of the document for relative schema locations
+ * @param options implementation-specific options.
+ * @return the new XMLDocument loaded
+ * @throws IOException for stream exceptions.
+ * @throws RuntimeException for errors in XML parsing or
+ * implementation-specific validation.
+ */
+ XMLDocument load(Reader inputReader, String locationURI, Object options) throws IOException;
+
+ /**
+ * Returns the DataObject saved as an XML document with the specified root element.
+ * Same as
+ * StringWriter stringWriter = new StringWriter();
+ * save(createDocument(dataObject, rootElementURI, rootElementName),
+ * stringWriter, null);
+ * stringWriter.toString();
+ *
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @return the saved XML document as a string
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ String save(DataObject dataObject, String rootElementURI, String rootElementName);
+
+ /**
+ * Saves the DataObject as an XML document with the specified root element.
+ * Same as
+ * save(createDocument(dataObject, rootElementURI, rootElementName),
+ * outputStream, null);
+ *
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @param outputStream specifies the OutputStream to write to.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(DataObject dataObject, String rootElementURI, String rootElementName, OutputStream outputStream) throws IOException;
+
+ /**
+ * Serializes an XMLDocument as an XML document into the outputStream.
+ * If the DataObject's Type was defined by an XSD, the serialization
+ * will follow the XSD.
+ * Otherwise the serialization will follow the format as if an XSD
+ * were generated as defined by the SDO specification.
+ * The OutputStream will be flushed after writing.
+ * Does not perform validation to ensure compliance with an XSD.
+ * @param xmlDocument specifies XMLDocument to be saved
+ * @param outputStream specifies the OutputStream to write to.
+ * @param options implementation-specific options.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(XMLDocument xmlDocument, OutputStream outputStream, Object options) throws IOException;
+
+ /**
+ * Serializes an XMLDocument as an XML document into the outputWriter.
+ * If the DataObject's Type was defined by an XSD, the serialization
+ * will follow the XSD.
+ * Otherwise the serialization will follow the format as if an XSD
+ * were generated as defined by the SDO specification.
+ * The OutputStream will be flushed after writing.
+ * Does not perform validation to ensure compliance with an XSD.
+ * @param xmlDocument specifies XMLDocument to be saved
+ * @param outputWriter specifies the Writer to write to.
+ * @param options implementation-specific options.
+ * @throws IOException for stream exceptions.
+ * @throws IllegalArgumentException if the dataObject tree
+ * is not closed or has no container.
+ */
+ void save(XMLDocument xmlDocument, Writer outputWriter, Object options) throws IOException;
+
+ /**
+ * Creates an XMLDocument with the specified XML rootElement for the DataObject.
+ * @param dataObject specifies DataObject to be saved
+ * @param rootElementURI the Target Namespace URI of the root XML element
+ * @param rootElementName the Name of the root XML element
+ * @return XMLDocument a new XMLDocument set with the specified parameters.
+ */
+ XMLDocument createDocument(DataObject dataObject, String rootElementURI, String rootElementName);
+
+ /**
+ * The default XMLHelper.
+ */
+ XMLHelper INSTANCE = HelperProvider.getXMLHelper();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XSDHelper.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XSDHelper.java
new file mode 100644
index 0000000000..7b4a99493c
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/helper/XSDHelper.java
@@ -0,0 +1,193 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.helper;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.List;
+import java.util.Map;
+
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+import commonj.sdo.impl.HelperProvider;
+
+/**
+ * Provides access to additional information when the
+ * Type or Property is defined by an XML Schema (XSD).
+ * Methods return null/false otherwise or if the information is unavailable.
+ * Defines Types from an XSD.
+*/
+public interface XSDHelper
+{
+ /**
+ * Returns the local name as declared in the XSD.
+ * @param type to return local name for.
+ * @return the local name as declared in the XSD.
+ */
+ String getLocalName(Type type);
+
+ /**
+ * Returns the local name as declared in the XSD.
+ * @param property to return local name for.
+ * @return the local name as declared in the XSD.
+ */
+ String getLocalName(Property property);
+
+ /**
+ * Returns the namespace URI as declared in the XSD.
+ * @param property to return namespace URI for.
+ * @return the namespace URI as declared in the XSD.
+ */
+ String getNamespaceURI(Property property);
+
+ /**
+ * Returns true if the property is declared as an attribute in the XSD.
+ * Returns false if not known or for advanced cases.
+ * It is possible for both isAttribute and isElement to return false
+ * but they will not both return true.
+ * @param property to identify if an attribute.
+ * @return true if the property is declared as an attribute in the XSD.
+ */
+ boolean isAttribute(Property property);
+
+ /**
+ * Returns true if the property is declared as an element in the XSD.
+ * Returns false if not known or for advanced cases.
+ * It is possible for both isAttribute and isElement to return false
+ * but they will not both return true.
+ * @param property to identify if an element.
+ * @return true if the property is declared as an element in the XSD.
+ */
+ boolean isElement(Property property);
+
+ /**
+ * Returns true if the Type is declared to contain mixed content.
+ * A DataObject's mixed content values are typically accessed via a Sequence.
+ * @param type to identify if mixed content.
+ * @return true if the Type is declared to contain mixed content.
+ */
+ boolean isMixed(Type type);
+
+ /**
+ * Indicates if this helper contains XSD information for the specified type.
+ * @param type the type.
+ * @return true if this helper contains XSD information for the specified type.
+ */
+ boolean isXSD(Type type);
+
+ /**
+ * Returns the Property defined by the named global element or attribute
+ * in the targetNamespace uri, or null if not found.
+ * @param uri The uri of the targetNamespace.
+ * @param propertyName The name of the global property.
+ * @param isElement is true for global elements, false for global attributes.
+ * @return the Property defined by the named global element or attribute
+ * in the targetNamespace uri, or null if not found.
+ */
+ Property getGlobalProperty(String uri, String propertyName, boolean isElement);
+
+ /**
+ * Return the appinfo declared for this Type and source.
+ * The appinfo start and end tags and content are returned.
+ * The xml namespace context is preserved in the appinfo element.
+ * If more than one appinfo with the same source is declared on the same
+ * Type their contents are concatenated.
+ * @param type the type with the appinfo declaration
+ * @param source the source of the appinfo declaration.
+ * @return the appinfo declared for this Type and source.
+ */
+ String getAppinfo(Type type, String source);
+
+ /**
+ * Return the content of the appinfo declared for this Property and source.
+ * If the property is defined by ref= the appinfo of the referenced
+ * element or attribute is included.
+ * The appinfo start and end tags and content are returned.
+ * The xml namespace context is preserved in the appinfo element.
+ * If more than one appinfo with the same source is declared on the same
+ * Type their contents are concatenated.
+ * @param property the Property with the appinfo declaration
+ * @param source the source of the appinfo declaration.
+ * @return the appinfo declared for this Property and source.
+ */
+ String getAppinfo(Property property, String source);
+
+ /**
+ * Define the XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * Same as define(new StringReader(xsd), null)
+ * @param xsd the XML Schema.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(String xsd);
+
+ /**
+ * Define XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param xsdReader reader to an XML Schema.
+ * @param schemaLocation the URI of the location of the schema, used
+ * for processing relative imports and includes. May be null if not used.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(Reader xsdReader, String schemaLocation);
+
+ /**
+ * Define XML Schema as Types.
+ * The Types are available through TypeHelper and DataGraph getType() methods.
+ * @param xsdInputStream input stream to an XML Schema.
+ * @param schemaLocation the URI of the location of the schema, used
+ * for processing relative imports and includes. May be null if not used.
+ * @return the defined Types.
+ * @throws IllegalArgumentException if the Types could not be defined.
+ */
+ List /*Type*/ define(InputStream xsdInputStream, String schemaLocation);
+
+ /**
+ * Generate an XML Schema Declaration (XSD) from Types.
+ * Same as generate(types, null);
+ * @param types a List containing the Types
+ * @return a String containing the generated XSD.
+ * @throws IllegalArgumentException if the XSD could not be generated.
+ */
+ String generate(List /*Type*/ types);
+
+ /**
+ * Generate an XML Schema Declaration (XSD) from Types.
+ * Round trip from SDO to XSD to SDO is supported.
+ * Round trip from XSD to SDO to XSD is not supported.
+ * Use the original schema if one exists instead of generating a new one, as
+ * the generated XSD validates a different set of documents than the original XSD.
+ * Generating an XSD does not affect the XSDHelper or the Types.
+ * The Types must all have the same URI.
+ * The result is a String containing the generated XSD.
+ * All Types referenced with the same URI will be generated in the XSD
+ * and the list will be expanded to include all types generated.
+ * Any Types referenced with other URIs will cause
+ * imports to be produced as appropriate.
+ * Imports will include a schemaLocation if a Map is provided with an entry
+ * of the form key=import target namespace, value=schemaLocation
+ * @param types a List containing the Types
+ * @param namespaceToSchemaLocation map of target namespace to schema locations or null
+ * @return a String containing the generated XSD.
+ * @throws IllegalArgumentException if the XSD could not be generated.
+ */
+ String generate(List /*Type*/ types, Map /*String, String*/ namespaceToSchemaLocation);
+
+ /**
+ * The default XSDHelper.
+ */
+ XSDHelper INSTANCE = HelperProvider.getXSDHelper();
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java
new file mode 100644
index 0000000000..886138d3a5
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/ExternalizableDelegator.java
@@ -0,0 +1,87 @@
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+package commonj.sdo.impl;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+import java.io.ObjectStreamException;
+
+/**
+ * Delegates DataObject serialization while ensuring implementation independent
+ * java.io.Serialization. An implementation of DataObject
+ * returns an ExternalizableDelegator from its writeReplace() method.
+ *
+ * The root DataObject is the object returned from do.getRootObject() where
+ * do is the DataObject being serialized in a java.io.ObjectOutputStream.
+ * When do.getContainer() == null then do is a root object.
+ *
+ * The byte format for each DataObject in the stream is:
+ * [0] [path] [root] // when do is not a root object
+ * [1] [rootXML] // when do is a root object
+ *
+ * where:
+ * [0] is the byte 0, serialized using writeByte(0).
+ * [1] is the byte 1, serialized using writeByte(1).
+ *
+ * [path] is an SDO path expression from the root DataObject to the serialized
+ * DataObject such that root.getDataObject(path) == do.
+ * Serialized using writeUTF(path).
+ *
+ * [root] is the root object serialized using writeObject(root).
+ *
+ * [rootXML] is the GZip of the XML serialization of the root DataObject.
+ * The XML serialization is the same as
+ * XMLHelper.INSTANCE.save(root, "commonj.sdo", "dataObject", stream);
+ * where stream is a GZIPOutputStream, length is the number of bytes
+ * in the stream, and bytes are the contents of the stream.
+ * Serialized using writeInt(length), write(bytes).
+ *
+ */
+public class ExternalizableDelegator implements Externalizable
+{
+ public interface Resolvable extends Externalizable
+ {
+ Object readResolve() throws ObjectStreamException;
+ }
+
+ static final long serialVersionUID = 1;
+ transient Resolvable delegate;
+
+ public ExternalizableDelegator()
+ {
+ delegate = HelperProvider.createResolvable();
+ }
+
+ public ExternalizableDelegator(Object target)
+ {
+ delegate = HelperProvider.createResolvable(target);
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException
+ {
+ delegate.writeExternal(out);
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
+ {
+ delegate.readExternal(in);
+ }
+
+ public Object readResolve() throws ObjectStreamException
+ {
+ return delegate.readResolve();
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/HelperProvider.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/HelperProvider.java
new file mode 100644
index 0000000000..6fbdad8bd5
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/HelperProvider.java
@@ -0,0 +1,367 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package commonj.sdo.impl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * A HelperProvider obtains specific default helpers and other
+ * implementation-specific objects used by a Java implementation of SDO.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class HelperProvider {
+ /**
+ * The default HelperProvider INSTANCE. This is located using the ClassLoader used
+ * to load the HelperProvider class itself and if no default implementation is available
+ * this field will be set to null.
+ */
+ public static final HelperProvider INSTANCE;
+
+ /**
+ * The name of the resource that is used for service location.
+ */
+ public static final String SERVICE_RESOURCE_NAME = "META-INF/services/commonj.sdo.impl.HelperProvider";
+
+ /**
+ * The name of the system property that will be checked for an implementation name.
+ */
+ public static final String PROPERTY_NAME = "commonj.sdo.impl.HelperProvider";
+
+ static {
+ // initialize the default instance using this class's classloader
+ // set to null if none could be located (implies no default implementation)
+ HelperProvider provider;
+ try {
+ provider = getInstance(HelperProvider.class.getClassLoader());
+ } catch (NoHelperProviderException e) {
+ provider = null;
+ }
+ INSTANCE = provider;
+ }
+
+ /**
+ * Locate and instantiate a HelperProvider.
+ * <p/>
+ * Attempt to locate a HelperProvider using first the Thread's current context classloader and then,
+ * if that is not set, not readable, or does not provide an implementation, using the classloader
+ * used to load the HelperProvider class itself.
+ * <p/>
+ * A new instance is returned for each sucessful invocation.
+ *
+ * @return an implementation of HelperProvider
+ * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated
+ */
+ public static HelperProvider getInstance() throws NoHelperProviderException {
+ String implName = getImplementationName();
+
+ ClassLoader cl = getContextClassLoader();
+ if (cl != null) {
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider != null) {
+ return provider;
+ }
+ }
+
+ cl = HelperProvider.class.getClassLoader();
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider != null) {
+ return provider;
+ }
+
+ throw new NoHelperProviderException(implName);
+ }
+
+
+ /**
+ * Locate and instantiate a HelperProvider using the supplied ClassLoader.
+ * <p/>
+ * The name of the implementation to use is determined by the value of the "commonj.sdo.impl.HelperProvider"
+ * system property. If this is not set or this code does not have permission to read it then the name
+ * will be retrieved from the META-INF/services/commonj.sdo.impl.HelperProvider resource as returned
+ * by the supplied classloader as described in the
+ * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a>.
+ * <p/>
+ * A new instance is returned for each sucessful invocation.
+ *
+ * @param cl the classloader to use to locate and instantiate the implementation
+ * @return the specified implementation of HelperProvider
+ * @throws NoHelperProviderException if no provider implementation was defined or it could not be instantiated
+ */
+ public static HelperProvider getInstance(ClassLoader cl) throws NoHelperProviderException {
+ String implName = getImplementationName();
+ HelperProvider provider = loadImplementation(cl, implName);
+ if (provider == null) {
+ throw new NoHelperProviderException(implName);
+ }
+ return provider;
+ }
+
+ private static ClassLoader getContextClassLoader() {
+ try {
+ return (ClassLoader)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+
+ private static HelperProvider loadImplementation(ClassLoader cl, String implName) throws NoHelperProviderException {
+ // if no name is requested, locate using the supplied classloader
+ if (implName == null) {
+ implName = getImplementationName(cl);
+ }
+ // no implementation to try, return null
+ if (implName == null) {
+ return null;
+ }
+
+ // try an instantiate the implementation
+ try {
+ return (HelperProvider) cl.loadClass(implName).newInstance();
+ } catch (InstantiationException e) {
+ throw new NoHelperProviderException(implName, e);
+ } catch (IllegalAccessException e) {
+ throw new NoHelperProviderException(implName, e);
+ } catch (ClassNotFoundException e) {
+ throw new NoHelperProviderException(implName, e);
+ }
+ }
+
+ private static String getImplementationName() {
+ try {
+ return (String)AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return System.getProperty(PROPERTY_NAME);
+ }
+ });
+ } catch (SecurityException e) {
+ return null;
+ }
+ }
+
+ private static String getImplementationName(ClassLoader cl) {
+ InputStream is = cl.getResourceAsStream(SERVICE_RESOURCE_NAME);
+ if (is == null) {
+ return null;
+ }
+
+ InputStreamReader in;
+ try {
+ in = new InputStreamReader(is, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new AssertionError("UTF-8 encoding not available");
+ }
+
+ try {
+ BufferedReader reader = new BufferedReader(in, 128);
+ try {
+ String line;
+ while ((line = reader.readLine()) != null) {
+ int i = line.indexOf('#');
+ if (i != -1) {
+ line = line.substring(0, i);
+ }
+ line = line.trim();
+ if (line.length() > 0) {
+ return line;
+ }
+ }
+ return null;
+ } finally {
+ reader.close();
+ }
+ } catch (IOException e) {
+ throw new NoHelperProviderException(e);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // implementation specific methods for users that don't want to use the default implementation
+
+ /**
+ * Returns a CopyHelper obtained from this implementation.
+ *
+ * @return a CopyHelper obtained from this implementation
+ */
+ public abstract CopyHelper copyHelper();
+
+ /**
+ * Returns a DataFactory obtained from this implementation.
+ *
+ * @return a DataFactory obtained from this implementation
+ */
+ public abstract DataFactory dataFactory();
+
+ /**
+ * Returns a DataHelper obtained from this implementation.
+ *
+ * @return a DataHelper obtained from this implementation
+ */
+ public abstract DataHelper dataHelper();
+
+ /**
+ * Returns a EqualityHelper obtained from this implementation.
+ *
+ * @return a EqualityHelper obtained from this implementation
+ */
+ public abstract EqualityHelper equalityHelper();
+
+ /**
+ * Returns a TypeHelper obtained from this implementation.
+ *
+ * @return a TypeHelper obtained from this implementation
+ */
+ public abstract TypeHelper typeHelper();
+
+ /**
+ * Returns a XMLHelper obtained from this implementation.
+ *
+ * @return a XMLHelper obtained from this implementation
+ */
+ public abstract XMLHelper xmlHelper();
+
+ /**
+ * Returns a XSDHelper obtained from this implementation.
+ *
+ * @return a XSDHelper obtained from this implementation
+ */
+ public abstract XSDHelper xsdHelper();
+
+ /**
+ * Create a Resolvable using this implementation
+ *
+ * @return a Resolvable created using this implementation
+ */
+ public abstract ExternalizableDelegator.Resolvable resolvable();
+
+ /**
+ * Create a Resolvable using this implementation
+ *
+ * @param target the object to be resolved
+ * @return a Resolvable created using this implementation
+ */
+ public abstract ExternalizableDelegator.Resolvable resolvable(Object target);
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ // static helper methods required by the specification
+
+ /**
+ * Returns a CopyHelper obtained from the default HelperProvider.
+ *
+ * @return a CopyHelper obtained from the default HelperProvider
+ */
+ public static CopyHelper getCopyHelper() {
+ return INSTANCE.copyHelper();
+ }
+
+ /**
+ * Returns a DataFactory obtained from the default HelperProvider.
+ *
+ * @return a DataFactory obtained from the default HelperProvider
+ */
+ public static DataFactory getDataFactory() {
+ return INSTANCE.dataFactory();
+ }
+
+ /**
+ * Returns a DataHelper obtained from the default HelperProvider.
+ *
+ * @return a DataHelper obtained from the default HelperProvider
+ */
+ public static DataHelper getDataHelper() {
+ return INSTANCE.dataHelper();
+ }
+
+ /**
+ * Returns a EqualityHelper obtained from the default HelperProvider.
+ *
+ * @return a EqualityHelper obtained from the default HelperProvider
+ */
+ public static EqualityHelper getEqualityHelper() {
+ return INSTANCE.equalityHelper();
+ }
+
+ /**
+ * Returns a TypeHelper obtained from the default HelperProvider.
+ *
+ * @return a TypeHelper obtained from the default HelperProvider
+ */
+ public static TypeHelper getTypeHelper() {
+ return INSTANCE.typeHelper();
+ }
+
+ /**
+ * Returns a XMLHelper obtained from the default HelperProvider.
+ *
+ * @return a XMLHelper obtained from the default HelperProvider
+ */
+ public static XMLHelper getXMLHelper() {
+ return INSTANCE.xmlHelper();
+ }
+
+ /**
+ * Returns a XSDHelper obtained from the default HelperProvider.
+ *
+ * @return a XSDHelper obtained from the default HelperProvider
+ */
+ public static XSDHelper getXSDHelper() {
+ return INSTANCE.xsdHelper();
+ }
+
+ /**
+ * Create a Resolvable using the default HelperProvider
+ *
+ * @return a Resolvable created using the default HelperProvider
+ */
+ public static ExternalizableDelegator.Resolvable createResolvable() {
+ return INSTANCE.resolvable();
+ }
+
+ /**
+ * Create a Resolvable using the default HelperProvider
+ *
+ * @param target the object to be resolved
+ * @return a Resolvable created using the default HelperProvider
+ */
+ public static ExternalizableDelegator.Resolvable createResolvable(Object target) {
+ return INSTANCE.resolvable(target);
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/NoHelperProviderException.java b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/NoHelperProviderException.java
new file mode 100644
index 0000000000..83f0b21e2e
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/java/commonj/sdo/impl/NoHelperProviderException.java
@@ -0,0 +1,58 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package commonj.sdo.impl;
+
+/**
+ * Exception indicating that a HelperProvider could not be located or instantiated.
+ * The message will be set to the name of the implementation class; a null value
+ * indicates that the name of the implementation could not be determined.
+ * The cause will be set to the Throwable that prevented the provider from being
+ * located or created.
+ *
+ * @version $Revision$ $Date$
+ */
+public class NoHelperProviderException extends RuntimeException {
+ private static final long serialVersionUID = 727646133930924084L;
+
+ public NoHelperProviderException() {
+ }
+
+ public NoHelperProviderException(String message) {
+ super(message);
+ }
+
+ public NoHelperProviderException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public NoHelperProviderException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Return the name of the implementation class that could not be provided.
+ *
+ * @return the name of the implementation class; may be null if not known
+ */
+ public String getImplementationName() {
+ return getMessage();
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/datagraph.xsd b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/datagraph.xsd
new file mode 100644
index 0000000000..30727473a0
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/datagraph.xsd
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:sdo="commonj.sdo"
+ targetNamespace="commonj.sdo">
+
+ <xsd:element name="datagraph" type="sdo:DataGraphType"/>
+
+ <xsd:complexType name="DataGraphType">
+ <xsd:complexContent>
+ <xsd:extension base="sdo:BaseDataGraphType">
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="1" namespace="##other" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="BaseDataGraphType" abstract="true">
+ <xsd:sequence>
+ <xsd:element name="models" type="sdo:ModelsType" minOccurs="0"/>
+ <xsd:element name="xsd" type="sdo:XSDType" minOccurs="0"/>
+ <xsd:element name="changeSummary" type="sdo:ChangeSummaryType" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="ModelsType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Expected type is emof:Package.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##other" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="XSDType">
+ <xsd:annotation>
+ <xsd:documentation>
+ Expected type is xsd:schema.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="ChangeSummaryType">
+ <xsd:sequence>
+ <xsd:any minOccurs="0" maxOccurs="unbounded" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="create" type="xsd:string"/>
+ <xsd:attribute name="delete" type="xsd:string"/>
+ <xsd:attribute name="logging" type="xsd:boolean"/>
+ </xsd:complexType>
+
+ <xsd:attribute name="ref" type="xsd:string"/>
+
+</xsd:schema>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xml b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xml
new file mode 100644
index 0000000000..08c3b9734c
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoJava="commonj.sdo/java"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!--
+ JavaInfo declares properties used in open content for
+ the Java binding of SDO Types and Properties.
+-->
+
+ <type name="JavaInfo" uri="commonj.sdo/java">
+ <property name="javaClass" type="commonj.sdo#String"/>
+ </type>
+
+<!--
+ The Java object data types.
+-->
+
+ <type name="BooleanObject" dataType="true" sdoJava:instanceClass="java.lang.Boolean" uri="commonj.sdo/java"/>
+ <type name="ByteObject" dataType="true" sdoJava:instanceClass="java.lang.Byte" uri="commonj.sdo/java"/>
+ <type name="CharacterObject" dataType="true" sdoJava:instanceClass="java.lang.Character" uri="commonj.sdo/java"/>
+ <type name="DoubleObject" dataType="true" sdoJava:instanceClass="java.lang.Double" uri="commonj.sdo/java"/>
+ <type name="FloatObject" dataType="true" sdoJava:instanceClass="java.lang.Float" uri="commonj.sdo/java"/>
+ <type name="IntObject" dataType="true" sdoJava:instanceClass="java.lang.Int" uri="commonj.sdo/java"/>
+ <type name="LongObject" dataType="true" sdoJava:instanceClass="java.lang.Long" uri="commonj.sdo/java"/>
+ <type name="ShortObject" dataType="true" sdoJava:instanceClass="java.lang.Short" uri="commonj.sdo/java"/>
+
+</types>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xsd b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xsd
new file mode 100644
index 0000000000..094a705aa5
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoJava.xsd
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo/java"
+ xmlns:sdoJava="commonj.sdo/java"
+ xmlns:sdo="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+<!--
+ These attributes are used to customize the Java mapping of
+ XSD to SDO Types and Properties.
+-->
+
+<xsd:attribute name="package" type="xsd:string" />
+<xsd:attribute name="instanceClass" type="xsd:string" />
+<xsd:attribute name="extendedInstanceClass" type="xsd:string" />
+<xsd:attribute name="nestedInterfaces" type="xsd:boolean" />
+
+<!--
+ JavaInfo declares properties used in open content for
+ the Java binding of SDO Types and Properties.
+-->
+
+<!-- FIXME need this global attribute because as per spec Type's with JavaInfo.javaClass cannot be (de)serialized -->
+<xsd:attribute name="javaClass" type="sdo:String"/>
+
+<xsd:complexType name="JavaInfo">
+ <xsd:attribute ref="sdoJava:javaClass"/>
+</xsd:complexType>
+
+<!--
+ The Java object data types.
+-->
+
+<xsd:simpleType name="BooleanObject" sdoJava:instanceClass="java.lang.Boolean">
+ <xsd:restriction base="xsd:boolean"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="ByteObject" sdoJava:instanceClass="java.lang.Byte">
+ <xsd:restriction base="xsd:byte"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="CharacterObject" sdoJava:instanceClass="java.lang.Character">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="DoubleObject" sdoJava:instanceClass="java.lang.Double">
+ <xsd:restriction base="xsd:double"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="FloatObject" sdoJava:instanceClass="java.lang.Float">
+ <xsd:restriction base="xsd:float"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="IntObject" sdoJava:instanceClass="java.lang.Integer">
+ <xsd:restriction base="xsd:int"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="LongObject" sdoJava:instanceClass="java.lang.Long">
+ <xsd:restriction base="xsd:long"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="ShortObject" sdoJava:instanceClass="java.lang.Short">
+ <xsd:restriction base="xsd:short"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xml b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xml
new file mode 100644
index 0000000000..fcd1a4e283
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoJava="commonj.sdo/java"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!-- Model Types
+ SDO Type and Property are defined in terms of themselves.
+-->
+
+ <type name="Type" open="true" uri="commonj.sdo">
+ <property name="baseType" type="#Type" many="true"/>
+ <property name="property" type="#Property" containment="true" many="true"/>
+ <property name="aliasName" type="#String" many="true"/>
+ <property name="name" type="#String"/>
+ <property name="uri" type="#String"/>
+ <property name="dataType" type="#Boolean"/>
+ <property name="open" type="#Boolean"/>
+ <property name="sequenced" type="#Boolean"/>
+ <property name="abstract" type="#Boolean"/>
+ </type>
+
+ <type name="Property" open="true" uri="commonj.sdo">
+ <property name="aliasName" type="#String" many="true"/>
+ <property name="name" type="#String"/>
+ <property name="many" type="#Boolean"/>
+ <property name="containment" type="#Boolean"/>
+ <property name="type" type="#Type" />
+ <property name="default" type="#String"/>
+ <property name="readOnly" type="#Boolean"/>
+ <property name="opposite" type="#Property"/>
+ </type>
+
+ <!-- SDO special types -->
+
+ <type name="DataObject" abstract="true" sdoJava:instanceClass="commonj.sdo.DataObject" uri="commonj.sdo"/>
+ <type name="ObjectType" abstract="true" datatype="true" sdoJava:instanceClass="java.lang.Object" uri="commonj.sdo"/>
+ <type name="ChangeSummaryType" abstract="true" datatype="true" sdoJava:instanceClass="commonj.sdo.ChangeSummary" uri="commonj.sdo"/>
+
+ <type name="TextType" abstract="true">
+ <property name="text" type="#String" many="true"/>
+ </type>
+
+ <!-- SDO data types -->
+
+ <type name="Boolean" datatype="true" sdoJava:instanceClass="boolean" uri="commonj.sdo"/>
+ <type name="Byte" datatype="true" sdoJava:instanceClass="byte" uri="commonj.sdo"/>
+ <type name="Bytes" datatype="true" sdoJava:instanceClass="byte[]" uri="commonj.sdo"/>
+ <type name="Character" datatype="true" sdoJava:instanceClass="char" uri="commonj.sdo"/>
+ <type name="Date" datatype="true" sdoJava:instanceClass="java.util.Date" uri="commonj.sdo"/>
+ <type name="DateTime" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Day" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Decimal" datatype="true" sdoJava:instanceClass="java.math.BigDecimal" uri="commonj.sdo"/>
+ <type name="Duration" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Double" datatype="true" sdoJava:instanceClass="double" uri="commonj.sdo"/>
+ <type name="Float" datatype="true" sdoJava:instanceClass="float" uri="commonj.sdo"/>
+ <type name="Int" datatype="true" sdoJava:instanceClass="int" uri="commonj.sdo"/>
+ <type name="Integer" datatype="true" sdoJava:instanceClass="java.math.BigInteger" uri="commonj.sdo"/>
+ <type name="Long" datatype="true" sdoJava:instanceClass="long" uri="commonj.sdo"/>
+ <type name="MonthDay" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Month" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Short" datatype="true" sdoJava:instanceClass="short" uri="commonj.sdo"/>
+ <type name="String" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Strings" datatype="true" sdoJava:instanceClass="java.util.List" uri="commonj.sdo"/>
+ <type name="Time" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="Year" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="YearMonth" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="YearMonthDay" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+ <type name="URI" datatype="true" sdoJava:instanceClass="java.lang.String" uri="commonj.sdo"/>
+
+</types>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xsd b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xsd
new file mode 100644
index 0000000000..114fb57145
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoModel.xsd
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdo="commonj.sdo"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xmlns:sdoJava="commonj.sdo/java"
+ elementFormDefault="qualified"
+ xsi:schemaLocation="commonj.sdo/xml sdoXML.xsd
+ commonj.sdo/java sdoJava.xsd">
+
+<xsd:include schemaLocation="datagraph.xsd"/>
+
+<!-- Root element for defining several Types in one document.
+ Is not part of the model.
+-->
+<xsd:element name="types" type="sdo:Types"/>
+<xsd:complexType name="Types">
+ <xsd:sequence>
+ <xsd:element name="type" type="sdo:Type" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<!-- Any data object may be serialized with this element,
+ with xsi:type to declare the
+ actual type of the DataObject serialized.
+-->
+<xsd:element name="dataObject" type="xsd:anyType"/>
+
+<!-- Model Types
+ SDO Type and Property are defined in terms of themselves.
+-->
+<xsd:element name="type" type="sdo:Type"/>
+<xsd:complexType name="Type">
+ <xsd:sequence>
+ <xsd:element name="baseType" type="sdo:URI"
+ minOccurs="0" maxOccurs="unbounded"
+ sdoXML:propertyType="sdo:Type" />
+ <xsd:element name="property" type="sdo:Property"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="aliasName" type="sdo:String"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:ID" sdo:dataType="sdo:String"/>
+ <xsd:attribute name="uri" type="sdo:URI"/>
+ <xsd:attribute name="dataType" type="sdo:Boolean"/>
+ <xsd:attribute name="open" type="sdo:Boolean"/>
+ <xsd:attribute name="sequenced" type="sdo:Boolean"/>
+ <xsd:attribute name="abstract" type="sdo:Boolean"/>
+ <xsd:anyAttribute namespace="##any" processContents="lax"/>
+</xsd:complexType>
+
+<xsd:complexType name="Property">
+ <xsd:sequence>
+ <xsd:element name="aliasName" type="sdo:String"
+ minOccurs="0" maxOccurs="unbounded" />
+ <xsd:any namespace="##other" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="sdo:String"/>
+ <xsd:attribute name="many" type="sdo:Boolean"/>
+ <xsd:attribute name="containment" type="sdo:Boolean"/>
+ <xsd:attribute name="default" type="sdo:String"/>
+ <xsd:attribute name="readOnly" type="sdo:Boolean"/>
+ <xsd:attribute name="type" type="sdo:URI" sdoXML:propertyType="sdo:Type" />
+ <xsd:attribute name="opposite" type="sdo:URI" sdoXML:propertyType="sdo:Property" />
+ <xsd:anyAttribute namespace="##any" processContents="lax"/>
+</xsd:complexType>
+
+<!-- Special Types -->
+<xsd:complexType name="DataObject" abstract="true"/>
+
+<xsd:complexType name="TextType" abstract="true">
+ <xsd:sequence>
+ <xsd:element name="text" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<!-- ChangeSummaryType is defined in datagraph.xsd.
+ Although declared there as a ComplexType,
+ at the model level it is treated as a SimpleType
+ with a special XML serialization.
+-->
+
+
+<!-- Data Types -->
+<xsd:simpleType name="Boolean" sdoJava:instanceClass="boolean">
+ <xsd:restriction base="xsd:boolean"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Byte" sdoJava:instanceClass="byte">
+ <xsd:restriction base="xsd:byte"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Bytes" sdoJava:instanceClass="byte[]">
+ <xsd:restriction base="xsd:hexBinary"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Character" sdoJava:instanceClass="char">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Date" sdoJava:instanceClass="java.util.Date">
+ <xsd:restriction base="xsd:dateTime"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="DateTime" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:dateTime"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Day" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gDay"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Decimal" sdoJava:instanceClass="java.math.BigDecimal">
+ <xsd:restriction base="xsd:decimal"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Double" sdoJava:instanceClass="double">
+ <xsd:restriction base="xsd:double"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Duration" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:duration"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Float" sdoJava:instanceClass="float">
+ <xsd:restriction base="xsd:float"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Int" sdoJava:instanceClass="int">
+ <xsd:restriction base="xsd:int"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Integer" sdoJava:instanceClass="java.math.BigInteger">
+ <xsd:restriction base="xsd:integer"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Long" sdoJava:instanceClass="long">
+ <xsd:restriction base="xsd:long"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Month" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gMonth"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="MonthDay" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gMonthDay"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Object" sdoJava:instanceClass="java.lang.Object">
+ <!-- Only the schema for schemas is allowed to restrict anySimpleType.
+ <xsd:restriction base="xsd:anySimpleType"/>
+ The equivalent declaration is a union of the predefined XSD data types.
+ -->
+ <xsd:union memberTypes="xsd:anyURI xsd:base64Binary xsd:boolean xsd:byte
+ xsd:date xsd:dateTime xsd:decimal xsd:double xsd:duration xsd:ENTITIES xsd:ENTITY xsd:float
+ xsd:gDay xsd:gMonth xsd:gMonthDay xsd:gYear xsd:gYearMonth xsd:hexBinary xsd:ID xsd:IDREF xsd:IDREFS
+ xsd:int xsd:integer xsd:language xsd:long xsd:Name xsd:NCName xsd:negativeInteger
+ xsd:NMTOKEN xsd:NMTOKENS xsd:nonNegativeInteger xsd:nonPositiveInteger
+ xsd:normalizedString xsd:NOTATION xsd:positiveInteger xsd:QName xsd:short xsd:string
+ xsd:time xsd:token xsd:unsignedByte xsd:unsignedInt xsd:unsignedLong xsd:unsignedShort"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Short" sdoJava:instanceClass="short">
+ <xsd:restriction base="xsd:short"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="String" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Strings" sdoJava:instanceClass="java.util.List">
+ <xsd:restriction base="xsd:string"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Time" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:time"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="Year" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gYear"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="YearMonth" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:gYearMonth"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="YearMonthDay" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:date"/>
+</xsd:simpleType>
+
+<xsd:simpleType name="URI" sdoJava:instanceClass="java.lang.String">
+ <xsd:restriction base="xsd:anyURI"/>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xml b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xml
new file mode 100644
index 0000000000..ac831576fb
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<types xmlns="commonj.sdo"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xsi:schemaLocation="commonj.sdo sdoModel.xsd commonj.sdo/java sdoJava.xsd commonj.sdo/xml sdoXML.xsd">
+
+<!--
+ XMLInfo declares properties used in open content for
+ the XML binding of SDO Types and Properties.
+-->
+
+ <type name="XMLInfo" uri="commonj.sdo/xml">
+ <property name="xmlElement" type="commonj.sdo#Boolean"/>
+ </type>
+
+</types>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xsd b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xsd
new file mode 100644
index 0000000000..88fc7daaf6
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/main/resources/xml/sdoXML.xsd
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/**
+ * <copyright>
+ *
+ * Service Data Objects
+ * Version 2.0
+ * Licensed Materials - Property of BEA and IBM
+ *
+ * (c) Copyright BEA Systems, Inc. and International Business Machines Corp 2005. All rights reserved.
+ *
+ * </copyright>
+ *
+ */
+-->
+
+<xsd:schema
+ targetNamespace="commonj.sdo/xml"
+ xmlns:sdo="commonj.sdo"
+ xmlns:sdoXML="commonj.sdo/xml"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:import namespace="commonj.sdo" schemaLocation="sdoModel.xsd"/>
+
+
+<!--
+ These attributes are used to customize the XSD mapping of SDO Types and Properties.
+-->
+
+<xsd:attribute name="name" type="xsd:string" />
+<xsd:attribute name="propertyType" type="xsd:QName" />
+<xsd:attribute name="oppositeProperty" type="xsd:string" />
+<xsd:attribute name="sequence" type="xsd:boolean" />
+<xsd:attribute name="string" type="xsd:boolean" />
+<xsd:attribute name="dataType" type="xsd:QName" />
+<xsd:attribute name="aliasName" type="xsd:string" />
+<xsd:attribute name="readOnly" type="xsd:boolean" />
+
+<!--
+ XMLInfo declares properties used in open content for
+ the XML binding of SDO Types and Properties.
+-->
+
+<xsd:complexType name="XMLInfo">
+ <xsd:attribute name="xmlElement" type="sdo:Boolean"/>
+</xsd:complexType>
+
+</xsd:schema>
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java
new file mode 100644
index 0000000000..8854e936b7
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/commonj/sdo/impl/HelperProviderTestCase.java
@@ -0,0 +1,90 @@
+/**
+ *
+ * Copyright 2005 International Business Machines Corporation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package commonj.sdo.impl;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import junit.framework.TestCase;
+import test.DefaultHelperProvider;
+import test.TCCL1HelperProvider;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class HelperProviderTestCase extends TestCase {
+ private URL classes;
+ private URL testClasses;
+ private URL def;
+ private URL tccl1;
+
+ public void testInstanceIsNullWithNoImplementation() throws Exception {
+ assertNull(HelperProvider.INSTANCE);
+ }
+
+ public void testDefaultInstance() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, def, testClasses}, null);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Class implClass = cl.loadClass(DefaultHelperProvider.class.getName());
+ Object instance = providerClass.getField("INSTANCE").get(null);
+ assertNotNull(instance);
+ assertEquals(implClass, instance.getClass());
+ }
+
+ public void testLocateFromClassLoader() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Object provider = providerClass.getMethod("getInstance", new Class[] {ClassLoader.class})
+ .invoke(null, new Object[] {cl});
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName());
+ }
+
+ public void testThreadContextInstance() throws Exception {
+ ClassLoader cl = new URLClassLoader(new URL[]{classes, tccl1, testClasses}, null);
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ Thread.currentThread().setContextClassLoader(cl);
+ Class providerClass = cl.loadClass(HelperProvider.class.getName());
+ Object provider = providerClass.getMethod("getInstance", new Class[0]).invoke(null, new Object[0]);
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class.getName(), provider.getClass().getName());
+ } finally {
+ Thread.currentThread().setContextClassLoader(tccl);
+ }
+
+ }
+
+ public void testSystemProperty() {
+ System.setProperty("commonj.sdo.impl.HelperProvider", "test.TCCL1HelperProvider");
+ try {
+ HelperProvider provider = HelperProvider.getInstance();
+ assertNotNull(provider);
+ assertEquals(TCCL1HelperProvider.class, provider.getClass());
+ } finally {
+ System.getProperties().remove("commonj.sdo.impl.HelperProvider");
+ }
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ classes = new URL(HelperProvider.class.getResource("HelperProvider.class"), "../../..");
+ testClasses = new URL(HelperProviderTestCase.class.getResource("HelperProviderTestCase.class"), "../../..");
+ tccl1 = new URL(testClasses, "tccl1/");
+ def = new URL(testClasses, "default/");
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/DefaultHelperProvider.java b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/DefaultHelperProvider.java
new file mode 100644
index 0000000000..77d6206972
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/DefaultHelperProvider.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package test;
+
+import commonj.sdo.impl.HelperProvider;
+import commonj.sdo.impl.ExternalizableDelegator;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class DefaultHelperProvider extends HelperProvider {
+ public CopyHelper copyHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataFactory dataFactory() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataHelper dataHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public EqualityHelper equalityHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public TypeHelper typeHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLHelper xmlHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XSDHelper xsdHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable(Object target) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/TCCL1HelperProvider.java b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/TCCL1HelperProvider.java
new file mode 100644
index 0000000000..05b1b04925
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/test/java/test/TCCL1HelperProvider.java
@@ -0,0 +1,71 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package test;
+
+import commonj.sdo.impl.HelperProvider;
+import commonj.sdo.impl.ExternalizableDelegator;
+import commonj.sdo.helper.CopyHelper;
+import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.DataHelper;
+import commonj.sdo.helper.EqualityHelper;
+import commonj.sdo.helper.TypeHelper;
+import commonj.sdo.helper.XMLHelper;
+import commonj.sdo.helper.XSDHelper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class TCCL1HelperProvider extends HelperProvider {
+ public CopyHelper copyHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataFactory dataFactory() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DataHelper dataHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public EqualityHelper equalityHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public TypeHelper typeHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XMLHelper xmlHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public XSDHelper xsdHelper() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable() {
+ throw new UnsupportedOperationException();
+ }
+
+ public ExternalizableDelegator.Resolvable resolvable(Object target) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider b/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider
new file mode 100644
index 0000000000..5175e5abea
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/default/META-INF/services/commonj.sdo.impl.HelperProvider
@@ -0,0 +1,3 @@
+# test comment and blank line
+
+ test.DefaultHelperProvider # comment
diff --git a/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider b/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider
new file mode 100644
index 0000000000..fa88e4c705
--- /dev/null
+++ b/tags/java/spec/sdo/1.0-incubator-M2/src/test/resources/tccl1/META-INF/services/commonj.sdo.impl.HelperProvider
@@ -0,0 +1 @@
+test.TCCL1HelperProvider