summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/assembly-xml/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-19 22:26:30 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-11-19 22:26:30 +0000
commitcf4ada1bfbabf75af8ef3fa0f40d037a553c70a6 (patch)
tree7ad9b81af90d725e3fab51bd5eeb99c79614485d /java/sca/modules/assembly-xml/src
parentdcab3df2d52597bccc5c2f3557489d292be06453 (diff)
Minor clean up
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882336 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/assembly-xml/src')
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java19
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java5
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointReferenceProcessor.java5
3 files changed, 8 insertions, 21 deletions
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
index 026e0426af..3930ed9f67 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java
@@ -96,10 +96,8 @@ import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
import org.apache.tuscany.sca.contribution.resolver.ResolverExtension;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
import org.apache.tuscany.sca.interfacedef.InterfaceContract;
import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
import org.apache.tuscany.sca.policy.ExtensionType;
import org.apache.tuscany.sca.policy.PolicyFactory;
import org.apache.tuscany.sca.policy.PolicySubject;
@@ -1045,21 +1043,4 @@ public class CompositeProcessor extends BaseAssemblyProcessor implements StAXArt
return extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
}
- /**
- * Returns the monitor to use.
- *
- * @param extensionPoints
- * @return
- */
- private static Monitor monitor(ExtensionPointRegistry extensionPoints) {
- UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
- if (utilities != null) {
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- if (monitorFactory != null) {
- return monitorFactory.createMonitor();
- }
- }
- return null;
- }
-
}
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
index a055248357..2a76248d80 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.assembly.xml;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@@ -72,7 +73,9 @@ public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArti
public Endpoint read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
Endpoint endpoint = assemblyFactory.createEndpoint();
- reader.nextTag();
+ if (reader.getEventType() == XMLStreamConstants.START_DOCUMENT) {
+ reader.nextTag();
+ }
Object model = extensionProcessor.read(reader, context);
if (model instanceof Composite) {
Composite composite = (Composite)model;
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointReferenceProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointReferenceProcessor.java
index 22ce8a08d4..ea742ae404 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointReferenceProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointReferenceProcessor.java
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.assembly.xml;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@@ -74,7 +75,9 @@ public class EndpointReferenceProcessor extends BaseAssemblyProcessor implements
public EndpointReference read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException {
EndpointReference endpointReference = assemblyFactory.createEndpointReference();
- reader.nextTag();
+ if (reader.getEventType() == XMLStreamConstants.START_DOCUMENT) {
+ reader.nextTag();
+ }
Object model = extensionProcessor.read(reader, context);
if (model instanceof Composite) {
Composite composite = (Composite)model;