diff options
Diffstat (limited to '')
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>(); |