public StatementLocksFactory select() { StatementLocksFactory statementLocksFactory; String serviceName = StatementLocksFactory.class.getSimpleName(); List<StatementLocksFactory> factories = serviceLoadFactories(); if ( factories.isEmpty() ) { statementLocksFactory = new SimpleStatementLocksFactory(); log.info( "No services implementing " + serviceName + " found. " + "Using " + SimpleStatementLocksFactory.class.getSimpleName() ); } else if ( factories.size() == 1 ) { statementLocksFactory = factories.get( 0 ); log.info( "Found single implementation of " + serviceName + ". Namely " + statementLocksFactory.getClass().getSimpleName() ); } else { throw new IllegalStateException( "Found more than one implementation of " + serviceName + ": " + factories ); } statementLocksFactory.initialize( locks, config ); return statementLocksFactory; }
public StatementLocksFactory select() { StatementLocksFactory statementLocksFactory; String serviceName = StatementLocksFactory.class.getSimpleName(); List<StatementLocksFactory> factories = serviceLoadFactories(); if ( factories.isEmpty() ) { statementLocksFactory = new SimpleStatementLocksFactory(); log.info( "No services implementing " + serviceName + " found. " + "Using " + SimpleStatementLocksFactory.class.getSimpleName() ); } else if ( factories.size() == 1 ) { statementLocksFactory = factories.get( 0 ); log.info( "Found single implementation of " + serviceName + ". Namely " + statementLocksFactory.getClass().getSimpleName() ); } else { throw new IllegalStateException( "Found more than one implementation of " + serviceName + ": " + factories ); } statementLocksFactory.initialize( locks, config ); return statementLocksFactory; }