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:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<com.datastax.oss.driver.api.core.CqlSession>,InitializingBean
public class ObservableCqlSessionFactoryBean
extends 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
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
ConstructorsConstructorDescriptionObservableCqlSessionFactoryBean(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.CqlSessionprotected voiddestroyInstance(@Nullable com.datastax.oss.driver.api.core.CqlSession instance) Class<?>@Nullable StringvoidsetConvention(CassandraObservationConvention convention) Set the observation convention.voidsetRemoteServiceName(@Nullable 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
-
getRemoteServiceName
-
setRemoteServiceName
Set the remote service name.- Parameters:
remoteServiceName-
-
setConvention
Set the observation convention.- Parameters:
convention-- Since:
- 4.3.4
-
createInstance
protected com.datastax.oss.driver.api.core.CqlSession createInstance()- Specified by:
createInstancein classAbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-
destroyInstance
protected void destroyInstance(@Nullable com.datastax.oss.driver.api.core.CqlSession instance) - Overrides:
destroyInstancein classAbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<com.datastax.oss.driver.api.core.CqlSession>- Specified by:
getObjectTypein classAbstractFactoryBean<com.datastax.oss.driver.api.core.CqlSession>
-