You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2012/03/16 09:20:24 UTC

svn commit: r1301369 - in /tuscany/sca-java-2.x/trunk: modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/ testing/itest...

Author: slaws
Date: Fri Mar 16 08:20:24 2012
New Revision: 1301369

URL: http://svn.apache.org/viewvc?rev=1301369&view=rev
Log:
TUSCANY-4028 - don't duplicate intents on the Java implementation model 

Added:
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/LoggingMessages.properties
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/definitions.xml
Modified:
    tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/HelloworldServiceImpl.java
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/PerformanceTest.composite
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/   (props changed)
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/pom.xml
    tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/src/test/java/org/apache/tuscany/sca/test/performance/PerformanceTestCase.java

Modified: tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java?rev=1301369&r1=1301368&r2=1301369&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java Fri Mar 16 08:20:24 2012
@@ -1106,7 +1106,7 @@ public class CompositeProcessor extends 
                     //for this that is resolved, the specified intents and policysets are safe in the
                     //component and not lost
 
-                	List<PolicySet> policySets = new ArrayList<PolicySet>(implementation.getPolicySets());                	
+                	List<PolicySet> policySets = new ArrayList<PolicySet>(implementation.getPolicySets());  
                 	List<Intent> intents = new ArrayList<Intent>(implementation.getRequiredIntents());
                     implementation = resolveImplementation(implementation, resolver, context);
 
@@ -1117,7 +1117,15 @@ public class CompositeProcessor extends 
                     	implementation.getPolicySets().addAll(policySets);                    	
                     }
                     	
-                    implementation.getRequiredIntents().addAll(intents);     
+                    //implementation.getRequiredIntents().addAll(intents);
+
+                    // Make sure we don't repeat any intents that are already on the 
+                    // resolved implementation
+                    for (Intent intent : intents){
+                        if (!implementation.getRequiredIntents().contains(intent)){
+                            implementation.getRequiredIntents().add(intent);                               
+                        }
+                    }
                     
                     // resolve any policy on implementation operations
                     for (Operation op : implementation.getOperations()){

Modified: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/HelloworldServiceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/HelloworldServiceImpl.java?rev=1301369&r1=1301368&r2=1301369&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/HelloworldServiceImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/java/org/apache/tuscany/sca/test/performance/impl/HelloworldServiceImpl.java Fri Mar 16 08:20:24 2012
@@ -20,11 +20,15 @@ package org.apache.tuscany.sca.test.perf
 
 import org.apache.tuscany.sca.test.performance.BeanA;
 import org.apache.tuscany.sca.test.performance.Helloworld;
+import org.oasisopen.sca.annotation.Requires;
 
+@Requires("{http://tuscany.apache.org/xmlns/sca/1.1}logging")
 public class HelloworldServiceImpl implements Helloworld {
 
     public String sayHello(String name, BeanA beanA) {
-        return "Hello " + name + " " + beanA.getField1();
+        String returnStrng =  "Hello " + name + " " + beanA.getField1();
+        System.out.println("At HelloworldServiceImpl - " + returnStrng);
+        return returnStrng;
     }
 
 }

Added: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/LoggingMessages.properties
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/LoggingMessages.properties?rev=1301369&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/LoggingMessages.properties (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/LoggingMessages.properties Fri Mar 16 08:20:24 2012
@@ -0,0 +1,16 @@
+# 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. 

Added: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/definitions.xml?rev=1301369&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/definitions.xml (added)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/META-INF/definitions.xml Fri Mar 16 08:20:24 2012
@@ -0,0 +1,41 @@
+<?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"
+            xmlns:sca="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">
+    
+    <intent name="mediation" constrains="sca:binding"/>
+    
+    <policySet name="Mediation1" 
+               provides="tuscany:mediation" 
+               appliesTo="//sca:service"
+               attachTo="//sca:component[@name='BusinessLogicComponent']">
+        <tuscany:mediation name="mediation1.med"/>
+    </policySet>
+    
+    <policySet name="Mediation2" 
+               provides="tuscany:mediation" 
+               appliesTo="//sca:reference"
+               attachTo="//sca:component[@name='BusinessLogicComponent']">
+        <tuscany:mediation name="mediation2.med"/>
+    </policySet>    
+         	              
+</definitions>
\ No newline at end of file

Modified: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/PerformanceTest.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/PerformanceTest.composite?rev=1301369&r1=1301368&r2=1301369&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/PerformanceTest.composite (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-contribution1/src/main/resources/PerformanceTest.composite Fri Mar 16 08:20:24 2012
@@ -20,6 +20,7 @@
 <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" 
            xmlns:foo="http://foo" 
            targetNamespace="http://foo"
+           xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
   name="PerformanceTest">
   
   <component name="HelloWorldClientComponent">
@@ -28,7 +29,7 @@
   </component>
 
   <component name="HelloWorldServiceComponent">
-    <implementation.java class="org.apache.tuscany.sca.test.performance.impl.HelloworldServiceImpl" />
+    <implementation.java class="org.apache.tuscany.sca.test.performance.impl.HelloworldServiceImpl"/>
     <service name="Helloworld">
         <binding.ws/>
     </service>

Propchange: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Mar 16 08:20:24 2012
@@ -5,3 +5,6 @@ heap_start.bin
 heap_stop.bin
 out.txt
 target
+heap_start_testInstallUninstall.bin
+heap_stop_testInstallUninstall_postStop.bin
+heap_stop_testInstallUninstall_postUninstall.bin

Modified: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/pom.xml?rev=1301369&r1=1301368&r2=1301369&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/pom.xml Fri Mar 16 08:20:24 2012
@@ -46,6 +46,12 @@
             <artifactId>tuscany-host-jetty</artifactId>
             <version>2.0-SNAPSHOT</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-policy-logging</artifactId>
+            <version>2.0-SNAPSHOT</version>
+        </dependency>
                
     </dependencies>
 </project>

Modified: tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/src/test/java/org/apache/tuscany/sca/test/performance/PerformanceTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/src/test/java/org/apache/tuscany/sca/test/performance/PerformanceTestCase.java?rev=1301369&r1=1301368&r2=1301369&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/src/test/java/org/apache/tuscany/sca/test/performance/PerformanceTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/testing/itest/performance/performance-test/src/test/java/org/apache/tuscany/sca/test/performance/PerformanceTestCase.java Fri Mar 16 08:20:24 2012
@@ -224,11 +224,11 @@ public class PerformanceTestCase {
             System.out.println("You can watch a JVM run using \n" +
                                " jconsole \n" + 
                                "You can manually dump the heap using \n" +
-                               " jmap -dump:file=heapdump.bin 345" +
+                               " jmap -dump:file=heap_stop_" + name + ".bin 345" +
                                "Where 345 is the process id from jconsole \n" +
                                "The program dumps the heap at the start and end. You can look at them using \n" +
                                " jhat -J-Xmx512m heap_start.bin\n" +
-                               " jhat -J-Xmx512m heap_stop.bin\n" +
+                               " jhat -J-Xmx512m heap_stop_" + name + ".bin\n" +
                                "Then point your browser at\n" +
                                " http://localhost:7000/");
         } else {