tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svkr...@apache.org
Subject svn commit: r575261 - in /incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl: ReallySmallRuntime.java ReallySmallRuntimeBuilder.java
Date Thu, 13 Sep 2007 11:30:13 GMT
Author: svkrish
Date: Thu Sep 13 04:30:13 2007
New Revision: 575261

URL: http://svn.apache.org/viewvc?rev=575261&view=rev
Log:
changed sequence in loading sca definitions, passing policysetts defined in sca definitions
to construction of CompositeBuilderImpl

Modified:
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
    incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java?rev=575261&r1=575260&r2=575261&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
(original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java
Thu Sep 13 04:30:13 2007
@@ -53,6 +53,7 @@
 import org.apache.tuscany.sca.policy.DefaultPolicyFactory;
 import org.apache.tuscany.sca.policy.IntentAttachPointTypeFactory;
 import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.work.WorkScheduler;
 
 public class ReallySmallRuntime {
@@ -121,13 +122,8 @@
                                                                                   scaDocDefnProcessor.getDomainModelResolver());
 
         // Create the ScopeRegistry
-        scopeRegistry = ReallySmallRuntimeBuilder.createScopeRegistry(registry);
+        scopeRegistry = ReallySmallRuntimeBuilder.createScopeRegistry(registry); 
         
-        // Create a composite builder
-        compositeBuilder = ReallySmallRuntimeBuilder.createCompositeBuilder(assemblyFactory,
-                                                                            scaBindingFactory,
-                                                                            mapper);
-
         // Create a composite activator
         compositeActivator = ReallySmallRuntimeBuilder.createCompositeActivator(registry,
                                                                                 assemblyFactory,
@@ -145,15 +141,26 @@
         // Start the runtime modules
         startModules(registry, modules);
         
-        loadDomainDefinitions(scaDocDefnProcessor);
+        SCADefinitions scaDefns = loadDomainDefinitions(scaDocDefnProcessor);
+        List<PolicySet> domainPolicySets = null;
+        if ( scaDefns != null ) {
+            domainPolicySets = scaDefns.getPolicySets();
+        }
+        
+        //Create a composite builder
+        compositeBuilder = ReallySmallRuntimeBuilder.createCompositeBuilder(assemblyFactory,
+                                                                            scaBindingFactory,
+                                                                            mapper,
+                                                                            domainPolicySets);
     }
     
-    private void loadDomainDefinitions(SCADefinitionsDocumentProcessor scaDocDefnProcessor)
throws ActivationException {
+    private SCADefinitions loadDomainDefinitions(SCADefinitionsDocumentProcessor scaDocDefnProcessor)
throws ActivationException {
         URL url = this.classLoader.getResource("definitions.xml");
+        SCADefinitions scaDefinitions = null;
         
         if ( url != null ) {
             try {
-                SCADefinitions scaDefinitions = scaDocDefnProcessor.read(null, null, url);
+                scaDefinitions = scaDocDefnProcessor.read(null, null, url);
                 scaDocDefnProcessor.resolve(scaDefinitions, scaDocDefnProcessor.getDomainModelResolver());
             } catch ( ContributionReadException e ) {
                 throw new ActivationException(e);
@@ -161,6 +168,7 @@
                 throw new ActivationException(e);
             }
         } 
+        return scaDefinitions;
     }
 
     public void stop() throws ActivationException {

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java?rev=575261&r1=575260&r2=575261&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
(original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java
Thu Sep 13 04:30:13 2007
@@ -20,6 +20,7 @@
 package org.apache.tuscany.sca.host.embedded.impl;
 
 import java.io.IOException;
+import java.util.List;
 
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
@@ -73,11 +74,13 @@
 import org.apache.tuscany.sca.core.scope.ScopeRegistry;
 import org.apache.tuscany.sca.core.scope.ScopeRegistryImpl;
 import org.apache.tuscany.sca.core.scope.StatelessScopeContainerFactory;
+import org.apache.tuscany.sca.definitions.SCADefinitions;
 import org.apache.tuscany.sca.definitions.SCADefinitionsDocumentProcessor;
 import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.sca.invocation.MessageFactory;
 import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySet;
 import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint;
 import org.apache.tuscany.sca.runtime.RuntimeWireProcessor;
 import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint;
@@ -143,8 +146,9 @@
 
     public static CompositeBuilder createCompositeBuilder(AssemblyFactory assemblyFactory,
                                                           SCABindingFactory scaBindingFactory,
-                                                          InterfaceContractMapper interfaceContractMapper)
{
-        return new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, interfaceContractMapper,
null);
+                                                          InterfaceContractMapper interfaceContractMapper,

+                                                          List<PolicySet> domainPolicySets)
{
+        return new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, interfaceContractMapper,
domainPolicySets, null);
     }
 
     /**



---------------------------------------------------------------------
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