diff options
2 files changed, 20 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java index e8750cf0ca..f85bab06f4 100644 --- a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java +++ b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/Deployer.java @@ -44,6 +44,7 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry; 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 LifeCycleListener { /** * @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 diff --git a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java index 1d4de5192d..890e95ccff 100644 --- a/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java +++ b/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java @@ -86,9 +86,10 @@ import org.apache.tuscany.sca.definitions.xml.DefinitionsExtensionPoint; 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 Deployer { 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); |