Package com.marklogic.client.ext.spring
Class DatabaseClientManager
- java.lang.Object
-
- com.marklogic.client.ext.helper.LoggingObject
-
- com.marklogic.client.ext.spring.DatabaseClientManager
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.FactoryBean<com.marklogic.client.DatabaseClient>
public class DatabaseClientManager extends LoggingObject implements org.springframework.beans.factory.FactoryBean<com.marklogic.client.DatabaseClient>, org.springframework.beans.factory.DisposableBean
Hooks into Spring container lifecycle so that the DatabaseClient is initialized when the container starts up and released when the container shuts down.Note that ML7 has a DatabaseClientFactory.Bean that removes the need for most of this code, although it does not have a "destroy" method that would handle releasing the DatabaseClient that it begins.
-
-
Field Summary
-
Fields inherited from class com.marklogic.client.ext.helper.LoggingObject
logger
-
-
Constructor Summary
Constructors Constructor Description DatabaseClientManager()DatabaseClientManager(DatabaseClientConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()com.marklogic.client.DatabaseClientgetObject()java.lang.Class<?>getObjectType()booleanisSingleton()voidsetConfig(DatabaseClientConfig config)-
Methods inherited from class com.marklogic.client.ext.helper.LoggingObject
format
-
-
-
-
Constructor Detail
-
DatabaseClientManager
public DatabaseClientManager()
-
DatabaseClientManager
public DatabaseClientManager(DatabaseClientConfig config)
-
-
Method Detail
-
getObject
public com.marklogic.client.DatabaseClient getObject()
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean<com.marklogic.client.DatabaseClient>
-
getObjectType
public java.lang.Class<?> getObjectType()
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<com.marklogic.client.DatabaseClient>
-
isSingleton
public boolean isSingleton()
- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean<com.marklogic.client.DatabaseClient>
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
setConfig
public void setConfig(DatabaseClientConfig config)
-
-