@SuppressWarnings({"unchecked"}) public ConnectionFactory create(ConnectionFactoryConfiguration configuration) throws Fabric3Exception { if (creators.isEmpty()) { throw new Fabric3Exception("JMS Provider not installed"); } String provider = configuration.getProvider(); ConnectionFactoryCreator creator = provider == null ? creators.values().iterator().next() : creators.get(provider); if (creator == null) { throw new Fabric3Exception("Provider not found: " + provider); } ConnectionFactory factory = creator.create(configuration); factories.put(factory, creator); return factory; }