diff --git a/spring-integration-core/pom.xml b/spring-integration-core/pom.xml
index cbcdff546b..4978bc5bff 100644
--- a/spring-integration-core/pom.xml
+++ b/spring-integration-core/pom.xml
@@ -16,6 +16,7 @@
org.codehaus.jackson
jackson-mapper-asl
1.4.3
+ true
org.springframework
@@ -29,6 +30,11 @@
org.springframework
spring-tx
+
+ org.springframework.commons
+ spring-commons-serializer
+ true
+
junit
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializationFailureException.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializationFailureException.java
deleted file mode 100644
index 4938bfef0e..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializationFailureException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-/**
- * @author Gary Russell
- * @since 2.0
- *
- */
-@SuppressWarnings("serial")
-public class DeserializationFailureException extends SerializationException {
-
- /**
- * Construct a DeserializationException with the specified detail message.
- * @param msg the detail message
- */
- public DeserializationFailureException(String msg) {
- super(msg);
- }
-
- /**
- * Construct a DeserializationFailureException with the specified detail message
- * and nested exception.
- * @param msg the detail message
- * @param cause the nested exception
- */
- public DeserializationFailureException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializingConverter.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializingConverter.java
deleted file mode 100644
index e823ff615b..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/DeserializingConverter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-import org.springframework.core.convert.converter.Converter;
-
-/**
- * A {@link Converter} that delegates to a {@link InputStreamingConverter}
- * to convert data in a byte[] to an object.
- *
- * @author Gary Russell
- * @since 2.0
- *
- */
-public class DeserializingConverter implements Converter {
-
- private InputStreamingConverter streamingConverter;
-
- /**
- * @param streamingConverter the InputStreamingConverter
- */
- public DeserializingConverter(InputStreamingConverter streamingConverter) {
- this.streamingConverter = streamingConverter;
- }
-
- public Object convert(byte[] source) {
- ByteArrayInputStream byteStream = new ByteArrayInputStream(source);
- try {
- return streamingConverter.convert(byteStream);
- }
- catch (Exception e) {
- try {
- byteStream.close();
- } catch (IOException e1) { }
- throw new DeserializationFailureException(
- "Failed to deserialize payload. Is the byte array a result of Object serialization?", e);
- }
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/InputStreamingConverter.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/InputStreamingConverter.java
deleted file mode 100644
index 8a47a14226..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/InputStreamingConverter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * An standard interface to convert from data in an InputStream to
- * an Object.
- *
- * @author Gary Russell
- * @since 2.0
- *
- */
-public interface InputStreamingConverter {
-
- /**
- * Read (assemble an object of type T) from an InputStream.
- * @param inputStream The InputStream.
- * @return The object.
- * @throws IOException
- */
- public T convert(InputStream inputStream) throws IOException;
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/OutputStreamingConverter.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/OutputStreamingConverter.java
deleted file mode 100644
index 58a7afd927..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/OutputStreamingConverter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-/**
- * A standard interface to stream an object to an OutputStream.
- *
- * @author Gary Russell
- * @since 2.0
- *
- */
-public interface OutputStreamingConverter {
-
- /**
- * Write an object of type T to the outputSream.
- * @param object The object.
- * @param outputStream The outputStream.
- * @throws IOException
- */
- public void convert(T object, OutputStream outputStream) throws IOException;
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationException.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationException.java
deleted file mode 100644
index e1a398cb0b..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationException.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import org.springframework.core.NestedRuntimeException;
-
-/**
- * @author Gary Russell
- * @since 2.0
- *
- */
-@SuppressWarnings("serial")
-public abstract class SerializationException extends NestedRuntimeException {
-
- /**
- * Construct a SerializationException with the specified detail message.
- * @param msg the detail message
- */
- public SerializationException(String msg) {
- super(msg);
- }
-
- /**
- * Construct a SerializationException with the specified detail message
- * and nested exception.
- * @param msg the detail message
- * @param cause the nested exception
- */
- public SerializationException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationFailureException.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationFailureException.java
deleted file mode 100644
index f89168508c..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializationFailureException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-/**
- * @author Gary Russell
- * @since 2.0
- *
- */
-@SuppressWarnings("serial")
-public class SerializationFailureException extends SerializationException {
-
- /**
- * Construct a SerializationFailureException with the specified detail message.
- * @param msg the detail message
- */
- public SerializationFailureException(String msg) {
- super(msg);
- }
-
- /**
- * Construct a SerializationFailureException with the specified detail message
- * and nested exception.
- * @param msg the detail message
- * @param cause the nested exception
- */
- public SerializationFailureException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializingConverter.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializingConverter.java
deleted file mode 100644
index c86d2a68a0..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/SerializingConverter.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import java.io.ByteArrayOutputStream;
-
-import org.springframework.core.convert.converter.Converter;
-
-/**
- * A {@Link Converter} that delegates to a {@link OutputStreamingConverter}
- * to convert an object to a byte[].
- *
- * @author Gary Russell
- * @since 2.0
- *
- */
-public class SerializingConverter implements Converter {
-
- private OutputStreamingConverter streamingConverter;
-
- /**
- * @param streamingConverter the OutputStreamingConverter
- */
- public SerializingConverter(OutputStreamingConverter streamingConverter) {
- this.streamingConverter = streamingConverter;
- }
-
- public byte[] convert(Object source) {
- ByteArrayOutputStream byteStream = new ByteArrayOutputStream(128);
- try {
- this.streamingConverter.convert(source, byteStream);
- return byteStream.toByteArray();
- } catch (Exception e) {
- throw new SerializationFailureException("Failed to serialize", e);
- }
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/JavaStreamingConverter.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/JavaStreamingConverter.java
deleted file mode 100644
index 808473dfad..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/JavaStreamingConverter.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer.java;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-import org.springframework.commons.serializer.InputStreamingConverter;
-import org.springframework.commons.serializer.OutputStreamingConverter;
-import org.springframework.util.Assert;
-
-
-/**
- * Converter that implements both input and output streaming using Java
- * Serialization.
- *
- * @author Gary Russell
- * @since 2.0
- *
- */
-public class JavaStreamingConverter
- implements InputStreamingConverter,
- OutputStreamingConverter {
-
- public Object convert(InputStream inputStream) throws IOException {
- ObjectInputStream objectInputStream = null;
- try {
- objectInputStream = new ObjectInputStream(inputStream);
- return objectInputStream.readObject();
- } catch (ClassNotFoundException e) {
- if (objectInputStream != null) {
- objectInputStream.close();
- }
- throw new IOException(e.getMessage());
- }
- }
-
- /**
- * Source object must implement {@link Serializable}.
- */
- public void convert(Object object, OutputStream outputStream)
- throws IOException {
- Assert.isTrue(object instanceof Serializable, this.getClass().getName()
- + " requires a Serializable payload, but received [" +
- object.getClass().getName() + "]");
- ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
- objectOutputStream.writeObject(object);
- objectOutputStream.flush();
- }
-
-}
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/package-info.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/package-info.java
deleted file mode 100644
index 05c2bbce52..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/java/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Implementation of In/Out JavaStreamingConverter.
- */
-package org.springframework.commons.serializer.java;
-
diff --git a/spring-integration-core/src/main/java/org/springframework/commons/serializer/package-info.java b/spring-integration-core/src/main/java/org/springframework/commons/serializer/package-info.java
deleted file mode 100644
index 4d0e7300bd..0000000000
--- a/spring-integration-core/src/main/java/org/springframework/commons/serializer/package-info.java
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- *
- * Root package for Spring commons' serializer interfaces and implementations.
- * Provides an abstraction over various serialization techniques.
- * Includes exceptions for serialization and deserialization failures.
- * Actual (de)serializers are in subpackages.
- */
-package org.springframework.commons.serializer;
-
diff --git a/spring-integration-core/src/test/java/org/springframework/commons/serializer/JavaSerializationTests.java b/spring-integration-core/src/test/java/org/springframework/commons/serializer/JavaSerializationTests.java
deleted file mode 100644
index d9224596c1..0000000000
--- a/spring-integration-core/src/test/java/org/springframework/commons/serializer/JavaSerializationTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.commons.serializer;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.NotSerializableException;
-import java.io.Serializable;
-
-import org.junit.Test;
-import org.springframework.commons.serializer.java.JavaStreamingConverter;
-
-
-/**
- * @author Gary Russell
- * @since 2.0
- *
- */
-public class JavaSerializationTests {
-
- @Test
- public void testGood() {
- JavaStreamingConverter streamingConverter = new JavaStreamingConverter();
- SerializingConverter toBytes = new SerializingConverter(streamingConverter);
- byte[] bytes = toBytes.convert("Testing");
- DeserializingConverter fromBytes = new DeserializingConverter(streamingConverter);
- assertEquals("Testing", fromBytes.convert(bytes));
- }
-
- @Test
- public void testBadSerializeNotSerializable() {
- SerializingConverter toBytes = new SerializingConverter(new JavaStreamingConverter());
- try {
- toBytes.convert(new Object());
- fail("Expected IllegalArgumentException");
- } catch (SerializationFailureException e) {
- assertNotNull(e.getCause());
- assertTrue(e.getCause() instanceof IllegalArgumentException);
- }
-
- }
-
- @Test
- public void testBadSerializeNotSerializableField() {
- SerializingConverter toBytes = new SerializingConverter(new JavaStreamingConverter());
- try {
- toBytes.convert(new UnSerializable());
- fail("Expected SerializationFailureException");
- } catch (SerializationFailureException e) {
- assertNotNull(e.getCause());
- assertTrue(e.getCause() instanceof NotSerializableException);
- }
-
- }
-
- @Test
- public void testBadDeserialize() {
- DeserializingConverter fromBytes = new DeserializingConverter(new JavaStreamingConverter());
- try {
- fromBytes.convert("Junk".getBytes());
- fail("Expected DeserializationFailureException");
- } catch (DeserializationFailureException e) { }
- }
-
- class UnSerializable implements Serializable {
- private static final long serialVersionUID = 1L;
- @SuppressWarnings("unused")
- private Object object;
- }
-}
diff --git a/spring-integration-event/.classpath b/spring-integration-event/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-event/.classpath
+++ b/spring-integration-event/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-groovy/.classpath b/spring-integration-groovy/.classpath
index f42fb64cfa..438f0fe3b3 100644
--- a/spring-integration-groovy/.classpath
+++ b/spring-integration-groovy/.classpath
@@ -1,9 +1,9 @@
-
+
-
+
diff --git a/spring-integration-http/.classpath b/spring-integration-http/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-http/.classpath
+++ b/spring-integration-http/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-httpinvoker/.classpath b/spring-integration-httpinvoker/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-httpinvoker/.classpath
+++ b/spring-integration-httpinvoker/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-ip/.classpath b/spring-integration-ip/.classpath
index 028ca809b7..7406f09944 100644
--- a/spring-integration-ip/.classpath
+++ b/spring-integration-ip/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-ip/pom.xml b/spring-integration-ip/pom.xml
index ebb6e47988..9a6314c88e 100644
--- a/spring-integration-ip/pom.xml
+++ b/spring-integration-ip/pom.xml
@@ -26,6 +26,10 @@
spring-integration-stream
runtime
+
+ org.springframework.commons
+ spring-commons-serializer
+
cglib
diff --git a/spring-integration-jms/.classpath b/spring-integration-jms/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-jms/.classpath
+++ b/spring-integration-jms/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-jmx/.classpath b/spring-integration-jmx/.classpath
index d8b3f86eb6..85b5f296bb 100644
--- a/spring-integration-jmx/.classpath
+++ b/spring-integration-jmx/.classpath
@@ -1,7 +1,7 @@
-
+
diff --git a/spring-integration-mail/.classpath b/spring-integration-mail/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-mail/.classpath
+++ b/spring-integration-mail/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-parent/pom.xml b/spring-integration-parent/pom.xml
index 85a4578af0..20c4da42b1 100644
--- a/spring-integration-parent/pom.xml
+++ b/spring-integration-parent/pom.xml
@@ -58,6 +58,9 @@
+
+ legacy-build
+
@@ -77,12 +80,15 @@
s3://maven.springframework.org/snapshot
-
+
+
org.aspectj
@@ -174,11 +180,18 @@
spring-integration-stream
${project.version}
+
+ org.springframework.commons
+ spring-commons-serializer
+ 1.0.0.BUILD-SNAPSHOT
+
-
+
+
cglib
cglib-nodep
${cglib.version}
@@ -234,11 +247,14 @@
-
+
+
log4j
log4j
@@ -249,7 +265,10 @@
-
+
org.springframework.build.aws
org.springframework.build.aws.maven
3.0.0.RELEASE
@@ -332,14 +351,20 @@
-
+
+
com.springsource.bundlor
com.springsource.bundlor.maven
1.0.0.RELEASE
@@ -355,8 +380,11 @@
-
+
+
org.apache.maven.plugins
maven-jar-plugin
2.2
@@ -371,9 +399,12 @@
-
+
+
org.apache.maven.plugins
maven-project-info-reports-plugin
2.1
diff --git a/spring-integration-rmi/.classpath b/spring-integration-rmi/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-rmi/.classpath
+++ b/spring-integration-rmi/.classpath
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/spring-integration-stream/.classpath b/spring-integration-stream/.classpath
index ddc9103c5c..f14ce4afb4 100644
--- a/spring-integration-stream/.classpath
+++ b/spring-integration-stream/.classpath
@@ -1,8 +1,8 @@
-
-
+
+