public class CassandraProviderBean extends Object implements ApplicationEventPublisherAware, CassandraProvider, DisposableBean, InitializingBean, SmartInitializingSingleton
CassandraProperties. Initialization of the cluster provided by this
class is first tried in afterPropertiesSet(). If the initialization
fails, a background thread is created that retries the initialization process
every 30 seconds. The Cluster and the Session are closed when
this bean is destroyed (usually when the application context is closed).| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
log
Logger for this class.
|
| Constructor and Description |
|---|
CassandraProviderBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
afterSingletonsInstantiated() |
void |
destroy() |
Cluster |
getCluster()
Returns a reference to the Cassandra cluster.
|
ListenableFuture<Cluster> |
getClusterFuture()
Returns a future reference to the Cassandra cluster.
|
Session |
getSession()
Returns a reference to the Cassandra session.
|
ListenableFuture<Session> |
getSessionFuture()
Returns a future reference to the Cassandra session.
|
boolean |
isInitialized()
Tells whether this provider has been completely initialized.
|
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setCassandraProperties(CassandraProperties cassandraProperties) |
public Cluster getCluster()
CassandraProvidergetCluster in interface CassandraProviderCassandraProvider.getClusterFuture()public ListenableFuture<Cluster> getClusterFuture()
CassandraProvidergetClusterFuture in interface CassandraProviderCassandraProvider.getCluster().CassandraProvider.getCluster()public boolean isInitialized()
CassandraProvider
Tells whether this provider has been completely initialized. If
true, CassandraProvider.getCluster() and CassandraProvider.getSession() will
return a result and not throw an exception.
Please note that the provider might be destroyed after calling this
method. In this case, CassandraProvider.getCluster() and CassandraProvider.getSession()
might throw, even if this method returned true previously.
isInitialized in interface CassandraProvidertrue if this provider is ready for operation,
false otherwise.public Session getSession()
CassandraProvidergetSession in interface CassandraProviderCassandraProvider.getSessionFuture()public ListenableFuture<Session> getSessionFuture()
CassandraProvidergetSessionFuture in interface CassandraProviderCassandraProvider.getSession().CassandraProvider.getSession()@Autowired public void setCassandraProperties(CassandraProperties cassandraProperties)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface ApplicationEventPublisherAwarepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic void afterSingletonsInstantiated()
afterSingletonsInstantiated in interface SmartInitializingSingletonpublic void destroy()
throws Exception
destroy in interface DisposableBeanExceptionCopyright © 2011–2017 aquenos GmbH. All rights reserved.