tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1349957 - in /tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources: ./ src/main/java/ src/main/java/__policyName__/ src/main/java/__policyName__/provider/ src/main/java/profile/ src/main/java/util/ src/...
Date Wed, 13 Jun 2012 16:50:01 GMT
Author: lresende
Date: Wed Jun 13 16:50:00 2012
New Revision: 1349957

URL: http://svn.apache.org/viewvc?rev=1349957&view=rev
Log:
TUSCANY-4064 - Applying patch from Nitya Doraisamy to enhance policy maven archetype

Added:
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__Policy.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyBuilder.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyFactory.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyProcessor.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ImplementationPolicyProvider.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyInterceptor.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyProviderFactory.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ReferencePolicyProvider.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ServicePolicyProvider.java
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/PolicyHelper.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/definitions.xml
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/mock_policies.xml
      - copied, changed from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
Modified:
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml Wed Jun 13 16:50:00 2012
@@ -16,7 +16,8 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.    
---><project>
+-->
+<project>
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.tuscany.sca</groupId>
@@ -24,12 +25,12 @@
         <version>2.0-SNAPSHOT</version>
         <relativePath>../pom.xml</relativePath>
     </parent>
-    <artifactId>${artifactId}</artifactId>
     <groupId>${groupId}</groupId>
-    <name>Apache Tuscany SCA Extension Policy Logging Model</name>
+    <artifactId>${artifactId}</artifactId>
+    <name>Apache Tuscany SCA Extension Policy ${policyName}</name>
+    <version>${version}</version>
     
     <dependencies>
-    	        
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-core-runtime-pom</artifactId>
@@ -37,9 +38,6 @@
             <scope>provided</scope>
             <version>2.0-SNAPSHOT</version>
         </dependency>
-        
     </dependencies>
     
-    <version>${version}</version>
-
 </project>

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__Policy.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__Policy.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__Policy.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__Policy.java Wed Jun 13 16:50:00 2012
@@ -19,9 +19,7 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package ${package};
-
-import java.util.logging.Level;
+package ${package}.${policyName};
 
 import javax.xml.namespace.QName;
 
@@ -37,7 +35,7 @@ public class ${policyName}Policy {
     static final String SCA11_NS = Base.SCA11_NS;
     static final String SCA11_TUSCANY_NS = Base.SCA11_TUSCANY_NS;
     
-    static final QName POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "${policyName}");
+    public static final QName POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "${policyName}");
 
     private String configProperty;
 

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyBuilder.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyBuilder.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyBuilder.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyBuilder.java Wed Jun 13 16:50:00 2012
@@ -20,7 +20,7 @@
  * under the License.    
  */
 
-package ${package};
+package ${package}.${policyName};
 
 import java.util.ArrayList;
 import java.util.List;
@@ -42,28 +42,33 @@ import org.apache.tuscany.sca.policy.Pol
  */
 public class ${policyName}PolicyBuilder implements PolicyBuilder<${policyName}Policy> {
 
+	@Override
     public boolean build(Endpoint endpoint, BuilderContext context) {
         List<${policyName}Policy> polices = getPolicies(endpoint);
         System.out.println(endpoint + ": " + polices);
         return true;
     }
 
+	@Override
     public boolean build(EndpointReference endpointReference, BuilderContext context) {
         List<${policyName}Policy> polices = getPolicies(endpointReference);
         System.out.println(endpointReference + ": " + polices);
         return true;
     }
 
+	@Override
     public boolean build(Component component, Implementation implementation, BuilderContext context) {
         List<${policyName}Policy> polices = getPolicies(implementation);
         System.out.println(implementation + ": " + polices);
         return true;
     }
 
+	@Override
     public QName getPolicyType() {
         return ${policyName}Policy.POLICY_QNAME;
     }
-    
+	
+	@Override
     public List<QName> getSupportedBindings() {
         return null;
     }
@@ -80,6 +85,7 @@ public class ${policyName}PolicyBuilder 
         return polices;
     }
 
+    @Override
     public boolean build(EndpointReference endpointReference, Endpoint endpoint, BuilderContext context) {
         return true;
     }

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyFactory.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyFactory.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyFactory.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyFactory.java Wed Jun 13 16:50:00 2012
@@ -1,8 +1,7 @@
 #set( $symbol_pound = '#' )
 #set( $symbol_dollar = '$' )
 #set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="ASCII"?>
-<!--
+/*
  * 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
@@ -19,8 +18,20 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.    
--->
-<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
-	<logLevel>INFO</logLevel>
-	<resourceBundle>Trace_Messages.properties</resourceBundle>
-</tuscany:jdkLogger>
\ No newline at end of file
+ */
+package ${package}.${policyName};
+
+/**
+ * Factory for ${policyName} Policy
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ${policyName}PolicyFactory {
+
+
+    /**
+     * Creates a new ${policyName} Policy
+     * @return the new ${policyName} policy
+     */
+	${policyName}Policy create${policyName}Policy();
+}

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyProcessor.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyProcessor.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyProcessor.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/__policyName__PolicyProcessor.java Wed Jun 13 16:50:00 2012
@@ -19,13 +19,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package ${package};
+package ${package}.${policyName};
 
 import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
 import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
 
-import java.util.logging.Level;
-
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
@@ -44,15 +42,16 @@ import org.apache.tuscany.sca.core.Facto
  * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
  */
 public class ${policyName}PolicyProcessor implements StAXArtifactProcessor<${policyName}Policy> {
-    
-    public QName getArtifactType() {
-        return ${policyName}Policy.POLICY_QNAME;
-    }
-    
+	
     public ${policyName}PolicyProcessor(FactoryExtensionPoint modelFactories) {
     }
 
+    @Override
+    public QName getArtifactType() {
+        return ${policyName}Policy.POLICY_QNAME;
+    }
     
+    @Override
     public ${policyName}Policy read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
         ${policyName}Policy policy = new ${policyName}Policy();
         int event = reader.getEventType();
@@ -66,7 +65,7 @@ public class ${policyName}PolicyProcesso
                     name = reader.getName();
                     if ( name.equals(${policyName}Policy.POLICY_QNAME) ) {
                         String config = reader.getAttributeValue(null, "name");
-                        policy.setConfigurationProperty(config);
+                        policy.setConfigProperty(config);
                     }
                     break;
                 }
@@ -87,25 +86,28 @@ public class ${policyName}PolicyProcesso
         return policy;
     }
 
+    @Override
     public void write(${policyName}Policy policy, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException,
                                                         XMLStreamException {
         String prefix = "tuscany";
         writer.writeStartElement(prefix, 
-                                 POLICY_QNAME.getLocalPart(),
-                                 POLICY_QNAME.getNamespaceURI());
+        						 ${policyName}Policy.POLICY_QNAME.getLocalPart(),
+        						 ${policyName}Policy.POLICY_QNAME.getNamespaceURI());
         writer.writeNamespace("tuscany", ${policyName}Policy.SCA11_TUSCANY_NS);
         
-        if (policy.getConfigurationProperty() != null) {
-            writer.writeAttribute("name", policy.getConfigurationProperty());
+        if (policy.getConfigProperty() != null) {
+            writer.writeAttribute("name", policy.getConfigProperty());
         }
         
         writer.writeEndElement();
     }
 
+    @Override
     public Class<${policyName}Policy> getModelType() {
         return ${policyName}Policy.class;
     }
 
+    @Override
     public void resolve(${policyName}Policy arg0, ModelResolver arg1, ProcessorContext context) throws ContributionResolveException {
 
     }

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ImplementationPolicyProvider.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ImplementationPolicyProvider.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ImplementationPolicyProvider.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ImplementationPolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -20,19 +20,19 @@
  * under the License.    
  */
 
-package ${package};
+package ${package}.${policyName}.provider;
 
 import java.util.List;
 
+import org.apache.tuscany.sca.policy.PolicySet;
 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;
 
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.AuthorizationPolicy;
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.PolicySet;
-import com.shutterfly.middleware.tuscany.sca.policy.util.PolicyHelper;
+import ${package}.util.PolicyHelper;
+import ${package}.${policyName}.${policyName}Policy;
 
 /**
  * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
@@ -48,12 +48,16 @@ public class ${policyName}Implementation
     /**
      * @see ${groupId}.provider.PolicyProvider${symbol_pound}createInterceptor(${groupId}.interfacedef.Operation)
      */
+    @Override
     public PhasedInterceptor createInterceptor(Operation operation) {
         List<PolicySet> policySets = PolicyHelper.findPolicySets(component, ${policyName}Policy.POLICY_QNAME);
         
         
-        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(subject, getContext(), operation,
-                                                                           policySets, Phase.IMPLEMENTATION_POLICY);
+        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(getContext(), operation, getPhase());
+    }
+    
+    public String getPhase() {
+        return Phase.IMPLEMENTATION_POLICY;
     }
 
 }

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyInterceptor.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyInterceptor.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyInterceptor.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyInterceptor.java Wed Jun 13 16:50:00 2012
@@ -19,24 +19,12 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package ${package};
+package ${package}.${policyName}.provider;
 
-import java.util.List;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Invoker;
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySubject;
 
 /**
  * Policy handler to handle PolicySet related to Logging with the QName
@@ -47,31 +35,35 @@ import org.apache.tuscany.sca.policy.Pol
 public class ${policyName}PolicyInterceptor implements PhasedInterceptor {
     private Invoker next;
     private Operation operation;
-
+    private String context;
+    private String phase;
+    
     public ${policyName}PolicyInterceptor(String context, Operation operation, String phase) {
-
         super();
         this.operation = operation;
         this.context = context;
         this.phase = phase;
     }
 
+    @Override
     public Message invoke(Message msg) {
-       
         // DO SOMETHING HERE
         System.out.println("Inside policy interceptor invoke method");
         
-        return getNext.invoke(msg);
+        return getNext().invoke(msg);
     }
 
+    @Override
     public Invoker getNext() {
         return next;
     }
 
+    @Override
     public void setNext(Invoker next) {
         this.next = next;
     }
 
+    @Override
     public String getPhase() {
         return phase;
     }

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyProviderFactory.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyProviderFactory.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyProviderFactory.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__PolicyProviderFactory.java Wed Jun 13 16:50:00 2012
@@ -20,7 +20,7 @@
  * under the License.    
  */
 
-package ${package};
+package ${package}.${policyName}.provider;
 
 import org.apache.tuscany.sca.assembly.Endpoint;
 import org.apache.tuscany.sca.assembly.EndpointReference;
@@ -29,6 +29,8 @@ import org.apache.tuscany.sca.provider.P
 import org.apache.tuscany.sca.provider.PolicyProviderFactory;
 import org.apache.tuscany.sca.runtime.RuntimeComponent;
 
+import ${package}.${policyName}.${policyName}Policy;
+
 /**
  * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
  */
@@ -43,6 +45,7 @@ public class ${policyName}PolicyProvider
     /**
      * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createImplementationPolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.assembly.Implementation)
      */
+    @Override
     public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) {
         return new ${policyName}ImplementationPolicyProvider(component);
     }
@@ -50,6 +53,7 @@ public class ${policyName}PolicyProvider
     /**
      * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createReferencePolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.runtime.RuntimeComponentReference, ${groupId}.assembly.Binding)
      */
+    @Override
     public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) {
         return new ${policyName}ReferencePolicyProvider(endpointReference);
     }
@@ -57,6 +61,7 @@ public class ${policyName}PolicyProvider
     /**
      * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createServicePolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.runtime.RuntimeComponentService, ${groupId}.assembly.Binding)
      */
+    @Override
     public PolicyProvider createServicePolicyProvider(Endpoint endpoint) {
         return new ${policyName}ServicePolicyProvider(endpoint);
     }
@@ -64,6 +69,7 @@ public class ${policyName}PolicyProvider
     /**
      * @see ${groupId}.provider.ProviderFactory${symbol_pound}getModelType()
      */
+    @Override
     public Class<${policyName}Policy> getModelType() {
         return ${policyName}Policy.class;
     }

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ReferencePolicyProvider.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ReferencePolicyProvider.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ReferencePolicyProvider.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ReferencePolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -20,21 +20,19 @@
  * under the License.    
  */
 
-package ${package};
+package ${package}.${policyName}.provider;
 
 import java.util.List;
 
+import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.assembly.EndpointReference;
 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 com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.AuthorizationPolicyInterceptor;
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.PolicySet;
-import com.shutterfly.middleware.tuscany.sca.policy.metrics.PerformanceMetricsPolicy;
-import com.shutterfly.middleware.tuscany.sca.policy.util.PolicyHelper;
-
+import ${package}.util.PolicyHelper;
+import ${package}.${policyName}.${policyName}Policy;
 /**
  * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
  */
@@ -46,6 +44,7 @@ public class ${policyName}ReferencePolic
         this.endpointReference = endpointReference;
     }
 
+    @Override
     public PhasedInterceptor createInterceptor(Operation operation) {
         List<PolicySet> policySets = PolicyHelper.findPolicySets(endpointReference, ${policyName}Policy.POLICY_QNAME);
 

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ServicePolicyProvider.java (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ServicePolicyProvider.java?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ServicePolicyProvider.java&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__/provider/__policyName__ServicePolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -20,33 +20,36 @@
  * under the License.    
  */
 
-package ${package};
+package ${package}.${policyName}.provider;
 
 import java.util.List;
 
+import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.assembly.Endpoint;
 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 com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.RuntimeComponent;
+import ${package}.util.PolicyHelper;
+import ${package}.${policyName}.${policyName}Policy;
 
 /**
  * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
  */
 public class ${policyName}ServicePolicyProvider extends BasePolicyProvider<${policyName}Policy> {
-    private RuntimeComponent component;
-
+    private Endpoint endpoint;
+    
     public ${policyName}ServicePolicyProvider(Endpoint endpoint) {
         super(${policyName}Policy.class, endpoint);
-        this.component = component;
+        this.endpoint = endpoint;
     }
 
+    @Override
     public PhasedInterceptor createInterceptor(Operation operation) {
-        List<PolicySet> policySets = PolicyHelper.findPolicySets(component, ${policyName}Policy.POLICY_QNAME);
+        List<PolicySet> policySets = PolicyHelper.findPolicySets(endpoint, ${policyName}Policy.POLICY_QNAME);
         
-        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(subject, getContext(), operation, policySets, Phase.SERVICE_POLICY);
+        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(getContext(), operation, Phase.SERVICE_POLICY);
     }
 
 }

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java Wed Jun 13 16:50:00 2012
@@ -1,68 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import java.util.logging.Level;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}Policy {
-    static final String SCA11_NS = Base.SCA11_NS;
-    static final String SCA11_TUSCANY_NS = Base.SCA11_TUSCANY_NS;
-    
-    static final QName POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "${policyName}");
-
-    private String configProperty;
-
-    public String getConfigProperty() {
-        return configProperty;
-    }
-
-    public void setConfigProperty(String configProperty) {
-        this.configProperty = configProperty;
-    }
-
-    public QName getSchemaName() {
-        return POLICY_QNAME;
-    }
-
-    public boolean isUnresolved() {
-        return false;
-    }
-
-    public void setUnresolved(boolean unresolved) {
-    }
-
-    @Override
-    public String toString() {
-        return "${policyName}Policy [configProperty=" + configProperty
-            + "]";
-    }
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java Wed Jun 13 16:50:00 2012
@@ -1,87 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.builder.BuilderContext;
-import org.apache.tuscany.sca.assembly.builder.PolicyBuilder;
-import org.apache.tuscany.sca.policy.PolicyExpression;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySubject;
-
-/**
- * 
- */
-public class ${policyName}PolicyBuilder implements PolicyBuilder<${policyName}Policy> {
-
-    public boolean build(Endpoint endpoint, BuilderContext context) {
-        List<${policyName}Policy> polices = getPolicies(endpoint);
-        System.out.println(endpoint + ": " + polices);
-        return true;
-    }
-
-    public boolean build(EndpointReference endpointReference, BuilderContext context) {
-        List<${policyName}Policy> polices = getPolicies(endpointReference);
-        System.out.println(endpointReference + ": " + polices);
-        return true;
-    }
-
-    public boolean build(Component component, Implementation implementation, BuilderContext context) {
-        List<${policyName}Policy> polices = getPolicies(implementation);
-        System.out.println(implementation + ": " + polices);
-        return true;
-    }
-
-    public QName getPolicyType() {
-        return ${policyName}Policy.POLICY_QNAME;
-    }
-    
-    public List<QName> getSupportedBindings() {
-        return null;
-    }
-
-    private List<${policyName}Policy> getPolicies(PolicySubject subject) {
-        List<${policyName}Policy> polices = new ArrayList<${policyName}Policy>();
-        for (PolicySet ps : subject.getPolicySets()) {
-            for (PolicyExpression exp : ps.getPolicies()) {
-                if (getPolicyType().equals(exp.getName())) {
-                    polices.add((${policyName}Policy)exp.getPolicy());
-                }
-            }
-        }
-        return polices;
-    }
-
-    public boolean build(EndpointReference endpointReference, Endpoint endpoint, BuilderContext context) {
-        return true;
-    }
-
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java Wed Jun 13 16:50:00 2012
@@ -1,113 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.util.logging.Level;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-
-/**
- *
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}PolicyProcessor implements StAXArtifactProcessor<${policyName}Policy> {
-    
-    public QName getArtifactType() {
-        return ${policyName}Policy.POLICY_QNAME;
-    }
-    
-    public ${policyName}PolicyProcessor(FactoryExtensionPoint modelFactories) {
-    }
-
-    
-    public ${policyName}Policy read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
-        ${policyName}Policy policy = new ${policyName}Policy();
-        int event = reader.getEventType();
-        QName name = null;
-        
-        
-        while (reader.hasNext()) {
-            event = reader.getEventType();
-            switch (event) {
-                case START_ELEMENT : {
-                    name = reader.getName();
-                    if ( name.equals(${policyName}Policy.POLICY_QNAME) ) {
-                        String config = reader.getAttributeValue(null, "name");
-                        policy.setConfigurationProperty(config);
-                    }
-                    break;
-                }
-            }
-            
-            if ( event == END_ELEMENT ) {
-                if ( ${policyName}Policy.POLICY_QNAME.equals(reader.getName()) ) {
-                    break;
-                } 
-            }
-            
-            //Read the next element
-            if (reader.hasNext()) {
-                reader.next();
-            }
-        }
-         
-        return policy;
-    }
-
-    public void write(${policyName}Policy policy, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException,
-                                                        XMLStreamException {
-        String prefix = "tuscany";
-        writer.writeStartElement(prefix, 
-                                 POLICY_QNAME.getLocalPart(),
-                                 POLICY_QNAME.getNamespaceURI());
-        writer.writeNamespace("tuscany", ${policyName}Policy.SCA11_TUSCANY_NS);
-        
-        if (policy.getConfigurationProperty() != null) {
-            writer.writeAttribute("name", policy.getConfigurationProperty());
-        }
-        
-        writer.writeEndElement();
-    }
-
-    public Class<${policyName}Policy> getModelType() {
-        return ${policyName}Policy.class;
-    }
-
-    public void resolve(${policyName}Policy arg0, ModelResolver arg1, ProcessorContext context) throws ContributionResolveException {
-
-    }
-    
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ImplementationPolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -1,59 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-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;
-
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.AuthorizationPolicy;
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.PolicySet;
-import com.shutterfly.middleware.tuscany.sca.policy.util.PolicyHelper;
-
-/**
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}ImplementationPolicyProvider extends BasePolicyProvider<${policyName}Policy> {
-    private RuntimeComponent component;
-    
-    public ${policyName}ImplementationPolicyProvider(RuntimeComponent component) {
-        super(${policyName}Policy.class, component.getImplementation());
-        this.component = component;
-    }
-
-    /**
-     * @see ${groupId}.provider.PolicyProvider${symbol_pound}createInterceptor(${groupId}.interfacedef.Operation)
-     */
-    public PhasedInterceptor createInterceptor(Operation operation) {
-        List<PolicySet> policySets = PolicyHelper.findPolicySets(component, ${policyName}Policy.POLICY_QNAME);
-        
-        
-        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(subject, getContext(), operation,
-                                                                           policySets, Phase.IMPLEMENTATION_POLICY);
-    }
-
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyInterceptor.java Wed Jun 13 16:50:00 2012
@@ -1,79 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import java.util.List;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySubject;
-
-/**
- * Policy handler to handle PolicySet related to Logging with the QName
- * {http://tuscany.apache.org/xmlns/sca/1.1/impl/java}${policyName}Policy
- *
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}PolicyInterceptor implements PhasedInterceptor {
-    private Invoker next;
-    private Operation operation;
-
-    public ${policyName}PolicyInterceptor(String context, Operation operation, String phase) {
-
-        super();
-        this.operation = operation;
-        this.context = context;
-        this.phase = phase;
-    }
-
-    public Message invoke(Message msg) {
-       
-        // DO SOMETHING HERE
-        System.out.println("Inside policy interceptor invoke method");
-        
-        return getNext.invoke(msg);
-    }
-
-    public Invoker getNext() {
-        return next;
-    }
-
-    public void setNext(Invoker next) {
-        this.next = next;
-    }
-
-    public String getPhase() {
-        return phase;
-    }
-
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__PolicyProviderFactory.java Wed Jun 13 16:50:00 2012
@@ -1,71 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.PolicyProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}PolicyProviderFactory implements PolicyProviderFactory<${policyName}Policy> {
-    private ExtensionPointRegistry registry;
-    
-    public ${policyName}PolicyProviderFactory(ExtensionPointRegistry registry) {
-        super();
-        this.registry = registry;
-    }
-
-    /**
-     * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createImplementationPolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.assembly.Implementation)
-     */
-    public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) {
-        return new ${policyName}ImplementationPolicyProvider(component);
-    }
-
-    /**
-     * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createReferencePolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.runtime.RuntimeComponentReference, ${groupId}.assembly.Binding)
-     */
-    public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) {
-        return new ${policyName}ReferencePolicyProvider(endpointReference);
-    }
-
-    /**
-     * @see ${groupId}.provider.PolicyProviderFactory${symbol_pound}createServicePolicyProvider(${groupId}.runtime.RuntimeComponent, ${groupId}.runtime.RuntimeComponentService, ${groupId}.assembly.Binding)
-     */
-    public PolicyProvider createServicePolicyProvider(Endpoint endpoint) {
-        return new ${policyName}ServicePolicyProvider(endpoint);
-    }
-
-    /**
-     * @see ${groupId}.provider.ProviderFactory${symbol_pound}getModelType()
-     */
-    public Class<${policyName}Policy> getModelType() {
-        return ${policyName}Policy.class;
-    }
-
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ReferencePolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -1,55 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.EndpointReference;
-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 com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.AuthorizationPolicyInterceptor;
-import com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.PolicySet;
-import com.shutterfly.middleware.tuscany.sca.policy.metrics.PerformanceMetricsPolicy;
-import com.shutterfly.middleware.tuscany.sca.policy.util.PolicyHelper;
-
-/**
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}ReferencePolicyProvider extends BasePolicyProvider<${policyName}Policy> {
-    private EndpointReference endpointReference;
-    
-    public ${policyName}ReferencePolicyProvider(EndpointReference endpointReference) {
-        super(${policyName}Policy.class, endpointReference);
-        this.endpointReference = endpointReference;
-    }
-
-    public PhasedInterceptor createInterceptor(Operation operation) {
-        List<PolicySet> policySets = PolicyHelper.findPolicySets(endpointReference, ${policyName}Policy.POLICY_QNAME);
-
-        return (policySets.isEmpty()) ? null : new ${policyName}PolicyInterceptor(getContext(), operation, Phase.REFERENCE_POLICY);
-    }
-
-}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/profile/__policyName__ServicePolicyProvider.java Wed Jun 13 16:50:00 2012
@@ -1,52 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * 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 ${package};
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-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 com.shutterfly.middleware.tuscany.sca.policy.authorization.provider.RuntimeComponent;
-
-/**
- * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
- */
-public class ${policyName}ServicePolicyProvider extends BasePolicyProvider<${policyName}Policy> {
-    private RuntimeComponent component;
-
-    public ${policyName}ServicePolicyProvider(Endpoint endpoint) {
-        super(${policyName}Policy.class, endpoint);
-        this.component = component;
-    }
-
-    public PhasedInterceptor createInterceptor(Operation operation) {
-        List<PolicySet> policySets = PolicyHelper.findPolicySets(component, ${policyName}Policy.POLICY_QNAME);
-        
-        return policySets.isEmpty() ? null : new ${policyName}PolicyInterceptor(subject, getContext(), operation, policySets, Phase.SERVICE_POLICY);
-    }
-
-}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/PolicyHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/PolicyHelper.java?rev=1349957&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/PolicyHelper.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/util/PolicyHelper.java Wed Jun 13 16:50:00 2012
@@ -0,0 +1,74 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * 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 ${package}.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyExpression;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySubject;
+
+public class PolicyHelper {
+
+    /**
+     * Find a list of policy sets that provide the given intent
+     * @param subject
+     * @param providedIntent
+     * @return
+     */
+    public static List<PolicySet> findPolicySets(PolicySubject subject, QName providedIntent) {
+        List<PolicySet> policies = new ArrayList<PolicySet>();
+        List<PolicySet> policySets = subject.getPolicySets();
+        for (PolicySet ps : policySets) {
+            for (Intent i : ps.getProvidedIntents()) {
+                if (i.getName().equals(providedIntent)) {
+                    policies.add(ps);
+                }
+            }
+        }
+        return policies;
+    }
+
+    /**
+     * Find a list of policies of the given type
+     * @param <T>
+     * @param subject
+     * @param policyType
+     * @return
+     */
+    public static <T> List<T> findPolicies(PolicySubject subject, QName providedIntent, Class<T> policyType) {
+        List<T> policies = new ArrayList<T>();
+        List<PolicySet> policySets = findPolicySets(subject, providedIntent);
+        for (PolicySet ps : policySets) {
+            for (PolicyExpression exp : ps.getPolicies()) {
+                if (policyType.isInstance(exp.getPolicy())) {
+                    policies.add(policyType.cast(exp.getPolicy()));
+                }
+            }
+        }
+        return policies;
+    }
+}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.assembly.builder.PolicyBuilder Wed Jun 13 16:50:00 2012
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License. 
-org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicyBuilder;qname=http://tuscany.apache.org/xmlns/sca/1.1#jdkLogger
+${package}.${policyName}.${policyName}PolicyBuilder;qname=http://tuscany.apache.org/xmlns/sca/1.1#${policyName}

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor Wed Jun 13 16:50:00 2012
@@ -16,5 +16,4 @@
 # under the License. 
 
 # Implementation class for the artifact processor extension
-${package}.${policyName}PolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#jdkLogger,model=${package}.${policyName}Policy
-
+${package}.${policyName}.${policyName}PolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#${policyName}Policy,model=${package}.${policyName}.${policyName}Policy
\ No newline at end of file

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.definitions.xml.Definitions Wed Jun 13 16:50:00 2012
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-org/apache/tuscany/sca/policy/logging/definitions.xml
+${policyName}/definitions.xml

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.PolicyProviderFactory Wed Jun 13 16:50:00 2012
@@ -16,5 +16,4 @@
 # under the License. 
 
 # Implementation class for the policy extension
-org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicyProviderFactory;model=org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicy
-
+${package}.${policyName}.provider.${policyName}PolicyProviderFactory;model=${package}.${policyName}.${policyName}Policy

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/definitions.xml (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/definitions.xml?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/definitions.xml&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/__policyName__/definitions.xml Wed Jun 13 16:50:00 2012
@@ -20,7 +20,15 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
-	<logLevel>INFO</logLevel>
-	<resourceBundle>Trace_Messages.properties</resourceBundle>
-</tuscany:jdkLogger>
\ No newline at end of file
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+            targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+            xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+	<!-- Policy Intents Defined by the SCA Runtime -->
+	<intent name="${policyName}" constrains="implementation binding">
+		<description>
+			All operations should have a valid authenticated user
+		</description>
+	</intent>
+
+</definitions>
\ No newline at end of file

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java Wed Jun 13 16:50:00 2012
@@ -19,14 +19,11 @@
  * specific language governing permissions and limitations
  * under the License.    
  */
-package ${package};
-
 
 import java.io.InputStream;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.net.URL;
-import java.util.logging.Level;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
@@ -35,7 +32,10 @@ import javax.xml.stream.XMLStreamWriter;
 
 import junit.framework.TestCase;
 
-import ${groupId}.contribution.processor.ProcessorContext;
+import org.apache.tuscany.sca.contribution.processor.ProcessorContext;
+
+import ${package}.${policyName}.${policyName}Policy;
+import ${package}.${policyName}.${policyName}PolicyProcessor;
 
 /**
  * Test the reading of ws config params policy.
@@ -54,28 +54,21 @@ public class PolicyReadTestCase extends 
     }
 
     public void testPolicyReading() throws Exception { 
-        JDKLoggingPolicyProcessor processor = new JDKLoggingPolicyProcessor(null);
-        
-        URL url = getClass().getResource("mock_policies.xml");
-        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-        
-        InputStream urlStream = url.openStream();
-        XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
-        
-        
-        JDKLoggingPolicy policy = processor.read(reader, context);
-        assertEquals(policy.getLoggerName(), "test.logger");
-        assertEquals(policy.getLogLevel(), Level.INFO );
-        assertEquals(policy.getResourceBundleName(), "Trace_Messages.properties");
+    	${policyName}PolicyProcessor processor = new ${policyName}PolicyProcessor(null);
+//      URL url = getClass().getResource("mock_policies.xml");
+//      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+//      
+//      InputStream urlStream = url.openStream();
+//      XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream);
+//      
+//      
+//      ${policyName}Policy policy = processor.read(reader, context);
     }
     
     public void testPolicyWriting() throws Exception {
-        JDKLoggingPolicyProcessor processor = new JDKLoggingPolicyProcessor(null);
+    	${policyName}PolicyProcessor processor = new ${policyName}PolicyProcessor(null);
         
-        JDKLoggingPolicy policy = new JDKLoggingPolicy();
-        policy.setLoggerName("test.logger");
-        policy.setLogLevel(Level.INFO);
-        policy.setResourceBundleName("Trace_Messages.properties");
+    	${policyName}Policy policy = new ${policyName}Policy();
         
         XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
         StringWriter sw = new StringWriter();
@@ -88,9 +81,6 @@ public class PolicyReadTestCase extends 
         XMLStreamReader reader = inputFactory.createXMLStreamReader(sr);
         
         policy = processor.read(reader, context);
-        assertEquals(policy.getLoggerName(), "test.logger");
-        assertEquals(policy.getLogLevel(), Level.INFO );
-        assertEquals(policy.getResourceBundleName(), "Trace_Messages.properties");
         
     }
 

Copied: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/mock_policies.xml (from r1349338, tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml)
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/mock_policies.xml?p2=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/mock_policies.xml&p1=tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml&r1=1349338&r2=1349957&rev=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/mock_policies.xml Wed Jun 13 16:50:00 2012
@@ -20,7 +20,6 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
-	<logLevel>INFO</logLevel>
-	<resourceBundle>Trace_Messages.properties</resourceBundle>
-</tuscany:jdkLogger>
\ No newline at end of file
+<tuscany:${policyName} xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.${policyName}">
+	
+</tuscany:${policyName}>
\ No newline at end of file

Modified: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml?rev=1349957&r1=1349956&r2=1349957&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml (original)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml Wed Jun 13 16:50:00 2012
@@ -1,26 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * 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.    
--->
-<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
-	<logLevel>INFO</logLevel>
-	<resourceBundle>Trace_Messages.properties</resourceBundle>
-</tuscany:jdkLogger>
\ No newline at end of file



Mime
View raw message