diff options
Diffstat (limited to '')
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 @@ -70,6 +70,12 @@ </dependency>
<dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-security-jsr250</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
<groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId>
<version>3.2.9</version>
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;
}
|