tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1229004 - in /tuscany/sca-java-2.x/trunk/maven/archetypes/policy: ./ src/ src/main/ src/main/resources/ src/main/resources/META-INF/ src/main/resources/META-INF/maven/ src/main/resources/archetype-resources/ src/main/resources/archetype-re...
Date Mon, 09 Jan 2012 02:06:28 GMT
Author: lresende
Date: Mon Jan  9 02:06:27 2012
New Revision: 1229004

URL: http://svn.apache.org/viewvc?rev=1229004&view=rev
Log:
Policy archetype (work in progress)

Added:
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/pom.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/archetype-metadata.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
    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/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/
    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/provider.__policyName__ImplementationPolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyInterceptor.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyProviderFactory.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ReferencePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ServicePolicyProvider.java
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/META-INF/services/
    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/main/resources/definitions.xml
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/
    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/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/
    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/test/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/archetype.properties
    tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/goal.txt

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/pom.xml?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/pom.xml Mon Jan  9 02:06:27 2012
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-sca</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../../../pom.xml</relativePath>
+    </parent>
+
+  <artifactId>tuscany-policy-archetype</artifactId>
+  <packaging>maven-archetype</packaging>
+  <name>Create a Tuscany policy extension project</name>
+  <description>Create a Tuscany policy extension project</description>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>2.2</version>
+      </extension>
+    </extensions>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-archetype-plugin</artifactId>
+          <version>2.2</version>
+          <extensions>true</extensions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+  <distributionManagement>
+    <repository>
+      <id>apache.releases.https</id>
+      <name>Apache Release Distribution Repository</name>
+      <url>https://repository.apache.org/service/local/staging/deploy/maven2</url>
+    </repository>
+    <snapshotRepository>
+      <uniqueVersion>false</uniqueVersion>
+      <id>apache.snapshots.https</id>
+      <name>Apache Development Snapshot Repository</name>
+      <url>https://repository.apache.org/content/repositories/snapshots</url>
+    </snapshotRepository>
+  </distributionManagement>
+</project>

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/archetype-metadata.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/archetype-metadata.xml?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/archetype-metadata.xml (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/META-INF/maven/archetype-metadata.xml Mon Jan  9 02:06:27 2012
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="tuscany-policy-logging"
+    xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <requiredProperties>
+    <requiredProperty key="policyName">
+    </requiredProperty>
+  </requiredProperties>
+
+  <fileSets>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/java</directory>
+      <includes>
+        <include>**/*.java</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**/*.*</include>
+      </includes>
+      <excludes>
+      	<exclude>**/definitions.xml</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet filtered="true" packaged="true" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**/definitions.xml</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>src/test/java</directory>
+      <includes>
+        <include>**/*.java</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>src/test/resources</directory>
+      <includes>
+        <include>**/*.*</include>
+      </includes>
+    </fileSet>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>META-INF</directory>
+      <includes>
+        <include>MANIFEST.MF</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</archetype-descriptor>

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/MANIFEST.MF?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/MANIFEST.MF (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/META-INF/MANIFEST.MF Mon Jan  9 02:06:27 2012
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Private-Package: org.apache.tuscany.sca.policy.logging;version="2.0.0",o
+ rg.apache.tuscany.sca.policy.logging.jdk;version="2.0.0"
+SCA-Version: 1.1
+Bundle-Name: Apache Tuscany ${policyName} Policy Model
+Bundle-Vendor: The Apache Software Foundation
+Bundle-Version: 2.0.0
+Bundle-ManifestVersion: 2
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
+Bundle-Description: Apache Tuscany ${policyName} Policy Model
+Import-Package: javax.xml.namespace,
+ javax.xml.stream,
+ org.apache.tuscany.sca.assembly;version="2.0.0",
+ org.apache.tuscany.sca.assembly.builder;version="2.0.0", 
+ org.apache.tuscany.sca.contribution.processor;version="2.0.0",
+ org.apache.tuscany.sca.contribution.resolver;version="2.0.0",
+ org.apache.tuscany.sca.core;version="2.0.0",
+ org.apache.tuscany.sca.definitions;version="2.0.0",
+ org.apache.tuscany.sca.interfacedef;version="2.0.0",
+ org.apache.tuscany.sca.invocation;version="2.0.0",
+ org.apache.tuscany.sca.monitor;version="2.0.0",
+ org.apache.tuscany.sca.policy;version="2.0.0",
+ org.apache.tuscany.sca.provider;version="2.0.0",
+ org.apache.tuscany.sca.runtime;version="2.0.0",
+ org.oasisopen.sca.annotation
+Bundle-SymbolicName: ${package}.${policyName}
+Bundle-DocURL: http://www.apache.org/
+

Added: 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=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/pom.xml Mon Jan  9 02:06:27 2012
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+--><project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-modules</artifactId>
+        <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>
+    
+    <dependencies>
+    	        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-runtime-pom</artifactId>
+            <type>pom</type>
+            <scope>provided</scope>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
+        
+    </dependencies>
+    
+    <version>${version}</version>
+
+</project>

Added: 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=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__Policy.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,68 @@
+#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
+            + "]";
+    }
+}

Added: 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=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyBuilder.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,87 @@
+#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;
+    }
+
+}

Added: 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=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/__policyName__PolicyProcessor.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,113 @@
+#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 {
+
+    }
+    
+}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__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/provider.__policyName__ImplementationPolicyProvider.java?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ImplementationPolicyProvider.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ImplementationPolicyProvider.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,59 @@
+#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);
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__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/provider.__policyName__PolicyInterceptor.java?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyInterceptor.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyInterceptor.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,79 @@
+#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;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__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/provider.__policyName__PolicyProviderFactory.java?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyProviderFactory.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__PolicyProviderFactory.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,71 @@
+#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;
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__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/provider.__policyName__ReferencePolicyProvider.java?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ReferencePolicyProvider.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ReferencePolicyProvider.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,55 @@
+#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);
+    }
+
+}

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__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/provider.__policyName__ServicePolicyProvider.java?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ServicePolicyProvider.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/java/provider.__policyName__ServicePolicyProvider.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,52 @@
+#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/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=1229004&view=auto
==============================================================================
--- 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 (added)
+++ 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 Mon Jan  9 02:06:27 2012
@@ -0,0 +1,17 @@
+# 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. 
+org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicyBuilder;qname=http://tuscany.apache.org/xmlns/sca/1.1#jdkLogger

Added: 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=1229004&view=auto
==============================================================================
--- 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 (added)
+++ 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 Mon Jan  9 02:06:27 2012
@@ -0,0 +1,20 @@
+# 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. 
+
+# Implementation class for the artifact processor extension
+${package}.${policyName}PolicyProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#jdkLogger,model=${package}.${policyName}Policy
+

Added: 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=1229004&view=auto
==============================================================================
--- 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 (added)
+++ 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 Mon Jan  9 02:06:27 2012
@@ -0,0 +1,17 @@
+# 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.
+org/apache/tuscany/sca/policy/logging/definitions.xml

Added: 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=1229004&view=auto
==============================================================================
--- 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 (added)
+++ 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 Mon Jan  9 02:06:27 2012
@@ -0,0 +1,20 @@
+# 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. 
+
+# Implementation class for the policy extension
+org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicyProviderFactory;model=org.apache.tuscany.sca.policy.logging.jdk.JDKLoggingPolicy
+

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/definitions.xml?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/definitions.xml (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/main/resources/definitions.xml Mon Jan  9 02:06:27 2012
@@ -0,0 +1,41 @@
+#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.    
+-->
+<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 Tuscany Runtime -->
+	<intent name="logging" constrains="implementation binding">
+		<description>
+			All messages to and from this implementation must be logged
+		</description>
+	</intent>
+    
+    <!-- Policy Intents Defined by the Tuscany Runtime -->
+    <intent name="noLogging" constrains="implementation binding" excludes="tuscany:logging">
+        <description>
+            All messages to and from this implementation must be logged
+        </description>
+    </intent>
+    
+</definitions>
\ No newline at end of file

Added: 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=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/main/resources/archetype-resources/src/test/java/PolicyReadTestCase.java Mon Jan  9 02:06:27 2012
@@ -0,0 +1,97 @@
+#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.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;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import junit.framework.TestCase;
+
+import ${groupId}.contribution.processor.ProcessorContext;
+
+/**
+ * Test the reading of ws config params policy.
+ *
+ * @version ${symbol_dollar}Rev${symbol_dollar} ${symbol_dollar}Date${symbol_dollar}
+ */
+public class PolicyReadTestCase extends TestCase {
+    private ProcessorContext context = new ProcessorContext();
+    
+    @Override
+    public void setUp() throws Exception {
+    }
+
+    @Override
+    public void tearDown() throws Exception {
+    }
+
+    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");
+    }
+    
+    public void testPolicyWriting() throws Exception {
+        JDKLoggingPolicyProcessor processor = new JDKLoggingPolicyProcessor(null);
+        
+        JDKLoggingPolicy policy = new JDKLoggingPolicy();
+        policy.setLoggerName("test.logger");
+        policy.setLogLevel(Level.INFO);
+        policy.setResourceBundleName("Trace_Messages.properties");
+        
+        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+        StringWriter sw = new StringWriter();
+        XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
+        processor.write(policy, writer, context);
+        writer.close();
+        
+        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+        StringReader sr = new StringReader(sw.toString());
+        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");
+        
+    }
+
+}

Added: 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=1229004&view=auto
==============================================================================
--- 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 (added)
+++ 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 Mon Jan  9 02:06:27 2012
@@ -0,0 +1,26 @@
+#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

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/archetype.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/archetype.properties?rev=1229004&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/archetype.properties (added)
+++ tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/archetype.properties Mon Jan  9 02:06:27 2012
@@ -0,0 +1,22 @@
+# 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. 
+#Sat Sep 04 08:10:22 BST 2010
+version=0.1-SNAPSHOT
+groupId=archetype.it
+package=archetype.it.basic
+artifactId=basic
+policyName=Basic

Added: tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/goal.txt
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/maven/archetypes/policy/src/test/resources/projects/basic/goal.txt?rev=1229004&view=auto
==============================================================================
    (empty)



Mime
View raw message