@Configuration public abstract class AbstractCassandraConfiguration extends AbstractClusterConfiguration implements BeanClassLoaderAware
Modifier and Type | Field and Description |
---|---|
protected ClassLoader |
beanClassLoader |
Constructor and Description |
---|
AbstractCassandraConfiguration() |
Modifier and Type | Method and Description |
---|---|
CassandraConverter |
cassandraConverter()
Creates a
CassandraConverter using the configured cassandraMapping() . |
CassandraMappingContext |
cassandraMapping()
Return the
MappingContext instance to map Entities to properties. |
CassandraAdminOperations |
cassandraTemplate()
Creates a
CassandraAdminTemplate . |
CustomConversions |
customConversions()
Register custom
Converter s in a CustomConversions object if required. |
String[] |
getEntityBasePackages()
Base packages to scan for entities annotated with
Table annotations. |
protected abstract String |
getKeyspaceName()
Return the name of the keyspace to connect to.
|
SchemaAction |
getSchemaAction()
The
SchemaAction to perform at startup. |
CassandraSessionFactoryBean |
session()
Creates a
CassandraSessionFactoryBean that provides a Cassandra Session . |
void |
setBeanClassLoader(ClassLoader classLoader) |
cluster, getAddressTranslator, getAuthProvider, getClusterBuilderConfigurer, getClusterName, getCompressionType, getContactPoints, getKeyspaceCreations, getKeyspaceDrops, getLoadBalancingPolicy, getMaxSchemaAgreementWaitSeconds, getMetricsEnabled, getNettyOptions, getPoolingOptions, getPort, getProtocolVersion, getQueryOptions, getReconnectionPolicy, getRetryPolicy, getShutdownScripts, getSocketOptions, getSpeculativeExecutionPolicy, getStartupScripts, getTimestampGenerator
protected ClassLoader beanClassLoader
@Bean public CassandraSessionFactoryBean session() throws ClassNotFoundException
CassandraSessionFactoryBean
that provides a Cassandra Session
.
The lifecycle of CassandraSessionFactoryBean
initializes the schema
in the
configured keyspace
.CassandraSessionFactoryBean
.ClassNotFoundException
- if an error occurs initializing the initial entity set, see
cassandraMapping()
AbstractClusterConfiguration.cluster()
,
cassandraConverter()
,
getKeyspaceName()
,
getSchemaAction()
,
AbstractClusterConfiguration.getStartupScripts()
,
AbstractClusterConfiguration.getShutdownScripts()
@Bean public CassandraConverter cassandraConverter() throws ClassNotFoundException
CassandraConverter
using the configured cassandraMapping()
. Will apply all specified
customConversions()
.CassandraConverter
used to convert Java and Cassandra value types during the mapping process.ClassNotFoundException
- if an error occurs initializing the initial entity set, see
cassandraMapping()
cassandraMapping()
,
customConversions()
@Bean public CustomConversions customConversions()
Converter
s in a CustomConversions
object if required. These
CustomConversions
will be registered with the cassandraConverter()
and cassandraMapping()
. Returns an empty CustomConversions
instance by default.@Bean public CassandraMappingContext cassandraMapping() throws ClassNotFoundException
MappingContext
instance to map Entities to properties.ClassNotFoundException
- if the Cassandra Entity class type identified by name cannot be found during the
scan.CassandraMappingContext
@Bean public CassandraAdminOperations cassandraTemplate() throws Exception
CassandraAdminTemplate
.Exception
- if the Session
could not be obtained.public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public String[] getEntityBasePackages()
Table
annotations. By default, returns the package name
of this (this.getClass().getPackage().getName()
. This method must never return null.protected abstract String getKeyspaceName()
public SchemaAction getSchemaAction()
SchemaAction
to perform at startup. Defaults to SchemaAction.NONE
.Copyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.