/*
 * $Log: SenderWithParametersBase.java,v $
 * Revision 1.3  2007-02-12 13:44:09  europe\L190409
 * Logger from LogUtil
 *
 * Revision 1.2  2005/08/30 15:55:43  Gerrit van Brakel <gerrit.van.brakel@ibissource.org>
 * added log and getLogPrefix()
 *
 * Revision 1.1  2005/06/20 08:58:13  Gerrit van Brakel <gerrit.van.brakel@ibissource.org>
 * introduction of SenderWithParametersBase
 *
 *
 */
package nl.nn.adapterframework.core;

import nl.nn.adapterframework.configuration.ConfigurationException;
import nl.nn.adapterframework.parameters.Parameter;
import nl.nn.adapterframework.parameters.ParameterList;
import nl.nn.adapterframework.util.LogUtil;

import org.apache.log4j.Logger;

/**
 * Provides a base class for senders with parameters.
 * 
 * @author Gerrit van Brakel
 * @since  4.3
 * @version Id
 */
public abstract class SenderWithParametersBase implements ISenderWithParameters {
	public static final String version="$RCSfile: SenderWithParametersBase.java,v $ $Revision: 1.3 $ $Date: 2007-02-12 13:44:09 $";
	protected Logger log = LogUtil.getLogger(this);
	
	private String name;
	protected ParameterList paramList = null;


	public void configure() throws ConfigurationException {
		if (paramList!=null) {
			paramList.configure();
		}
	}

	public void open() {
	}

	public void close() {
	}

	public String sendMessage(String correlationID, String message) throws SenderException, TimeOutException  {
		return sendMessage(correlationID,message,null);
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void addParameter(Parameter p) {
		if (paramList==null) {
			paramList=new ParameterList();
		}
		paramList.add(p);
	}

	protected String getLogPrefix() {
		return "["+this.getClass().getName()+"] ["+getName()+"] ";
	}

}

@@ -53,17 +53,17 @@
 ision 1.
-3
+4
   2007-0
@@ -64,27 +64,27 @@
 2007-02-
-12 13:44:09
+26 16:53:38
   europe
@@ -92,16 +92,149 @@
 L190409%0A
+ * add throws clause to open and close%0A *%0A * Revision 1.3  2007/02/12 13:44:09  Gerrit van Brakel %3Cgerrit.van.brakel@ibissource.org%3E%0A
  * Logge
@@ -1115,17 +1115,17 @@
 sion: 1.
-3
+4
  $ $Date
@@ -1134,27 +1134,27 @@
 2007-02-
-12 13:44:09
+26 16:53:38
  $%22;%0A%09pr
@@ -1403,16 +1403,39 @@
 d open()
+ throws SenderException
  %7B%0A%09%7D%0A%0A%09
@@ -1453,16 +1453,39 @@
  close()
+ throws SenderException
  %7B%0A%09%7D%0A%0A%09

add throws clause to open and close