Class ObservableCqlSessionFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
org.springframework.data.cassandra.observability.ObservableCqlSessionFactoryBean
- 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.datastax.oss.driver.api.core.CqlSession>
,org.springframework.beans.factory.InitializingBean
public class ObservableCqlSessionFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
Factory bean to construct a
CqlSession
integrated with given ObservationRegistry
. This factory bean
registers also ObservationRequestTracker.INSTANCE
with the builder to
ensure full integration with the required infrastructure.- Since:
- 4.0
- Author:
- Mark Paluch
- See Also:
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
ConstructorDescriptionObservableCqlSessionFactoryBean
(com.datastax.oss.driver.api.core.CqlSessionBuilder cqlSessionBuilder, io.micrometer.observation.ObservationRegistry observationRegistry) Construct a newObservableCqlSessionFactoryBean
. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.datastax.oss.driver.api.core.CqlSession
protected void
destroyInstance
(com.datastax.oss.driver.api.core.CqlSession instance) Class<?>
void
setRemoteServiceName
(String remoteServiceName) Set the remote service name.Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
ObservableCqlSessionFactoryBean
public ObservableCqlSessionFactoryBean(com.datastax.oss.driver.api.core.CqlSessionBuilder cqlSessionBuilder, io.micrometer.observation.ObservationRegistry observationRegistry) Construct a newObservableCqlSessionFactoryBean
.- Parameters:
cqlSessionBuilder
- must not be null.observationRegistry
- must not be null.
-
-
Method Details
-
createInstance
protected com.datastax.oss.driver.api.core.CqlSession createInstance()- Specified by:
createInstance
in classorg.springframework.beans.factory.config.AbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-
destroyInstance
protected void destroyInstance(@Nullable com.datastax.oss.driver.api.core.CqlSession instance) - Overrides:
destroyInstance
in classorg.springframework.beans.factory.config.AbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<com.datastax.oss.driver.api.core.CqlSession>
- Specified by:
getObjectType
in classorg.springframework.beans.factory.config.AbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-
getRemoteServiceName
-
setRemoteServiceName
Set the remote service name.- Parameters:
remoteServiceName
-
-