Search in sources :

Example 11 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class AbstractPipe method registerForward.

/**
 * Register a PipeForward object to this Pipe. Global Forwards are added
 * by the PipeLine. If a forward is already registered, it logs a warning.
 * @param forward
 * @see nl.nn.adapterframework.core.PipeLine
 * @see PipeForward
 */
@Override
public void registerForward(PipeForward forward) {
    PipeForward current = pipeForwards.get(forward.getName());
    if (current == null) {
        pipeForwards.put(forward.getName(), forward);
    } else {
        if (!isRecoverAdapter()) {
            if (forward.getPath().equals(current.getPath())) {
                ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
                String msg = getLogPrefix(null) + "PipeForward [" + forward.getName() + "] pointing to [" + forward.getPath() + "] already registered";
                configWarnings.add(log, msg);
            } else {
                log.info(getLogPrefix(null) + "PipeForward [" + forward.getName() + "] already registered, pointing to [" + current.getPath() + "]. Ignoring new one, that points to [" + forward.getPath() + "]");
            }
        }
    }
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) PipeForward(nl.nn.adapterframework.core.PipeForward)

Example 12 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class AbstractPipe method configure.

/**
 * <code>configure()</code> is called after the {@link nl.nn.adapterframework.core.PipeLine Pipeline} is registered
 * at the {@link nl.nn.adapterframework.core.Adapter Adapter}. Purpose of this method is to reduce
 * creating connections to databases etc. in the {@link #doPipe(Object) doPipe()} method.
 * As much as possible class-instantiating should take place in the
 * <code>configure()</code> method, to improve performance.
 */
@Override
public void configure() throws ConfigurationException {
    ParameterList params = getParameterList();
    if (params != null) {
        try {
            params.configure();
        } catch (ConfigurationException e) {
            throw new ConfigurationException(getLogPrefix(null) + "while configuring parameters", e);
        }
    }
    if (!StringUtils.isEmpty(getElementToMove()) && !StringUtils.isEmpty(getElementToMoveChain())) {
        throw new ConfigurationException(getLogPrefix(null) + "cannot have both an elementToMove and an elementToMoveChain specified");
    }
    if (pipeForwards.isEmpty()) {
        ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
        String msg = getLogPrefix(null) + "has no forwards defined.";
        configWarnings.add(log, msg);
    } else {
        for (Iterator<String> it = pipeForwards.keySet().iterator(); it.hasNext(); ) {
            String forwardName = it.next();
            PipeForward forward = pipeForwards.get(forwardName);
            if (forward != null) {
                String path = forward.getPath();
                if (path != null) {
                    PipeLineExit plExit = pipeline.getPipeLineExits().get(path);
                    if (plExit == null) {
                        if (pipeline.getPipe(path) == null) {
                            ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
                            String msg = getLogPrefix(null) + "has a forward of which the pipe to execute [" + path + "] is not defined.";
                            configWarnings.add(log, msg);
                        }
                    }
                }
            }
        }
    }
    if (getLocker() != null) {
        getLocker().configure();
    }
    eventHandler = MonitorManager.getEventHandler();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) ParameterList(nl.nn.adapterframework.parameters.ParameterList) PipeForward(nl.nn.adapterframework.core.PipeForward) PipeLineExit(nl.nn.adapterframework.core.PipeLineExit)

Example 13 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class CommandSender method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix() + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + getClass().getSuperclass().getName() + "]";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 14 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class LogSender method configure.

public void configure() throws ConfigurationException {
    super.configure();
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix() + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + getClass().getSuperclass().getName() + "]";
    configWarnings.add(log, msg);
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Example 15 with ConfigurationWarnings

use of nl.nn.adapterframework.configuration.ConfigurationWarnings in project iaf by ibissource.

the class FixedResultSender method configure.

public void configure() throws ConfigurationException {
    ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
    String msg = getLogPrefix() + "The class [" + getClass().getName() + "] has been deprecated. Please change to [" + getClass().getSuperclass().getName() + "]";
    configWarnings.add(log, msg);
    super.configure();
}
Also used : ConfigurationWarnings(nl.nn.adapterframework.configuration.ConfigurationWarnings)

Aggregations

ConfigurationWarnings (nl.nn.adapterframework.configuration.ConfigurationWarnings)58 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)16 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)5 ArrayList (java.util.ArrayList)4 ITransactionalStorage (nl.nn.adapterframework.core.ITransactionalStorage)3 PipeForward (nl.nn.adapterframework.core.PipeForward)3 ReceiverBase (nl.nn.adapterframework.receivers.ReceiverBase)3 URL (java.net.URL)2 BaseConfigurationWarnings (nl.nn.adapterframework.configuration.BaseConfigurationWarnings)2 Configuration (nl.nn.adapterframework.configuration.Configuration)2 HasPhysicalDestination (nl.nn.adapterframework.core.HasPhysicalDestination)2 ISender (nl.nn.adapterframework.core.ISender)2 EsbSoapWrapperPipe (nl.nn.adapterframework.extensions.esb.EsbSoapWrapperPipe)2 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Connection (java.sql.Connection)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 SQLException (java.sql.SQLException)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1