class JmsPoolConnectionFactory implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory {

    public void setConnectionFactory(final Object factory) {
        if (factory instanceof ConnectionFactory) {
            String logMessage = "JMS ConnectionFactory on classpath is not a JMS 2.0+ version.";
            try {
                ConnectionFactory.class.getMethod("createContext", int.class);
                logMessage = "Provided ConnectionFactory implementation is not JMS 2.0+ capable.";
                factory.getClass().getMethod("createContext", int.class);
                logMessage = "Provided ConnectionFactory implementation is JMS 2.0+ capable.";
                jmsContextSupported = true;
            } catch (NoSuchMethodException | SecurityException e) {
            } finally {
                LOG.info(logMessage);
            }

            this.connectionFactory = factory;
        } else {
            throw new IllegalArgumentException("connectionFactory should implement javax.jms.ConnectionFactory");
        }
    }

}