/*
 * $Log: MessageWrapper.java,v $
 * Revision 1.3  2007-11-15 12:38:08  europe\L190409
 * fixed message wrapping
 *
 * Revision 1.2  2007/10/08 12:24:31  Gerrit van Brakel <gerrit.van.brakel@ibissource.org>
 * changed HashMap to Map where possible
 *
 * Revision 1.1  2007/09/13 09:08:00  Gerrit van Brakel <gerrit.van.brakel@ibissource.org>
 * move message wrapper from ifsa to receivers
 *
 * Revision 1.1  2005/09/22 16:07:50  Gerrit van Brakel <gerrit.van.brakel@ibissource.org>
 * introduction of IfsaMessageWrapper
 *
 */
package nl.nn.adapterframework.receivers;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import nl.nn.adapterframework.core.IListener;
import nl.nn.adapterframework.core.IMessageWrapper;
import nl.nn.adapterframework.core.ListenerException;

/**
 * Wrapper for messages that are not serializable.
 * 
 * @author  Gerrit van Brakel
 * @since   4.3
 * @version Id
 */
public class MessageWrapper implements Serializable, IMessageWrapper {

	static final long serialVersionUID = -8251009650246241025L;
	
	private Map context = new HashMap();
	private String text; 
	private String id; 
	
	public MessageWrapper()  {
		super();
	}
	public MessageWrapper(Object message, IListener listener) throws ListenerException  {
		this();
		text = listener.getStringFromRawMessage(message, context);
		id = listener.getIdFromRawMessage(message, context);
	}

	public Map getContext() {
		return context;
	}

	public void setId(String string) {
		id = string;
	}
	public String getId() {
		return id;
	}

	public void setText(String string) {
		text = string;
	}
	public String getText() {
		return text;
	}
}

@@ -47,30 +47,30 @@
 n 1.
-3
+4
   200
-7-11-15 12:38:08
+8-01-11 14:52:52
   eu
@@ -82,16 +82,167 @@
 L190409%0A
+ * remove non serializable original message from context%0A *%0A * Revision 1.3  2007/11/15 12:38:08  Gerrit van Brakel %3Cgerrit.van.brakel@ibissource.org%3E%0A
  * fixed
@@ -946,16 +946,95 @@
 ception;
+%0Aimport nl.nn.adapterframework.extensions.ifsa.jms.PushingIfsaProviderListener;
 %0A%0A/**%0A *
@@ -1509,16 +1509,16 @@
 this();%0A
-
 %09%09text =
@@ -1570,16 +1570,115 @@
 ntext);%0A
+%09%09Object rm = context.remove(PushingIfsaProviderListener.THREAD_CONTEXT_ORIGINAL_RAW_MESSAGE_KEY);%0A
 %09%09id = l

remove non serializable original message from context