[jboss-svn-commits] JBL Code SVN: r14653 - in labs/jbossesb/trunk/product/rosetta: src/org/jboss/internal/soa/esb/message/format/serialized/body/content and 6 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Aug 27 12:44:49 EDT 2007
Author: mark.little at jboss.com
Date: 2007-08-27 12:44:49 -0400 (Mon, 27 Aug 2007)
New Revision: 14653
Removed:
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/CommandBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/CommandBodyImpl.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/CommandBody.java
Modified:
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/Payload.java
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/helper/content/ContentManager.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/SerializedContentManagerUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/XMLContentManagerUnitTest.java
labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/payload/PayloadUnitTest.java
Log:
http://jira.jboss.com/jira/browse/JBESB-911
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -3,7 +3,6 @@
import java.net.URI;
import org.jboss.internal.soa.esb.message.format.serialized.body.content.BytesBodyImpl;
-import org.jboss.internal.soa.esb.message.format.serialized.body.content.CommandBodyImpl;
import org.jboss.internal.soa.esb.message.format.serialized.body.content.MapBodyImpl;
import org.jboss.internal.soa.esb.message.format.serialized.body.content.ObjectBodyImpl;
import org.jboss.internal.soa.esb.message.format.serialized.body.content.TextBodyImpl;
@@ -77,9 +76,6 @@
if (type.equals(Payload.MAP_BODY))
theBody = new MapBodyImpl((BodyImpl) msg.getBody());
- if (type.equals(Payload.COMMAND_BODY))
- theBody = new CommandBodyImpl((BodyImpl) msg.getBody());
-
if (theBody != null)
{
((MessageImpl) msg).replaceBody((BodyImpl) theBody);
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/CommandBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/CommandBodyImpl.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/body/content/CommandBodyImpl.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -1,77 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized.body.content;
-
-import org.jboss.internal.soa.esb.message.format.serialized.BodyImpl;
-import org.jboss.soa.esb.message.body.content.CommandBody;
-import org.jboss.soa.esb.message.body.content.InvalidPayloadException;
-import org.jboss.soa.esb.message.body.content.Payload;
-
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author mark.little at jboss.com
- */
-
-/**
- * Similar to JMS, the Message payload only contains a serializable Object.
- */
-
-public class CommandBodyImpl extends BodyImpl implements CommandBody
-{
- private static final long serialVersionUID = 0xdeadbeef;
-
- public CommandBodyImpl (BodyImpl body)
- {
- super(body);
-
- add(Payload.CONTENT_TYPE, Payload.COMMAND_BODY);
- }
-
- /**
- * Add the type element to the Body.
- *
- * @param value
- * the String to add.
- */
-
- public void setType (String value)
- {
- if (value == null)
- throw new IllegalArgumentException();
-
- super.add(COMMAND_TYPE, value);
- }
-
- /**
- * Obtain the Text from the Body.
- *
- * @return the String.
- */
-
- public String getType () throws InvalidPayloadException
- {
- try
- {
- return (String) super.get(COMMAND_TYPE);
- }
- catch (ClassCastException ex)
- {
- throw new InvalidPayloadException(ex);
- }
- }
-
-}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -3,7 +3,6 @@
import java.net.URI;
import org.jboss.internal.soa.esb.message.format.xml.body.content.BytesBodyImpl;
-import org.jboss.internal.soa.esb.message.format.xml.body.content.CommandBodyImpl;
import org.jboss.internal.soa.esb.message.format.xml.body.content.MapBodyImpl;
import org.jboss.internal.soa.esb.message.format.xml.body.content.ObjectBodyImpl;
import org.jboss.internal.soa.esb.message.format.xml.body.content.TextBodyImpl;
@@ -78,9 +77,6 @@
if (type.equals(Payload.MAP_BODY))
theBody = new MapBodyImpl((BodyImpl) msg.getBody());
-
- if (type.equals(Payload.COMMAND_BODY))
- theBody = new CommandBodyImpl((BodyImpl) msg.getBody());
if (theBody != null)
{
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/CommandBodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/CommandBodyImpl.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/body/content/CommandBodyImpl.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -1,76 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.body.content;
-
-import org.jboss.internal.soa.esb.message.format.xml.BodyImpl;
-import org.jboss.soa.esb.message.body.content.CommandBody;
-import org.jboss.soa.esb.message.body.content.InvalidPayloadException;
-import org.jboss.soa.esb.message.body.content.Payload;
-
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author mark.little at jboss.com
- */
-
-/**
- * Similar to JMS, the Message payload only contains a serializable Object.
- */
-
-public class CommandBodyImpl extends BodyImpl implements CommandBody
-{
-
- public CommandBodyImpl (BodyImpl body)
- {
- super(body);
-
- add(Payload.CONTENT_TYPE, Payload.COMMAND_BODY);
- }
-
- /**
- * Add the type element to the Body.
- *
- * @param value
- * the String to add.
- */
-
- public void setType (String value)
- {
- if (value == null)
- throw new IllegalArgumentException();
-
- super.add(COMMAND_TYPE, value);
- }
-
- /**
- * Obtain the Text from the Body.
- *
- * @return the String.
- */
-
- public String getType () throws InvalidPayloadException
- {
- try
- {
- return (String) super.get(COMMAND_TYPE);
- }
- catch (ClassCastException ex)
- {
- throw new InvalidPayloadException(ex);
- }
- }
-
-}
\ No newline at end of file
Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/CommandBody.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/CommandBody.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/CommandBody.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -1,54 +0,0 @@
-package org.jboss.soa.esb.message.body.content;
-
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.body.content.CommandBody;
-import org.jboss.soa.esb.message.body.content.InvalidPayloadException;
-
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author mark.little at jboss.com
- */
-
-/**
- * CommandBody instance represents a tuple of name and type (of command).
- * Anything else the command needs should be elsewhere within the Message.
- */
-
-public interface CommandBody extends Body
-{
- public static final String COMMAND_TYPE = "org.jboss.soa.esb.message.payload.command.type";
-
- /**
- * Add the type element to the Body.
- *
- * @param value
- * the String to add.
- */
-
- public void setType (String value);
-
- /**
- * Obtain the Text from the Body.
- *
- * @return the String.
- */
-
- public String getType () throws InvalidPayloadException;
-
-}
\ No newline at end of file
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/Payload.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/Payload.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/body/content/Payload.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -49,7 +49,6 @@
public static final String RAW_BODY = "raw";
public static final String BYTES_BODY = "bytes";
public static final String MAP_BODY = "map";
- public static final String COMMAND_BODY = "command";
public static final String OBJECT_BODY = "object";
public static final String TEXT_BODY = "text";
@@ -88,16 +87,6 @@
return (MapBody) MessageFactory.getInstance().createBodyType(msg, MAP_BODY);
}
- public static final CommandBody createCommandBody (Message msg) throws InvalidPayloadException
- {
- if ((msg == null) || (msg.getBody() == null))
- return null;
-
- checkType(msg, COMMAND_BODY);
-
- return (CommandBody) MessageFactory.getInstance().createBodyType(msg, COMMAND_BODY);
- }
-
public static final ObjectBody createObjectBody (Message msg) throws InvalidPayloadException
{
if ((msg == null) || (msg.getBody() == null))
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/helper/content/ContentManager.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/helper/content/ContentManager.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/helper/content/ContentManager.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -6,7 +6,6 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.message.body.content.CommandBody;
import org.jboss.soa.esb.message.body.content.MapBody;
import org.jboss.soa.esb.message.body.content.ObjectBody;
import org.jboss.soa.esb.message.body.content.Payload;
@@ -113,29 +112,6 @@
return null;
}
- public Message createCommandMessage (String initial)
- {
- if (initial == null)
- throw new IllegalArgumentException();
-
- Message msg = MessageFactory.getInstance().getMessage(_type);
-
- try
- {
- CommandBody payload = (CommandBody) MessageFactory.getInstance().createBodyType(msg, Payload.COMMAND_BODY);
-
- payload.setType(initial);
-
- return msg;
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
-
- return null;
- }
-
public Message createBytesMessage (byte[] initial)
{
if (initial == null)
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/SerializedContentManagerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/SerializedContentManagerUnitTest.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/SerializedContentManagerUnitTest.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -33,7 +33,6 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.message.body.content.CommandBody;
import org.jboss.soa.esb.message.body.content.MapBody;
import org.jboss.soa.esb.message.body.content.ObjectBody;
import org.jboss.soa.esb.message.body.content.TextBody;
@@ -74,14 +73,6 @@
assertEquals(body.getString("foo"), "bar");
}
- public void testCommandMessage () throws Exception
- {
- Message msg = _factory.createCommandMessage("foobar");
- CommandBody body = (CommandBody) msg.getBody();
-
- assertEquals(body.getType(), "foobar");
- }
-
public void testBytesMessage () throws Exception
{
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/XMLContentManagerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/XMLContentManagerUnitTest.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/helper/content/XMLContentManagerUnitTest.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -33,7 +33,6 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.message.body.content.CommandBody;
import org.jboss.soa.esb.message.body.content.MapBody;
import org.jboss.soa.esb.message.body.content.ObjectBody;
import org.jboss.soa.esb.message.body.content.TextBody;
@@ -74,14 +73,6 @@
assertEquals(body.getString("foo"), "bar");
}
- public void testCommandMessage () throws Exception
- {
- Message msg = _factory.createCommandMessage("foobar");
- CommandBody body = (CommandBody) msg.getBody();
-
- assertEquals(body.getType(), "foobar");
- }
-
public void testBytesMessage () throws Exception
{
ByteArrayOutputStream stream = new ByteArrayOutputStream();
Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/payload/PayloadUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/payload/PayloadUnitTest.java 2007-08-27 16:37:32 UTC (rev 14652)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/payload/PayloadUnitTest.java 2007-08-27 16:44:49 UTC (rev 14653)
@@ -22,14 +22,12 @@
package org.jboss.soa.esb.message.payload;
-import java.io.IOException;
import java.util.Enumeration;
import junit.framework.TestCase;
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.message.body.content.BytesBody;
-import org.jboss.soa.esb.message.body.content.CommandBody;
import org.jboss.soa.esb.message.body.content.IncompatibleModeException;
import org.jboss.soa.esb.message.body.content.MapBody;
import org.jboss.soa.esb.message.body.content.ObjectBody;
@@ -137,60 +135,4 @@
assertEquals(mapMessage.readShort(), (short) 10);
assertEquals(mapMessage.readBoolean(), true);
}
-
- public void testBytesMessageAsControl() throws Exception
- {
- Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
- assertEquals((msg != null), true);
-
- BytesBody mapMessage = Payload.createBytesBody(msg);
-
- try
- {
- mapMessage.readMode();
-
- fail();
- }
- catch (IOException ex)
- {
- }
-
- try
- {
- mapMessage.writeBoolean(true);
-
- fail();
- }
- catch (IncompatibleModeException ex)
- {
- }
-
- mapMessage.writeMode();
-
- mapMessage.writeInt(12345);
- mapMessage.writeUTFString("hello world");
- mapMessage.writeShort((short) 10);
- mapMessage.writeBoolean(true);
-
- mapMessage.flush();
-
- mapMessage.readMode();
-
- assertEquals(mapMessage.readInt(), 12345);
- assertEquals(mapMessage.readUTFString(), "hello world");
- assertEquals(mapMessage.readShort(), (short) 10);
- assertEquals(mapMessage.readBoolean(), true);
-
- try
- {
- @SuppressWarnings("unused")
- CommandBody payload = Payload.createCommandBody(msg);
-
- fail();
- }
- catch (Exception ex)
- {
- }
- }
}
More information about the jboss-svn-commits
mailing list