Class SessionFactoryInitializer
java.lang.Object
org.springframework.data.cassandra.core.cql.session.init.SessionFactoryInitializer
- All Implemented Interfaces:
DisposableBean
,InitializingBean
- Since:
- 3.0
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Use the keyspace populator to set up the keyspace.void
destroy()
Use the keyspace cleaner to clean up the keyspace.void
setEnabled
(boolean enabled) Flag to explicitly enable or disable the keyspace populator and keyspace cleaner.void
setKeyspaceCleaner
(KeyspacePopulator keyspaceCleaner) Set theKeyspacePopulator
to execute during the bean destruction phase, cleaning up the keyspace and leaving it in a known state for others.void
setKeyspacePopulator
(KeyspacePopulator keyspacePopulator) Set theKeyspacePopulator
to execute during the bean initialization phase.void
setSessionFactory
(SessionFactory sessionFactory) TheSessionFactory
for the keyspace to populate when this component is initialized and to clean up when this component is shut down.
-
Constructor Details
-
SessionFactoryInitializer
public SessionFactoryInitializer()
-
-
Method Details
-
setSessionFactory
TheSessionFactory
for the keyspace to populate when this component is initialized and to clean up when this component is shut down.This property is mandatory with no default provided.
- Parameters:
sessionFactory
- the SessionFactory.
-
setKeyspacePopulator
Set theKeyspacePopulator
to execute during the bean initialization phase.- Parameters:
keyspacePopulator
- theKeyspacePopulator
to use during initialization.- See Also:
-
setKeyspaceCleaner
Set theKeyspacePopulator
to execute during the bean destruction phase, cleaning up the keyspace and leaving it in a known state for others.- Parameters:
keyspaceCleaner
- theKeyspacePopulator
to use during destruction.- See Also:
-
setEnabled
public void setEnabled(boolean enabled) Flag to explicitly enable or disable the keyspace populator and keyspace cleaner.- Parameters:
enabled
- true if the keyspace populator and keyspace cleaner should be called on startup and shutdown, respectively.
-
afterPropertiesSet
public void afterPropertiesSet()Use the keyspace populator to set up the keyspace.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
destroy
public void destroy()Use the keyspace cleaner to clean up the keyspace.- Specified by:
destroy
in interfaceDisposableBean
-