tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svkr...@apache.org
Subject svn commit: r573983 - in /incubator/tuscany/java/sca/modules/policy-xml/src: main/java/org/apache/tuscany/sca/policy/xml/ main/resources/META-INF/ main/resources/META-INF/services/ test/java/org/apache/tuscany/sca/policy/xml/ test/resources/org/apache/...
Date Sun, 09 Sep 2007 10:42:20 GMT
Author: svkrish
Date: Sun Sep  9 03:42:20 2007
New Revision: 573983

URL: http://svn.apache.org/viewvc?rev=573983&view=rev
Log:
add meta-inf/services, extended policyset processor to recognize ws-policy attachments in
policy sets

Added:
    incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/
    incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/
    incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
    incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/Policy.java
    incubator/tuscany/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
      - copied unchanged from r572908, incubator/tuscany/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/definitions.xml
Removed:
    incubator/tuscany/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/definitions.xml
Modified:
    incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
    incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
    incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java

Modified: incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java?rev=573983&r1=573982&r2=573983&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyIntentProcessor.java
Sun Sep  9 03:42:20 2007
@@ -30,6 +30,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
 import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
 import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
@@ -49,6 +50,10 @@
 
     private PolicyFactory policyFactory;
 
+    public PolicyIntentProcessor(ModelFactoryExtensionPoint modelFactories) {
+        this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
+    }
+    
     public PolicyIntentProcessor(PolicyFactory policyFactory, StAXArtifactProcessor<Object>
extensionProcessor) {
         this.policyFactory = policyFactory;
     }

Modified: incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java?rev=573983&r1=573982&r2=573983&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
(original)
+++ incubator/tuscany/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicySetProcessor.java
Sun Sep  9 03:42:20 2007
@@ -95,7 +95,7 @@
                         policySet.getPolicies().add(wsPolicy);
                     } else {
                         Object extension = extensionProcessor.read(reader);
-                        if ( extension instanceof Policy ) {
+                        if ( extension != null ) {
                             policySet.getPolicies().add(extension);
                         }
                     }
@@ -170,7 +170,7 @@
                                 policyList.add((Policy)wsPolicy);
                             } else {
                                 Object extension = extensionProcessor.read(reader);
-                                if ( extension instanceof Policy ) {
+                                if ( extension != null ) {
                                     List<Object> policyList = mappedPolicies.get(qualifiedIntent);
                                     if ( policyList == null ) {
                                         policyList = new ArrayList<Object>();
@@ -180,7 +180,7 @@
                                             mappedPolicies.put(mappedIntent, policyList);
                                         }
                                     }
-                                    policyList.add((Policy)extension);
+                                    policyList.add(extension);
                                 }
                             }
                             break;

Added: incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor?rev=573983&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
(added)
+++ incubator/tuscany/java/sca/modules/policy-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor
Sun Sep  9 03:42:20 2007
@@ -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. 
+
+# Implementation class for the artifact processor extension
+#org.apache.tuscany.sca.policy.xml.PolicySetProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#policySet,model=org.apache.tuscany.sca.policy.PolicySet
+#org.apache.tuscany.sca.policy.xml.PolicyIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.Intent
+#org.apache.tuscany.sca.policy.xml.ProfileIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.ProfileIntent
+#org.apache.tuscany.sca.policy.xml.QualifiedIntentProcessor;qname=http://www.osoa.org/xmlns/sca/1.0#intent,model=org.apache.tuscany.sca.policy.QualifiedIntent

Added: incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/Policy.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/Policy.java?rev=573983&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/Policy.java
(added)
+++ incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/Policy.java
Sun Sep  9 03:42:20 2007
@@ -0,0 +1,32 @@
+/*
+ * 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 org.apache.tuscany.sca.policy.xml;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface that will abstract various types of policy specifications
+ * and attachments for example WS-Policy
+ *
+ */
+public interface Policy {
+    QName getSchemaName();
+    void setUnresolved(boolean unresolved);
+    boolean isUnresolved();
+}

Modified: incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java?rev=573983&r1=573982&r2=573983&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
(original)
+++ incubator/tuscany/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
Sun Sep  9 03:42:20 2007
@@ -103,7 +103,7 @@
         staxProcessors.addArtifactProcessor(new MockPolicyProcessor());
         */
         
-        URL url = getClass().getResource("definitions.xml");
+        URL url = getClass().getResource("test_definitions.xml");
         URI uri = URI.create("definitions.xml");
         scaDefinitions = scaDefnDocProcessor.read(null, uri, url);
         



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message