// Path: src/main/java/com/lowereast/guiceymongo/guice/GuiceyMongoUtil.java
// public final class GuiceyMongoUtil {
// 	@Inject
// 	static Injector _injector;
// 	
// 	private GuiceyMongoUtil() {}
// 	
// 	public static String getCurrentConfiguration() {
// 		return _injector.getInstance(Key.get(String.class, Configuration.class));
// 	}
// 	
// 	public static void setCurrentConfiguration(Binder binder, String configuration) {
// 		binder.skipSources(GuiceyMongoUtil.class).bindConstant().annotatedWith(Configuration.class).to(configuration);
// 	}
// 	
// 	public static DB getDatabase(String databaseKey) {
// 		return _injector.getInstance(Key.get(DB.class, GuiceyMongoDatabases.database(databaseKey)));
// 	}
// 	
// 	public static DBCollection getCollection(String collectionKey) {
// 		return _injector.getInstance(Key.get(DBCollection.class, GuiceyMongoCollections.collection(collectionKey)));
// 	}
// 	
// 	public static <T extends IsData> GuiceyCollection<T> getGuiceyCollection(String collectionKey, Class<T> dataClass) {
// 		return (GuiceyCollection<T>)_injector.getInstance(Key.get(Types.newParameterizedType(GuiceyCollection.class, dataClass), GuiceyMongoCollections.collection(collectionKey)));
// 	}
// 	
// 	public static GuiceyBucket getGuiceyBucket(String bucketKey) {
// 		return _injector.getInstance(Key.get(GuiceyBucket.class, GuiceyMongoBuckets.bucket(bucketKey)));
// 	}
// }


import java.util.Map;
import com.google.inject.Binder;
import com.google.inject.Key;
import com.google.inject.Module;
import com.lowereast.guiceymongo.guice.GuiceyMongoUtil;
/**
 *      Copyright (C) 2010 Lowereast Software
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.lowereast.guiceymongo.guice.spi;



public class GuiceyMongoBinder {
	private final Binder _binder;
	
	public GuiceyMongoBinder(Binder binder) {
		_binder = binder.skipSources(GuiceyMongoBinder.class);
// Path: src/main/java/com/lowereast/guiceymongo/guice/GuiceyMongoUtil.java
// public final class GuiceyMongoUtil {
// 	@Inject
// 	static Injector _injector;
// 	
// 	private GuiceyMongoUtil() {}
// 	
// 	public static String getCurrentConfiguration() {
// 		return _injector.getInstance(Key.get(String.class, Configuration.class));
// 	}
// 	
// 	public static void setCurrentConfiguration(Binder binder, String configuration) {
// 		binder.skipSources(GuiceyMongoUtil.class).bindConstant().annotatedWith(Configuration.class).to(configuration);
// 	}
// 	
// 	public static DB getDatabase(String databaseKey) {
// 		return _injector.getInstance(Key.get(DB.class, GuiceyMongoDatabases.database(databaseKey)));
// 	}
// 	
// 	public static DBCollection getCollection(String collectionKey) {
// 		return _injector.getInstance(Key.get(DBCollection.class, GuiceyMongoCollections.collection(collectionKey)));
// 	}
// 	
// 	public static <T extends IsData> GuiceyCollection<T> getGuiceyCollection(String collectionKey, Class<T> dataClass) {
// 		return (GuiceyCollection<T>)_injector.getInstance(Key.get(Types.newParameterizedType(GuiceyCollection.class, dataClass), GuiceyMongoCollections.collection(collectionKey)));
// 	}
// 	
// 	public static GuiceyBucket getGuiceyBucket(String bucketKey) {
// 		return _injector.getInstance(Key.get(GuiceyBucket.class, GuiceyMongoBuckets.bucket(bucketKey)));
// 	}
// }


// Path: src/main/java/com/lowereast/guiceymongo/guice/spi/GuiceyMongoBinder.java
import java.util.Map;
import com.google.inject.Binder;
import com.google.inject.Key;
import com.google.inject.Module;
import com.lowereast.guiceymongo.guice.GuiceyMongoUtil;

/**
 *      Copyright (C) 2010 Lowereast Software
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.lowereast.guiceymongo.guice.spi;



public class GuiceyMongoBinder {
	private final Binder _binder;
	
	public GuiceyMongoBinder(Binder binder) {
		_binder = binder.skipSources(GuiceyMongoBinder.class);
		_binder.install(new SingletonModule<Class<GuiceyMongoUtil>>(GuiceyMongoUtil.class) {