tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1103639 - in /tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment: Deployer.java impl/DeployerImpl.java
Date Mon, 16 May 2011 07:48:18 GMT
Author: antelder
Date: Mon May 16 07:48:18 2011
New Revision: 1103639

URL: http://svn.apache.org/viewvc?rev=1103639&view=rev
Log:
Add a method to Deployer to load a model from XML and validate the Monitor results

Modified:
    tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
    tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java?rev=1103639&r1=1103638&r2=1103639&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java
Mon May 16 07:48:18 2011
@@ -44,6 +44,7 @@ import org.apache.tuscany.sca.core.Exten
 import org.apache.tuscany.sca.core.LifeCycleListener;
 import org.apache.tuscany.sca.definitions.Definitions;
 import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.ValidationException;
 
 /**
  * A utility that provides system functions to handle Tuscany SCA application deployment
@@ -128,6 +129,16 @@ public interface Deployer extends LifeCy
 
     /**
      * @param <T>
+     * @param reader
+     * @return
+     * @throws XMLStreamException
+     * @throws ContributionReadException
+     * @throws ValidationException
+     */
+    <T> T loadXMLDocument(Reader reader) throws XMLStreamException, ContributionReadException,
ValidationException;
+
+    /**
+     * @param <T>
      * @param location
      * @param monitor
      * @return

Modified: tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?rev=1103639&r1=1103638&r2=1103639&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
Mon May 16 07:48:18 2011
@@ -86,9 +86,10 @@ import org.apache.tuscany.sca.definition
 import org.apache.tuscany.sca.deployment.Deployer;
 import org.apache.tuscany.sca.monitor.Monitor;
 import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.monitor.ValidationException;
 import org.apache.tuscany.sca.runtime.BaseDomainRegistry;
-import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
 import org.apache.tuscany.sca.runtime.DomainRegistry;
+import org.apache.tuscany.sca.runtime.EndpointReferenceBinder;
 import org.apache.tuscany.sca.runtime.InstalledContribution;
 import org.apache.tuscany.sca.xsd.XSDFactory;
 import org.apache.tuscany.sca.xsd.XSDefinition;
@@ -699,6 +700,13 @@ public class DeployerImpl implements Dep
         return staxProcessor.read(reader, new ProcessorContext(monitor));
     }
 
+    public Object loadXMLDocument(Reader document) throws XMLStreamException, ContributionReadException,
ValidationException {
+        Monitor monitor = createMonitor();
+        Object model = loadXMLDocument(document, monitor);
+        monitor.analyzeProblems();
+        return model;
+    }
+    
     public Object loadXMLDocument(Reader document, Monitor monitor) throws XMLStreamException,
ContributionReadException {
         init();
         XMLStreamReader reader = staxHelper.createXMLStreamReader(document);



Mime
View raw message