<commit_before>/*
 * $Log: ListenerFactory.java,v $
 * Revision 1.2  2007-10-09 15:29:43  europe\L190409
 * Direct copy from Ibis-EJB:
 * first version in HEAD
 *
 */
package nl.nn.adapterframework.configuration;

/**
 * 
 * 
 * @author  <NAME>
 * @since   4.8
 * @version Id
 */
public class ListenerFactory extends AbstractSpringPoweredDigesterFactory {

    /**
     * Default bean to create from the Spring factory is 'proto-jmsListener',
     * a JMS Listener bean.
     * 
     * This is different from the old situation, where the default class was
     * in fact an interface and therefore className could not be left out
     * of the configuration of a Listener.
     * 
     * @see nl.nn.adapterframework.configuration.AbstractSpringPoweredDigesterFactory#getBeanName()
     */
    public String getBeanName() {
        return "proto-jmsListener";
    }

}<commit_msg>Override createObject so that a JMS PullingJmsListener is created instead of a 'default' JmsListener when the parent is instance of MessageSendingPipe; this is for compatibility with the MessageSendingPipe using an instance of ICorrelatedPullingListener (which the PushingJmsListener can not provide).<commit_after>/*
 * $Log: ListenerFactory.java,v $
 * Revision 1.3  2007-10-22 14:42:55  europe\M00035F
 * Override createObject so that a JMS PullingJmsListener is created instead of a 'default' JmsListener when the parent is instance of MessageSendingPipe;
 * this is for compatibility with the MessageSendingPipe using an instance of ICorrelatedPullingListener (which the PushingJmsListener can not provide).
 * 
 * This solution is a workaround to be used until we decide how to refactor the MessageSendingPipe, or if the functionality of correlated listener should be
 * added to PushingJmsListener (which would contradict it's design, and currently have the unwanted side-effect ofcreating a JMS Container for the queue).
 *
 * Revision 1.2  2007/10/09 15:29:43  <NAME> <<EMAIL>>
 * Direct copy from Ibis-EJB:
 * first version in HEAD
 *
 */
package nl.nn.adapterframework.configuration;

import java.util.Map;

import nl.nn.adapterframework.pipes.MessageSendingPipe;

import org.xml.sax.Attributes;

/**
 * 
 * 
 * @author  <NAME>
 * @since   4.8
 * @version Id
 */
public class ListenerFactory extends AbstractSpringPoweredDigesterFactory {

    /**
     * Default bean to create from the Spring factory is 'proto-jmsListener',
     * a JMS Listener bean.
     * 
     * This is different from the old situation, where the default class was
     * in fact an interface and therefore className could not be left out
     * of the configuration of a Listener.
     * 
     * @see nl.nn.adapterframework.configuration.AbstractSpringPoweredDigesterFactory#getBeanName()
     */
    public String getBeanName() {
        return "proto-jmsListener";
    }
    
	/**
	 * @see nl.nn.adapterframework.configuration.AbstractSpringPoweredDigesterFactory#createObject(org.xml.sax.Attributes)
	 */
	public Object createObject(Attributes attrs) throws Exception {
		String className = attrs.getValue("className");
		if (className != null && getDigester().peek() instanceof MessageSendingPipe && className.endsWith(".JmsListener")) {
			return createBeanFromClassName("nl.nn.adapterframework.jms.PullingJmsListener");
		} else {
            return createBeanFromClassName(className);
		}
	}

}
{'fraction_non_alphanumeric': 0.0825906120023767, 'fraction_numerical': 0.01871657754010695, 'mean_word_length': 3.81, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3316409', 'n_tokens_mistral': 1006, 'n_tokens_neox': 946, 'n_words': 318}