summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-06-14 09:48:46 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-06-14 09:48:46 +0000
commit6aeeff9e3b0b2a75f808d4937fd63312a632ba65 (patch)
tree01a4ac59516a7af39150b0302e42d30a77b5f630 /sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java
parent5d8998148b1de990559f6617f09b518d3ab324fe (diff)
TUSCANY-3873 - start of a test case to check out policy matching and to look at where an how policy interceptors are added along the reference, service and binding chains
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1135444 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java b/sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java
new file mode 100644
index 0000000000..90cf5e6523
--- /dev/null
+++ b/sca-java-2.x/trunk/testing/itest/policy/interceptors/src/main/java/testpolicy/TestPolicyProviderImplementation.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package testpolicy;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.provider.BasePolicyProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * @version $Rev: 792641 $ $Date: 2009-07-09 20:13:08 +0100 (Thu, 09 Jul 2009) $
+ */
+public class TestPolicyProviderImplementation extends BasePolicyProvider<TestPolicy> {
+
+ public TestPolicyProviderImplementation(RuntimeComponent component) {
+ super(TestPolicy.class, component);
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
+ */
+ public PhasedInterceptor createInterceptor(Operation operation) {
+ List<TestPolicy> policies = findPolicies();
+ return policies.isEmpty() ? null : new TestPolicyInterceptor(subject, getContext(), operation,
+ policies, Phase.IMPLEMENTATION_POLICY);
+ }
+
+}