From 04ba0404fe327a0932f88e8b803bda3add2786b6 Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 17 Oct 2011 13:54:43 +0000 Subject: Correct JSR250 policy processor package name in services definition git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1185171 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/policy/security/jsr250/JSR250PolicyProcessor.java | 7 +++++++ ...e.tuscany.sca.implementation.java.introspect.JavaClassVisitor | 2 +- sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml | 6 ++++++ .../tuscany/sca/itest/interfaces/ServiceComponentImpl.java | 9 +++++---- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/policy/security/jsr250/JSR250PolicyProcessor.java b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/policy/security/jsr250/JSR250PolicyProcessor.java index ca1fb12f38..fffb366dfa 100644 --- a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/policy/security/jsr250/JSR250PolicyProcessor.java +++ b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/java/org/apache/tuscany/sca/policy/security/jsr250/JSR250PolicyProcessor.java @@ -28,6 +28,8 @@ import javax.xml.namespace.QName; import org.apache.tuscany.sca.assembly.AssemblyFactory; import org.apache.tuscany.sca.assembly.xml.Constants; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; +import org.apache.tuscany.sca.core.FactoryExtensionPoint; import org.apache.tuscany.sca.implementation.java.IntrospectionException; import org.apache.tuscany.sca.implementation.java.JavaImplementation; import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor; @@ -58,6 +60,11 @@ public class JSR250PolicyProcessor extends BaseJavaClassVisitor { private PolicyFactory policyFactory; + public JSR250PolicyProcessor(ExtensionPointRegistry registry) { + super(registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(AssemblyFactory.class)); + this.policyFactory = registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(PolicyFactory.class); + } + public JSR250PolicyProcessor(AssemblyFactory assemblyFactory, PolicyFactory policyFactory) { super(assemblyFactory); this.policyFactory = policyFactory; diff --git a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor index 841d89fb9a..37bff7cc10 100644 --- a/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor +++ b/sca-java-2.x/trunk/modules/policy-security-jsr250/src/main/resources/META-INF/services/org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor @@ -17,4 +17,4 @@ # # NOTE: The ranking attribute is important for the JavaClassVistors # Some visitors need to be called after the others -org.apache.tuscany.sca.implementation.java.introspect.impl.JSR250PolicyProcessor;ranking=600 \ No newline at end of file +org.apache.tuscany.sca.policy.security.jsr250.JSR250PolicyProcessor;ranking=600 \ No newline at end of file diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml b/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml index f49d84a8f1..2d476ac232 100644 --- a/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml +++ b/sca-java-2.x/trunk/testing/itest/interface-matching/pom.xml @@ -69,6 +69,12 @@ 2.0-SNAPSHOT + + org.apache.tuscany.sca + tuscany-policy-security-jsr250 + 2.0-SNAPSHOT + + org.codehaus.woodstox wstx-asl diff --git a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java index cfc53da0d4..aee96e4737 100644 --- a/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java +++ b/sca-java-2.x/trunk/testing/itest/interface-matching/src/main/java/org/apache/tuscany/sca/itest/interfaces/ServiceComponentImpl.java @@ -18,10 +18,12 @@ */ package org.apache.tuscany.sca.itest.interfaces; +import javax.annotation.security.RolesAllowed; + import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Reference; import org.oasisopen.sca.annotation.Service; +@RolesAllowed({"Role1"}) @Service(ServiceComponent.class) public class ServiceComponentImpl implements ServiceComponent { @@ -30,6 +32,7 @@ public class ServiceComponentImpl implements ServiceComponent { private static ParameterObject po; + @RolesAllowed({"Role2", "Role3"}) public String foo(String str) { return str; } @@ -46,9 +49,7 @@ public class ServiceComponentImpl implements ServiceComponent { po = new ParameterObject("CallBack"); callback.modifyParameter(po); } - - - + public ParameterObject getPO() { return po; } -- cgit v1.2.3