/* Copyright 2013, 2016 Nationale-Nederlanden 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 nl.nn.adapterframework.senders; import nl.nn.adapterframework.configuration.ConfigurationException; import nl.nn.adapterframework.core.ISender; import nl.nn.adapterframework.core.SenderException; import nl.nn.adapterframework.core.TimeOutException; import nl.nn.adapterframework.util.LogUtil; import org.apache.log4j.Logger; /** * Baseclass for senders. * * <p><b>Configuration:</b> * <table border="1"> * <tr><th>attributes</th><th>description</th><th>default</th></tr> * <tr><td>{@link #setName(String) name}</td><td>name of the Sender</td><td> </td></tr> * </table> * * @author Gerrit van Brakel * @since 4.9 */ public abstract class SenderBase implements ISender { protected Logger log = LogUtil.getLogger(this); private String name; public void configure() throws ConfigurationException { } public void open() throws SenderException { } public void close() throws SenderException { } public abstract String sendMessage(String correlationID, String message) throws SenderException, TimeOutException; public boolean isSynchronous() { return true; } protected String getLogPrefix() { return "["+this.getClass().getName()+"] ["+getName()+"] "; } public void setName(String name) { this.name=name; } public String getName() { return name; } }