From 1765edfcd534f3c08534924477a62fb0e250284f Mon Sep 17 00:00:00 2001 From: slaws Date: Wed, 12 Oct 2011 15:16:07 +0000 Subject: TUSCANY-3960 - Create implementation level operation model and add jsr250 module into build git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1182420 13f79535-47bb-0310-9956-ffa450edef68 --- .../implementation/java/introspect/impl/PolicyProcessor.java | 12 ++++++++---- sca-java-2.x/trunk/modules/pom.xml | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x/trunk') diff --git a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java index 15d31a5ad9..1c7ae6d0d7 100644 --- a/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java +++ b/sca-java-2.x/trunk/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java @@ -33,6 +33,7 @@ import javax.xml.namespace.QName; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.Reference; +import org.apache.tuscany.sca.assembly.Service; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.implementation.java.IntrospectionException; @@ -40,7 +41,10 @@ import org.apache.tuscany.sca.implementation.java.JavaElementImpl; import org.apache.tuscany.sca.implementation.java.JavaImplementation; import org.apache.tuscany.sca.implementation.java.JavaParameterImpl; import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor; +import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; +import org.apache.tuscany.sca.interfacedef.java.JavaOperation; +import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil; import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicyFactory; import org.apache.tuscany.sca.policy.PolicySet; @@ -79,9 +83,8 @@ public class PolicyProcessor extends BaseJavaClassVisitor { // Read intents on the Java implementation class readPolicySetAndIntents((PolicySubject)type, clazz); - /* - // FIXME: [rfeng] We might want to refactor this out // Find the business methods in the implementation class for all services + // this operation collection will have policy added to it relating to JSR250 annotations Set methods = new HashSet(); for (Service service : type.getServices()) { for (Operation op : service.getInterfaceContract().getInterface().getOperations()) { @@ -100,7 +103,9 @@ public class PolicyProcessor extends BaseJavaClassVisitor { JavaOperation op = javaInterfaceFactory.createJavaOperation(method); type.getOperations().add(op); } - + + /* In OASIS we don't generally read policy attached to arbitrary methods + * unless they relate to references // Read the operation-level policy settings for the implementation for (Operation op : type.getOperations()) { JavaOperation operation = (JavaOperation)op; @@ -122,7 +127,6 @@ public class PolicyProcessor extends BaseJavaClassVisitor { Reference reference = referenceMap.get(e.getKey()); readPolicySetAndIntents(reference, e.getValue().getAnchor()); } - } private void readPolicySetAndIntents(PolicySubject subject, AnnotatedElement element) { diff --git a/sca-java-2.x/trunk/modules/pom.xml b/sca-java-2.x/trunk/modules/pom.xml index 6b92607c84..0d108b683b 100644 --- a/sca-java-2.x/trunk/modules/pom.xml +++ b/sca-java-2.x/trunk/modules/pom.xml @@ -121,6 +121,7 @@ node-manager policy-logging policy-security + policy-security-jsr250 policy-transaction policy-transaction-runtime policy-transaction-runtime-geronimo -- cgit v1.2.3