From 05d8f2395c62454bc8bc5041a4b577d2d429439a Mon Sep 17 00:00:00 2001 From: edwardsmj Date: Fri, 2 Oct 2009 13:31:48 +0000 Subject: New SCA Java annotations, as defined in the OASIS SCA Java CAA V1.1 specification, as described in TUSCANY-3293 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@821015 13f79535-47bb-0310-9956-ffa450edef68 --- .../oasisopen/sca/annotation/Authorization.java | 30 ++++++++++++++++ .../sca/annotation/ManagedSharedTransaction.java | 29 ++++++++++++++++ .../sca/annotation/ManagedTransaction.java | 40 ++++++++++++++++++++++ .../sca/annotation/MutualAuthentication.java | 30 ++++++++++++++++ .../sca/annotation/NoManagedTransaction.java | 29 ++++++++++++++++ 5 files changed, 158 insertions(+) create mode 100644 java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authorization.java create mode 100644 java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedSharedTransaction.java create mode 100644 java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java create mode 100644 java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/MutualAuthentication.java create mode 100644 java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/NoManagedTransaction.java (limited to 'java/sca/modules/sca-api/src') diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authorization.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authorization.java new file mode 100644 index 0000000000..76fcd866ae --- /dev/null +++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/Authorization.java @@ -0,0 +1,30 @@ +/* + * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. + * OASIS trademark, IPR and other policies apply. + */ +package org.oasisopen.sca.annotation; + +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 static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.oasisopen.sca.Constants.SCA_PREFIX; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The @Authorization annotation is used to indicate that + * an authorization policy is required - for a method, for an implementation class, for a reference + * (either injected as a method parameter or injected into a field) + */ +@Inherited +@Target({TYPE, FIELD, METHOD, PARAMETER}) +@Retention(RUNTIME) +@Intent(Authorization.AUTHORIZATION) +public @interface Authorization { + String AUTHORIZATION = SCA_PREFIX + "authorization"; +} + diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedSharedTransaction.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedSharedTransaction.java new file mode 100644 index 0000000000..b12050a3e3 --- /dev/null +++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedSharedTransaction.java @@ -0,0 +1,29 @@ +/* + * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. + * OASIS trademark, IPR and other policies apply. + */ +package org.oasisopen.sca.annotation; + +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 static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.oasisopen.sca.Constants.SCA_PREFIX; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The @ManagedSharedTransaction annotation is used to indicate that + * a distributed ACID transaction is required. + */ +@Inherited +@Target({TYPE, FIELD, METHOD, PARAMETER}) +@Retention(RUNTIME) +@Intent(ManagedSharedTransaction.MANAGEDSHAREDTRANSACTION) +public @interface ManagedSharedTransaction { + String MANAGEDSHAREDTRANSACTION = SCA_PREFIX + "managedSharedTransaction"; +} + diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java new file mode 100644 index 0000000000..7115e8a5e9 --- /dev/null +++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/ManagedTransaction.java @@ -0,0 +1,40 @@ +/* + * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. + * OASIS trademark, IPR and other policies apply. + */ +package org.oasisopen.sca.annotation; + +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 static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.oasisopen.sca.Constants.SCA_PREFIX; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The @ManagedTransaction annotation is used to indicate the + * need for an ACID transaction environment. + */ +@Inherited +@Target({TYPE, FIELD, METHOD, PARAMETER}) +@Retention(RUNTIME) +@Intent(ManagedTransaction.MANAGEDTRANSACTION) +public @interface ManagedTransaction { + String MANAGEDTRANSACTION = SCA_PREFIX + "managedTransaction"; + String MANAGEDTRANSACTION_MESSAGE = MANAGEDTRANSACTION + ".local"; + String MANAGEDTRANSACTION_TRANSPORT = MANAGEDTRANSACTION + ".global"; + + /** + * List of managedTransaction qualifiers (such as "global" or "local"). + * + * @return managedTransaction qualifiers + */ + @Qualifier + String[] value() default ""; +} + + diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/MutualAuthentication.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/MutualAuthentication.java new file mode 100644 index 0000000000..d0825cd8e3 --- /dev/null +++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/MutualAuthentication.java @@ -0,0 +1,30 @@ +/* + * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. + * OASIS trademark, IPR and other policies apply. + */ +package org.oasisopen.sca.annotation; + +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 static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.oasisopen.sca.Constants.SCA_PREFIX; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The @MutualAuthentication annotation is used to indicate that + * a mutual authentication policy is needed. + */ +@Inherited +@Target({TYPE, FIELD, METHOD, PARAMETER}) +@Retention(RUNTIME) +@Intent(MutualAuthentication.MUTUALAUTHENTICATION) +public @interface MutualAuthentication { + String MUTUALAUTHENTICATION = SCA_PREFIX + "mutualAuthentication"; +} + + diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/NoManagedTransaction.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/NoManagedTransaction.java new file mode 100644 index 0000000000..b5ff494ca2 --- /dev/null +++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/annotation/NoManagedTransaction.java @@ -0,0 +1,29 @@ +/* + * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. + * OASIS trademark, IPR and other policies apply. + */ +package org.oasisopen.sca.annotation; + +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 static java.lang.annotation.RetentionPolicy.RUNTIME; +import static org.oasisopen.sca.Constants.SCA_PREFIX; + +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * The @NoManagedTransaction annotation is used to indicate that + * a non-transactional environment is needed. + */ +@Inherited +@Target({TYPE, FIELD, METHOD, PARAMETER}) +@Retention(RUNTIME) +@Intent(NoManagedTransaction.NOMANAGEDTRANSACTION) +public @interface NoManagedTransaction { + String NOMANAGEDTRANSACTION = SCA_PREFIX + "noManagedTransaction"; +} + -- cgit v1.2.3