<commit_before>/*
 * $Log: ConnectionFactoryBase.java,v $
 * Revision 1.2  2005-10-20 15:34:09  europe\L190409
 * renamed JmsConnection into ConnectionBase
 *
 * Revision 1.1  2005/05/03 15:59:55  <NAME> <<EMAIL>>
 * rework of shared connection code
 *
 */
package nl.nn.adapterframework.jms;

import java.util.HashMap;

import javax.jms.ConnectionFactory;
import javax.naming.Context;
import javax.naming.NamingException;

import nl.nn.adapterframework.core.IbisException;

import org.apache.log4j.Logger;

/**
 * Factory for JMS connections, to share them for JMS Objects that can use the same. 
 * 
 * @author <NAME>
 * @version Id
 */
public abstract class ConnectionFactoryBase  {
	public static final String version="$Id: ConnectionFactoryBase.java,v 1.2 2005-10-20 15:34:09 europe\L190409 Exp $";
	protected Logger log = Logger.getLogger(this.getClass());

	protected abstract HashMap getConnectionMap();
	protected abstract Context createContext() throws NamingException;
	protected abstract ConnectionFactory createConnectionFactory(Context context, String id) throws IbisException, NamingException;
	
	protected ConnectionBase createJmsConnection(String id) throws IbisException {
		Context context = getContext();
		ConnectionFactory connectionFactory = getConnectionFactory(context, id); 
		return new ConnectionBase(id, context, connectionFactory, getConnectionMap());<commit_msg>corrected version String<commit_after>/*
 * $Log: ConnectionFactoryBase.java,v $
 * Revision 1.3  2005-10-20 15:35:25  europe\L190409
 * corrected version String
 *
 * Revision 1.2  2005/10/20 15:34:09  <NAME> <<EMAIL>>
 * renamed JmsConnection into ConnectionBase
 *
 * Revision 1.1  2005/05/03 15:59:55  <NAME> <<EMAIL>>
 * rework of shared connection code
 *
 */
package nl.nn.adapterframework.jms;

import java.util.HashMap;

import javax.jms.ConnectionFactory;
import javax.naming.Context;
import javax.naming.NamingException;

import nl.nn.adapterframework.core.IbisException;

import org.apache.log4j.Logger;

/**
 * Factory for JMS connections, to share them for JMS Objects that can use the same. 
 * 
 * @author <NAME>
 * @version Id
 */
public abstract class ConnectionFactoryBase  {
	public static final String version="$RCSfile: ConnectionFactoryBase.java,v $ $Revision: 1.3 $ $Date: 2005-10-20 15:35:25 $";
	protected Logger log = Logger.getLogger(this.getClass());

	protected abstract HashMap getConnectionMap();
	protected abstract Context createContext() throws NamingException;
	protected abstract ConnectionFactory createConnectionFactory(Context context, String id) throws IbisException, NamingException;
	
	protected ConnectionBase createJmsConnection(String id) throws IbisException {
		Context context = getContext();
		ConnectionFactory connectionFactory = getConnectionFactory(context, id); 
		return new ConnectionBase(id, context, connectionFactory, getConnectionMap());
{'fraction_non_alphanumeric': 0.09719820131442407, 'fraction_numerical': 0.04565894154271878, 'mean_word_length': 5.426666666666667, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5324826', 'n_tokens_mistral': 915, 'n_tokens_neox': 817, 'n_words': 238}