Package org.craftercms.commons.mongo
Class MongoClientFromUriFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClient>
org.craftercms.commons.mongo.MongoClientFromUriFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<com.mongodb.MongoClient>,org.springframework.beans.factory.InitializingBean
public class MongoClientFromUriFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClient>
FactoryBean that besides creating a MongoClient from a Mongo URI,
closes the client when it's destroyed.- Author:
- avasquez
- See Also:
-
Field Summary
FieldsFields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.MongoClientprotected voiddestroyInstance(com.mongodb.MongoClient mongoClient) Class<?> Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Field Details
-
uri
-
-
Constructor Details
-
MongoClientFromUriFactoryBean
-
-
Method Details
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<com.mongodb.MongoClient>- Specified by:
getObjectTypein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClient>
-
createInstance
- Specified by:
createInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClient>- Throws:
Exception
-
destroyInstance
- Overrides:
destroyInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClient>- Throws:
Exception
-