001    package biz.hammurapi.jms.adapter.jca;
002    
003    import javax.resource.ResourceException;
004    
005    /**
006     * Connection factory.
007     * @author Pavel
008     */
009    public interface ConnectionFactory {
010            
011            /**
012             * Stateful connection caches proxy instances and as such retains conversational state if
013             * proxy services use local delegates.
014             * @param stateful
015             * @return
016             * @throws ResourceException 
017             */
018            Connection getConnection(boolean stateful) throws ResourceException;
019    
020            /**
021             * Creates stateful connection with pre-set state. 
022             * @param state State obtained from previously used connection.
023             * @return
024             * @throws ResourceException
025             */
026            Connection getConnection(Object state) throws ResourceException;
027    }