tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r1124713 - in /tuscany/sandbox/slaws/domain-view/src/main: java/org/apache/tuscany/sca/domain/ resources/
Date Thu, 19 May 2011 12:41:09 GMT
Author: slaws
Date: Thu May 19 12:41:09 2011
New Revision: 1124713

URL: http://svn.apache.org/viewvc?rev=1124713&view=rev
Log:
Bit of renaming to be clear this is about looking at the domain rather then being the domain.


Added:
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeView.java
      - copied, changed from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Composite.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeViewImpl.java
      - copied, changed from r1102740, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeImpl.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainView.java
      - copied, changed from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Domain.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainViewImpl.java
      - copied, changed from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainImpl.java
Removed:
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Composite.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeImpl.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Domain.java
    tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainImpl.java
Modified:
    tuscany/sandbox/slaws/domain-view/src/main/resources/domain.composite

Copied: tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeView.java
(from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Composite.java)
URL: http://svn.apache.org/viewvc/tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeView.java?p2=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeView.java&p1=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Composite.java&r1=1124703&r2=1124713&rev=1124713&view=diff
==============================================================================
--- tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Composite.java
(original)
+++ tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeView.java
Thu May 19 12:41:09 2011
@@ -28,11 +28,10 @@ import javax.ws.rs.core.MediaType;
 import org.oasisopen.sca.annotation.Remotable;
 
 @Remotable
-public interface Composite {
+public interface CompositeView {
     
-//    @GET
+    @GET
     @Produces( {MediaType.TEXT_HTML})
-    @Path("{domainname}/composite")
     public String get();
     
 
@@ -41,7 +40,7 @@ public interface Composite {
                 MediaType.APPLICATION_JSON,
                 MediaType.APPLICATION_XML, 
                 MediaType.TEXT_HTML})
-    @Path("{domainname}/composite/{compositename}")                
+    @Path("{compositename}")                
     public String getComposite(@PathParam("compositename") String domainName);
     
 }
\ No newline at end of file

Copied: tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeViewImpl.java
(from r1102740, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeViewImpl.java?p2=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeViewImpl.java&p1=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeImpl.java&r1=1102740&r2=1124713&rev=1124713&view=diff
==============================================================================
--- tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeImpl.java
(original)
+++ tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/CompositeViewImpl.java
Thu May 19 12:41:09 2011
@@ -19,16 +19,29 @@
 
 package org.apache.tuscany.sca.domain;
 
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.xml.Utils;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+
 /**
  * Some hand crafted HTTP code to help me think about what info is missing
  * from the domain registry
  *  
  */
-public class CompositeImpl implements Composite {
+public class CompositeViewImpl implements CompositeView {
     
     public String get() {
         String outputHTML = "<p/>get";
         return outputHTML;
+        
+//        Utils.modelToXML(getDomainComposite(domainName), true, DomainViewRunner.extensionPointRegistry);
       
     }    
     
    
@@ -37,4 +50,24 @@ public class CompositeImpl implements Co
         return outputHTML;
     } 
     
+    // utilities
+    
+    // copied from domain node
+    public Composite getDomainComposite(String domainName) {
+        FactoryExtensionPoint factories = DomainViewRunner.extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class);
+        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
+        Composite domainComposite = assemblyFactory.createComposite();
+        domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS, domainName));
+        domainComposite.setAutowire(false);
+        domainComposite.setLocal(false);
+        List<Composite> domainIncludes = domainComposite.getIncludes();
+        Map<String, List<String>> runningCompositeURIs = DomainViewRunner.domainRegistry.getRunningCompositeURIs();
+        for (String curi : runningCompositeURIs.keySet()) {
+            for (String compositeURI : runningCompositeURIs.get(curi)) {
+                domainIncludes.add(DomainViewRunner.domainRegistry.getRunningComposite(curi,
compositeURI));
+            }
+        }
+        return domainComposite;
+    }    
+    
 }
\ No newline at end of file

Copied: tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainView.java
(from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Domain.java)
URL: http://svn.apache.org/viewvc/tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainView.java?p2=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainView.java&p1=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Domain.java&r1=1124703&r2=1124713&rev=1124713&view=diff
==============================================================================
--- tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/Domain.java
(original)
+++ tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainView.java
Thu May 19 12:41:09 2011
@@ -28,7 +28,7 @@ import javax.ws.rs.core.MediaType;
 import org.oasisopen.sca.annotation.Remotable;
 
 @Remotable
-public interface Domain {
+public interface DomainView {
     
     @GET
     @Produces( {MediaType.TEXT_HTML})
@@ -51,12 +51,7 @@ public interface Domain {
     public String getContributions(@PathParam("domainname") String domainName);
     
     @Path("{domainname}/composite")
-    @GET
-    @Produces( {MediaType.APPLICATION_ATOM_XML, 
-                MediaType.APPLICATION_JSON,
-                MediaType.APPLICATION_XML, 
-                MediaType.TEXT_HTML})
-    public String getComposites(@PathParam("domainname") String domainName);    
+    public CompositeView getComposites(@PathParam("domainname") String domainName);    
     
     @Path("{domainname}/component")
     @GET

Copied: tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainViewImpl.java
(from r1124703, tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainImpl.java)
URL: http://svn.apache.org/viewvc/tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainViewImpl.java?p2=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainViewImpl.java&p1=tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainImpl.java&r1=1124703&r2=1124713&rev=1124713&view=diff
==============================================================================
--- tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainImpl.java
(original)
+++ tuscany/sandbox/slaws/domain-view/src/main/java/org/apache/tuscany/sca/domain/DomainViewImpl.java
Thu May 19 12:41:09 2011
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.sca.domain;
 
-import java.io.File;
 import java.util.List;
 import java.util.Map;
 
@@ -30,7 +29,6 @@ import org.apache.tuscany.sca.assembly.B
 import org.apache.tuscany.sca.assembly.Composite;
 import org.apache.tuscany.sca.assembly.xml.Utils;
 import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.impl.NodeImpl;
 import org.apache.tuscany.sca.runtime.DomainRegistry;
 
 
@@ -39,7 +37,7 @@ import org.apache.tuscany.sca.runtime.Do
  * from the domain registry
  *  
  */
-public class DomainImpl implements Domain {
+public class DomainViewImpl implements DomainView {
     
     public String get() {
         String outputHTML = "<p/>enter URL in the form http://host:port/sca/domain/yourdomainnamehere";
@@ -49,54 +47,34 @@ public class DomainImpl implements Domai
     public String getDomainServiceDocument(String domainName) {
         String outputHTML = "<p/><a href=\"" + domainName + "/contribution\">contributions</a>"
+ 
                             "<p/><a href=\"" + domainName + "/composite\">composites</a>"
+ 
+                            "<p/><a href=\"" + domainName + "/composite\">components</a>"
+ 
                             "<p/><a href=\"" + domainName + "/endpoint\">endpoints</a>"
+
                             "<p/><a href=\"" + domainName + "/node\">nodes</a>";
         return outputHTML;
     } 
     
     public String getContributions(String domainName) {
-        DomainRegistry domainRegistry = DomainView.domainRegistry;
+        DomainRegistry domainRegistry = DomainViewRunner.domainRegistry;
         List<String> contributions = domainRegistry.getInstalledContributionURIs();
         return contributions.toString();
     }
     
-    public String getComposites(String domainName){
-        return Utils.modelToXML(getDomainComposite(domainName), true, DomainView.extensionPointRegistry);
+    public CompositeView getComposites(String domainName){
+        return new CompositeViewImpl();
     } 
     
     public String getComponents(String domainName) {
-        // TODO Auto-generated method stub
         return null;
     }
     
     public String getEndpoints(String domainName) {
-        DomainRegistry domainRegistry = DomainView.domainRegistry;
+        DomainRegistry domainRegistry = DomainViewRunner.domainRegistry;
         return domainRegistry.getEndpoints().toString();
     }
     
     public String getNodes(String domainName){
-        DomainRegistry domainRegistry = DomainView.domainRegistry;
+        DomainRegistry domainRegistry = DomainViewRunner.domainRegistry;
         return domainRegistry.getMembers().toString();
     }     
-    
-    // utilities
-    
-    // copied from domain node
-    public Composite getDomainComposite(String domainName) {
-        FactoryExtensionPoint factories = DomainView.extensionPointRegistry.getExtensionPoint(FactoryExtensionPoint.class);
-        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
-        Composite domainComposite = assemblyFactory.createComposite();
-        domainComposite.setName(new QName(Base.SCA11_TUSCANY_NS, domainName));
-        domainComposite.setAutowire(false);
-        domainComposite.setLocal(false);
-        List<Composite> domainIncludes = domainComposite.getIncludes();
-        Map<String, List<String>> runningCompositeURIs = DomainView.domainRegistry.getRunningCompositeURIs();
-        for (String curi : runningCompositeURIs.keySet()) {
-            for (String compositeURI : runningCompositeURIs.get(curi)) {
-                domainIncludes.add(DomainView.domainRegistry.getRunningComposite(curi, compositeURI));
-            }
-        }
-        return domainComposite;
-    }
 
 }
\ No newline at end of file

Modified: tuscany/sandbox/slaws/domain-view/src/main/resources/domain.composite
URL: http://svn.apache.org/viewvc/tuscany/sandbox/slaws/domain-view/src/main/resources/domain.composite?rev=1124713&r1=1124712&r2=1124713&view=diff
==============================================================================
--- tuscany/sandbox/slaws/domain-view/src/main/resources/domain.composite (original)
+++ tuscany/sandbox/slaws/domain-view/src/main/resources/domain.composite Thu May 19 12:41:09
2011
@@ -30,9 +30,9 @@
         </service>
     </component>   
 
-    <component name="Domain">
-        <implementation.java class="org.apache.tuscany.sca.domain.DomainImpl"/>
-        <service name="Domain">
+    <component name="DomainView">
+        <implementation.java class="org.apache.tuscany.sca.domain.DomainViewImpl"/>
+        <service name="DomainView">
             <tuscany:binding.rest uri="/sca/domain">
                 <tuscany:operationSelector.jaxrs/>
             </tuscany:binding.rest>



Mime
View raw message