Author: bcarothers
Date: 2009-12-31 09:14:56 -0500 (Thu, 31 Dec 2009)
New Revision: 1504
Modified:
trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java
Log:
DNA-609 DnaEngine RepositoryConnectionFactory Returns Unpooled Connections
Applied path that removes DnaEngine's internal connection factory and replaces it with
getRepositoryService().getRepositoryLibrary(). This will return connections that have been
wrapped/pooled by a RepositoryConnectionPool.
Modified: trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java
===================================================================
--- trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java 2009-12-31
14:08:13 UTC (rev 1503)
+++ trunk/dna-repository/src/main/java/org/jboss/dna/repository/DnaEngine.java 2009-12-31
14:14:56 UTC (rev 1504)
@@ -46,7 +46,6 @@
import org.jboss.dna.graph.Location;
import org.jboss.dna.graph.Node;
import org.jboss.dna.graph.Subgraph;
-import org.jboss.dna.graph.connector.RepositoryConnection;
import org.jboss.dna.graph.connector.RepositoryConnectionFactory;
import org.jboss.dna.graph.connector.RepositoryContext;
import org.jboss.dna.graph.connector.RepositorySource;
@@ -84,8 +83,6 @@
private final ExecutorService executorService;
private final MimeTypeDetectors detectors;
- private final RepositoryConnectionFactory connectionFactory;
-
protected DnaEngine( ExecutionContext context,
DnaConfiguration.ConfigurationDefinition configuration ) {
this.problems = new SimpleProblems();
@@ -130,20 +127,9 @@
for (SequencerConfig sequencerConfig : scanner.getSequencingConfigurations()) {
sequencingService.addSequencer(sequencerConfig);
}
-
- // Set up the connection factory for this engine ...
- connectionFactory = new RepositoryConnectionFactory() {
- public RepositoryConnection createConnection( String sourceName ) throws
RepositorySourceException {
- RepositorySource source =
DnaEngine.this.getRepositorySource(sourceName);
- if (source == null) {
- throw new RepositorySourceException(sourceName);
- }
-
- return source.getConnection();
- }
- };
}
+
/**
* Get the problems that were encountered when setting up this engine from the
configuration.
*
@@ -182,7 +168,7 @@
*/
public final RepositoryConnectionFactory getRepositoryConnectionFactory() {
checkRunning();
- return connectionFactory;
+ return repositoryService.getRepositoryLibrary();
}
/**
Show replies by date