You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by me...@apache.org on 2007/03/04 00:10:19 UTC
svn commit: r514263 - in /incubator/tuscany/java/sca/kernel:
core/src/main/java/org/apache/tuscany/core/marshaller/
core/src/test/java/org/apache/tuscany/core/marshaller/
spi/src/main/java/org/apache/tuscany/spi/marshaller/
Author: meerajk
Date: Sat Mar 3 15:10:18 2007
New Revision: 514263
URL: http://svn.apache.org/viewvc?view=rev&rev=514263
Log:
removed change set specific methods from the marshaller registry
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/DefaultModelMarshallerRegistry.java
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/marshaller/JavaPhysicalChangeSetMarshallerTest.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshallerRegistry.java
Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/DefaultModelMarshallerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/DefaultModelMarshallerRegistry.java?view=diff&rev=514263&r1=514262&r2=514263
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/DefaultModelMarshallerRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/DefaultModelMarshallerRegistry.java Sat Mar 3 15:10:18 2007
@@ -18,13 +18,10 @@
*/
package org.apache.tuscany.core.marshaller;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
@@ -32,7 +29,6 @@
import org.apache.tuscany.spi.marshaller.ModelMarshaller;
import org.apache.tuscany.spi.marshaller.ModelMarshallerRegistry;
import org.apache.tuscany.spi.model.ModelObject;
-import org.apache.tuscany.spi.model.physical.PhysicalChangeSet;
/**
* Default map-based implementation of the model marshaller registry.
@@ -94,36 +90,6 @@
throw new MarshallException("No marshaller defined for " + qname);
}
return marshaller.unmarshall(reader);
-
- }
-
- /**
- * Marshalls a physical change set.
- *
- * @param changeSet Model object to be marshalled.
- * @param writer Writer to which marshalled information is written.
- */
- public void marshallChangeSet(PhysicalChangeSet changeSet, XMLStreamWriter writer) throws MarshallException {
- }
-
- /**
- * Unmarshalls an XML stream to a physical change set.
- *
- * @param reader Reader from which marshalled information is read.
- * @return Physical change set from the marshalled stream.
- */
- public PhysicalChangeSet unmarshallChangeSet(XMLStreamReader reader) throws MarshallException {
-
- try {
- while(reader.next() != START_ELEMENT) {
- }
- PhysicalChangeSetMarshaller marshaller = new PhysicalChangeSetMarshaller();
- marshaller.setRegistry(this);
- return marshaller.unmarshall(reader);
-
- } catch(XMLStreamException ex) {
- throw new MarshallException(ex);
- }
}
Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/marshaller/JavaPhysicalChangeSetMarshallerTest.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/marshaller/JavaPhysicalChangeSetMarshallerTest.java?view=diff&rev=514263&r1=514262&r2=514263
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/marshaller/JavaPhysicalChangeSetMarshallerTest.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/marshaller/JavaPhysicalChangeSetMarshallerTest.java Sat Mar 3 15:10:18 2007
@@ -63,8 +63,9 @@
marshallers[2] = new JavaPhysicalReferenceDefinitionMarshaller();
marshallers[3] = new PhysicalOperationDefinitionMarshaller();
marshallers[4] = new PhysicalWireDefinitionMarshaller();
+ marshallers[5] = new PhysicalChangeSetMarshaller();
- for(int i = 0;i < 5; i++) {
+ for(int i = 0;i < 6; i++) {
marshallers[i].setRegistry(registry);
}
@@ -76,7 +77,8 @@
InputStream inputStream = cl.getResourceAsStream("marshall/javaChangeSet.xml");
XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(inputStream);
- PhysicalChangeSet changeSet = registry.unmarshallChangeSet(reader);
+ reader.next();
+ PhysicalChangeSet changeSet = (PhysicalChangeSet) registry.unmarshall(reader);
assertNotNull(changeSet);
Set<? extends PhysicalComponentDefinition> pcds = changeSet.getComponentDefinitions();
assertEquals(2, pcds.size());
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshallerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshallerRegistry.java?view=diff&rev=514263&r1=514262&r2=514263
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshallerRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshallerRegistry.java Sat Mar 3 15:10:18 2007
@@ -23,7 +23,6 @@
import javax.xml.stream.XMLStreamWriter;
import org.apache.tuscany.spi.model.ModelObject;
-import org.apache.tuscany.spi.model.physical.PhysicalChangeSet;
/**
* A registry for model object marshallers.
@@ -57,21 +56,5 @@
* @return Model object from the marshalled stream.
*/
ModelObject unmarshall(XMLStreamReader reader) throws MarshallException;
-
- /**
- * Marshalls a physical change set.
- *
- * @param changeSet Model object to be marshalled.
- * @param writer Writer to which marshalled information is written.
- */
- void marshallChangeSet(PhysicalChangeSet changeSet, XMLStreamWriter writer) throws MarshallException;
-
- /**
- * Unmarshalls an XML stream to a physical change set.
- *
- * @param reader Reader from which marshalled information is read.
- * @return Physical change set from the marshalled stream.
- */
- PhysicalChangeSet unmarshallChangeSet(XMLStreamReader reader) throws MarshallException;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org