@@ -0,0 +1,1934 @@
+/*%0A * Copyright 2011, Allanbank Consulting, Inc. %0A *           All Rights Reserved%0A */%0Apackage com.allanbank.mongodb.connection.bootstrap;%0A%0Aimport java.io.IOException;%0Aimport java.net.InetSocketAddress;%0A%0Aimport com.allanbank.mongodb.MongoDbConfiguration;%0Aimport com.allanbank.mongodb.connection.Connection;%0Aimport com.allanbank.mongodb.connection.ConnectionFactory;%0A%0A/**%0A * Provides the ability to bootstrap into the appropriate%0A * %7B@link ConnectionFactory%7D based on the configuration of the server(s)%0A * connected to.%0A * %0A * @copyright 2011, Allanbank Consulting, Inc., All Rights Reserved%0A */%0Apublic class BootstrapConnectionFactory implements ConnectionFactory %7B%0A%0A%09/** The delegate connection factory post */%0A%09private final ConnectionFactory myDelegate = null;%0A%0A%09/**%0A%09 * Creates a %7B@link BootstrapConnectionFactory%7D%0A%09 * %0A%09 * @param config%0A%09 *            The configuration to use in discovering the server%0A%09 *            configuration.%0A%09 * @throws IOException%0A%09 *             If the bootstrap fails.%0A%09 */%0A%09public BootstrapConnectionFactory(final MongoDbConfiguration config)%0A%09%09%09throws IOException %7B%0A%09%09bootstrap(config);%0A%09%7D%0A%0A%09/**%0A%09 * Re-bootstraps the environment. Normally this method is only called once%0A%09 * during the constructor of the factory to initialize the delegate but%0A%09 * users can reset the delegate by manually invoking this method.%0A%09 * %0A%09 * @param config%0A%09 *            The configuration to use in discovering the server%0A%09 *            configuration.%0A%09 * %0A%09 * @throws IOException%0A%09 *             If the bootstrap fails.%0A%09 */%0A%09public void bootstrap(final MongoDbConfiguration config) throws IOException %7B%0A%09%09// TODO - IMPLEMENT BOOTSTRAP.%0A%09%7D%0A%0A%09/**%0A%09 * %7B@inheritDoc%7D%0A%09 * %3Cp%3E%0A%09 * Delegates the connection to the setup delegate.%0A%09 * %3C/p%3E%0A%09 */%0A%09@Override%0A%09public Connection connect(final InetSocketAddress address,%0A%09%09%09final MongoDbConfiguration config) throws IOException %7B%0A%09%09return myDelegate.connect(address, config);%0A%09%7D%0A%7D%0A

Add BootstrapConnectionFactory.