2525import io .kaoto .forage .core .util .config .ConfigStore ;
2626import io .kaoto .forage .jms .common .ConnectionFactoryCommonExportHelper ;
2727import io .kaoto .forage .jms .common .ConnectionFactoryConfig ;
28- import io .kaoto .forage .jms .common .ForageConnectionFactory ;
2928
3029@ ForageFactory (
3130 value = "JMS Connection" ,
@@ -130,8 +129,8 @@ public void configure() {
130129 for (String name : prefixes ) {
131130 if (camelContext .getRegistry ().lookupByNameAndType (name , ConnectionFactory .class ) == null ) {
132131 ConnectionFactoryConfig cfConfig = new ConnectionFactoryConfig (name );
133- ForageConnectionFactory forageConnectionFactory = newConnectionFactory (cfConfig , name );
134- camelContext .getRegistry ().bind (name , forageConnectionFactory . connectionFactory () );
132+ ConnectionFactory connectionFactory = newConnectionFactory (cfConfig , name );
133+ camelContext .getRegistry ().bind (name , connectionFactory );
135134 }
136135 }
137136 } else {
@@ -141,11 +140,8 @@ public void configure() {
141140 final List <ServiceLoader .Provider <ConnectionFactoryProvider >> providers =
142141 findProviders (ConnectionFactoryProvider .class );
143142 if (providers .size () == 1 ) {
144- ForageConnectionFactory forageConnectionFactory =
145- doCreateConnectionFactory (providers .get (0 ), null );
146- camelContext
147- .getRegistry ()
148- .bind (DEFAULT_CONNECTION_FACTORY , forageConnectionFactory .connectionFactory ());
143+ ConnectionFactory connectionFactory = doCreateConnectionFactory (providers .get (0 ), null );
144+ camelContext .getRegistry ().bind (DEFAULT_CONNECTION_FACTORY , connectionFactory );
149145 } else {
150146 throw new IllegalArgumentException (
151147 "No ConnectionFactory implementation is present in the classpath" );
@@ -157,7 +153,7 @@ public void configure() {
157153 }
158154 }
159155
160- private synchronized ForageConnectionFactory newConnectionFactory (
156+ private synchronized ConnectionFactory newConnectionFactory (
161157 ConnectionFactoryConfig connectionFactoryConfig , String name ) {
162158 final String connectionFactoryProviderClass =
163159 ConnectionFactoryCommonExportHelper .transformJmsKindIntoProviderClass (
@@ -178,10 +174,10 @@ private synchronized ForageConnectionFactory newConnectionFactory(
178174 return doCreateConnectionFactory (connectionFactoryProvider , name );
179175 }
180176
181- private ForageConnectionFactory doCreateConnectionFactory (
177+ private ConnectionFactory doCreateConnectionFactory (
182178 ServiceLoader .Provider <ConnectionFactoryProvider > provider , String name ) {
183179 final ConnectionFactoryProvider connectionFactoryProvider = provider .get ();
184- return new ForageConnectionFactory ( connectionFactoryProvider .create (name ) );
180+ return connectionFactoryProvider .create (name );
185181 }
186182
187183 @ Override
0 commit comments