diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /tags/java-stable-20060304/spec/sca |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tags/java-stable-20060304/spec/sca')
36 files changed, 1721 insertions, 0 deletions
diff --git a/tags/java-stable-20060304/spec/sca/LICENSE.txt b/tags/java-stable-20060304/spec/sca/LICENSE.txt new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/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-stable-20060304/spec/sca/pom.xml b/tags/java-stable-20060304/spec/sca/pom.xml new file mode 100644 index 0000000000..b58e5845b4 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/pom.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * 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. + --> +<project> + <parent> + <groupId>org.osoa</groupId> + <artifactId>spec</artifactId> + <version>SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>sca-api</artifactId> + <name>SCA API</name> + <version>SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>commonj</groupId> + <artifactId>sdo-api</artifactId> + <version>SNAPSHOT</version> + <scope>provided</scope> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java new file mode 100644 index 0000000000..84fb9ba95a --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/CurrentModuleContext.java @@ -0,0 +1,42 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca; + +/** + * Class providing access to the current ModuleContext. + * <p/> + * The current context is set by the SCA container implementation before dispatching + * a request to any component in the module. + * + * @version $Rev$ $Date$ + */ +public final class CurrentModuleContext { + private static final ThreadLocal CURRENT_CONTEXT = new InheritableThreadLocal(); + + /** + * Return the current ModuleContext. + * + * @return the current ModuleContext + */ + public static ModuleContext getContext() { + return (ModuleContext) CURRENT_CONTEXT.get(); + } + + static void setContext(ModuleContext ctx) { + CURRENT_CONTEXT.set(ctx); + } +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java new file mode 100644 index 0000000000..e48235be3b --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ModuleContext.java @@ -0,0 +1,85 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca; + + +/** + * @version $Rev$ $Date$ + */ +public interface ModuleContext { + + /** + * Returns the name of the module. + * + * @return the name of the module + */ + String getName(); + + /** + * Returns the absolute URI of the module component. + * + * @return the absolute URI of the module component + */ + String getURI(); + +//FIXME This is not implemented yet, we need the SCA spec to define the metadata model first. +// /** +// * Returns the Module metadata object. +// * This represents the root <module> element in the SCA module definition. +// * +// * @return the module metadata object +// */ +// Module getMetaData(); + + /** + * 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 + */ + Object locateService(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); + + ServiceReference newSession(String serviceName); + + ServiceReference newSession(String serviceName, Object sessionId); +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java new file mode 100644 index 0000000000..11e693f603 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java @@ -0,0 +1,39 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca; + +/** + * @version $Rev$ $Date$ + */ +public class NoRegisteredCallbackException extends ServiceRuntimeException { + private static final long serialVersionUID = 3734864942222558406L; + + public NoRegisteredCallbackException() { + } + + public NoRegisteredCallbackException(String message) { + super(message); + } + + public NoRegisteredCallbackException(String message, Throwable cause) { + super(message, cause); + } + + public NoRegisteredCallbackException(Throwable cause) { + super(cause); + } +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java new file mode 100644 index 0000000000..e5f3ee63b1 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/RequestContext.java @@ -0,0 +1,47 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java new file mode 100644 index 0000000000..e74a3def11 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SCA.java @@ -0,0 +1,49 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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.CurrentModuleContext#getContext()}. + * + * @param ctx the new current module context + */ + protected static void setModuleContext(ModuleContext ctx) { + CurrentModuleContext.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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java new file mode 100644 index 0000000000..651b21a9b0 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceReference.java @@ -0,0 +1,67 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java new file mode 100644 index 0000000000..bea0af5f8d --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceRuntimeException.java @@ -0,0 +1,40 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca; + + +/** + * @version $Rev$ $Date$ + */ +public class ServiceRuntimeException extends RuntimeException { + private static final long serialVersionUID = -3876058842262557092L; + + public ServiceRuntimeException() { + } + + public ServiceRuntimeException(String message) { + super(message); + } + + public ServiceRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + public ServiceRuntimeException(Throwable cause) { + super(cause); + } +}
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java new file mode 100644 index 0000000000..8f51fc966c --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/ServiceUnavailableException.java @@ -0,0 +1,64 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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); + } + +}
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java new file mode 100644 index 0000000000..4bdb82f9da --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/SessionEndedException.java @@ -0,0 +1,39 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca; + +/** + * @version $Rev$ $Date$ + */ +public class SessionEndedException extends ServiceRuntimeException { + private static final long serialVersionUID = 3734864942222558406L; + + public SessionEndedException() { + } + + public SessionEndedException(String message) { + super(message); + } + + public SessionEndedException(String message, Throwable cause) { + super(message, cause); + } + + public SessionEndedException(Throwable cause) { + super(cause); + } +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java new file mode 100644 index 0000000000..6f3ab8fb4e --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/Version.java @@ -0,0 +1,43 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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 0.9 + */ + public static final String VERSION_0_9 = "0.9"; + + /** + * Identifier for the XML Namespace for version 0.9 + */ + public static final String XML_NAMESPACE_0_9 = "http://www.osoa.org/xmlns/sca/0.9"; + + /** + * The specification version of these API classes. + */ + public static final String API_VERSION = VERSION_0_9; + + private Version() { + } +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java new file mode 100644 index 0000000000..c972c44468 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java @@ -0,0 +1,32 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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; + +/** + * @version $Rev$ $Date$ + */ +@Target({TYPE, METHOD}) +@Retention(RUNTIME) +public @interface AllowsPassByReference { +} + diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java new file mode 100644 index 0000000000..19bc9ab624 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Callback.java @@ -0,0 +1,31 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca.annotations; + +import static java.lang.annotation.ElementType.*; +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import java.lang.annotation.Target; + +/** + * @version $Rev$ $Date$ + */ +@Target({TYPE, METHOD, FIELD}) +@Retention(RUNTIME) +public @interface Callback { + Class<?> value() default Void.class; +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java new file mode 100644 index 0000000000..c35b023ea4 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentMetaData.java @@ -0,0 +1,33 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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 metadata object. + * + * @version $Rev$ $Date$ + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) +public @interface ComponentMetaData { +} diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java new file mode 100644 index 0000000000..46a117ea04 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/ComponentName.java @@ -0,0 +1,33 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java new file mode 100644 index 0000000000..1139e97a96 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Context.java @@ -0,0 +1,34 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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 ModuleContext. + * + * @version $Rev$ $Date$ + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) +public @interface Context { +} + diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java new file mode 100644 index 0000000000..c75e0fc165 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Destroy.java @@ -0,0 +1,33 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java new file mode 100644 index 0000000000..94745a64d2 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Init.java @@ -0,0 +1,39 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java new file mode 100644 index 0000000000..b9cee1765a --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Property.java @@ -0,0 +1,43 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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 a configuration property value. + * + * @version $Rev$ $Date$ + */ +@Target({METHOD, FIELD}) +@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 boolean required() default false; +} + diff --git a/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java new file mode 100644 index 0000000000..f7f390da0d --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Reference.java @@ -0,0 +1,43 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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 a reference. + * + * @version $Rev$ $Date$ + */ +@Target({METHOD, FIELD}) +@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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java new file mode 100644 index 0000000000..4048e240b6 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Remotable.java @@ -0,0 +1,34 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java new file mode 100644 index 0000000000..2e0f474687 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Scope.java @@ -0,0 +1,42 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java new file mode 100644 index 0000000000..3c51316c14 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Service.java @@ -0,0 +1,41 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java new file mode 100644 index 0000000000..11a90d3159 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/Session.java @@ -0,0 +1,49 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java new file mode 100644 index 0000000000..86d9605bb6 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/java/org/osoa/sca/annotations/SessionID.java @@ -0,0 +1,33 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF b/tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..f1f6da216d --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: SCA APIs +Bundle-SymbolicName: org.apache.tuscany.sca.spec +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Bundle-Vendor: Apache +Export-Package: org.osoa.sca, org.osoa.sca.annotations, org.osoa.sca.model diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd new file mode 100644 index 0000000000..2e379cfa59 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-sca.xsd @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd new file mode 100644 index 0000000000..51b6458958 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-binding-webservice.xsd @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd new file mode 100644 index 0000000000..a92bb4d0bf --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-core.xsd @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd new file mode 100644 index 0000000000..cf155e3dfb --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-implementation-java.xsd @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd new file mode 100644 index 0000000000..b0f9aec48c --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-java.xsd @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd new file mode 100644 index 0000000000..7f67de3d29 --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca-interface-wsdl.xsd @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd new file mode 100644 index 0000000000..b0493eb42e --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/main/resources/schemas/sca.xsd @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- (c) Copyright BEA Systems Inc. and IBM Corporation 2005 --> +<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>
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java new file mode 100644 index 0000000000..d45f1198fb --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/CallbackTestCase.java @@ -0,0 +1,57 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 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; + +/** + * @version $Rev$ $Date$ + */ +public class CallbackTestCase extends TestCase { + private Class<?> type; + private Field field; + private Method method; + + public void testTypeDeclaration() { + assertTrue(type.isAnnotationPresent(Callback.class)); + Callback callback = type.getAnnotation(Callback.class); + assertEquals(Object.class, callback.value()); + } + + public void testField() { + assertTrue(field.isAnnotationPresent(Callback.class)); + Callback callback = field.getAnnotation(Callback.class); + assertEquals(Void.class, callback.value()); + } + + 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"); + } +}
\ No newline at end of file diff --git a/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java new file mode 100644 index 0000000000..e43e8f146e --- /dev/null +++ b/tags/java-stable-20060304/spec/sca/src/test/java/org/osoa/sca/annotations/usage/CallbackType.java @@ -0,0 +1,32 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * 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 org.osoa.sca.annotations.usage; + +import org.osoa.sca.annotations.Callback; + +/** + * @version $Rev$ $Date$ + */ +@Callback(Object.class) +public class CallbackType { + @Callback + private Object cbField; + + @Callback + public void cbMethod() { + } +} |