summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-06 22:09:05 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-06 22:09:05 +0000
commit932b59dfbb4797065ad91e06cce1440de1121034 (patch)
tree6437ec26b6c4826eca7480a17ff2303bd9aa8339
parent9aa721de373ccaa527183aee0f7217349f982531 (diff)
Add a few annotations for intents/policySets
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@751099 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/PaymentImpl.java2
-rw-r--r--sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/creditcard/CreditCardPaymentImpl.java5
-rw-r--r--sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistry.java2
-rw-r--r--sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistryImpl.java2
4 files changed, 10 insertions, 1 deletions
diff --git a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/PaymentImpl.java b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/PaymentImpl.java
index a0218aa583..cd2a096632 100644
--- a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/PaymentImpl.java
+++ b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/PaymentImpl.java
@@ -19,6 +19,7 @@
package payment;
+import org.osoa.sca.annotations.Authentication;
import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
@@ -39,6 +40,7 @@ public class PaymentImpl implements Payment {
protected CustomerRegistry customerRegistry;
@Reference
+ @Authentication
protected CreditCardPayment creditCardPayment;
@Reference
diff --git a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/creditcard/CreditCardPaymentImpl.java b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/creditcard/CreditCardPaymentImpl.java
index ed86c4d482..b70c4b0135 100644
--- a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/creditcard/CreditCardPaymentImpl.java
+++ b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/payment/creditcard/CreditCardPaymentImpl.java
@@ -19,9 +19,14 @@
package payment.creditcard;
+import javax.annotation.security.RolesAllowed;
+
+import org.osoa.sca.annotations.Requires;
import org.osoa.sca.annotations.Service;
@Service(CreditCardPayment.class)
+@Requires("{http://www.osoa.org/xmlns/sca/1.0}authorization")
+@RolesAllowed("Admin")
public class CreditCardPaymentImpl implements CreditCardPayment {
public String authorize(CreditCardDetailsType creditCard, float amount) {
diff --git a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistry.java b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistry.java
index 7b339cc60d..0a23f6a81a 100644
--- a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistry.java
+++ b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistry.java
@@ -24,7 +24,7 @@ import java.util.Collection;
import payment.creditcard.CreditCardDetailsType;
/**
- *
+ * Customer registry interface
*/
public interface CustomerRegistry {
Customer createCustomer(String name, String email, CreditCardDetailsType creditCard);
diff --git a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistryImpl.java b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistryImpl.java
index 8807d037ba..8a55e43fc5 100644
--- a/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistryImpl.java
+++ b/sandbox/travelsample/shared-contributions/payment-java-contribution/src/main/java/scatours/customer/CustomerRegistryImpl.java
@@ -26,6 +26,7 @@ import java.util.Map;
import org.osoa.sca.annotations.Destroy;
import org.osoa.sca.annotations.EagerInit;
import org.osoa.sca.annotations.Init;
+import org.osoa.sca.annotations.Requires;
import org.osoa.sca.annotations.Scope;
import org.osoa.sca.annotations.Service;
@@ -40,6 +41,7 @@ import payment.creditcard.PayerType;
@Service(CustomerRegistry.class)
@Scope("COMPOSITE")
@EagerInit
+@Requires("{http://www.osoa.org/xmlns/sca/1.0}managedTransaction.global")
public class CustomerRegistryImpl implements CustomerRegistry {
private volatile static int idGenerator = 0;
private Map<String, Customer> customers = new HashMap<String, Customer>();