MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mysql.clusterj.core.SessionFactoryImpl Class Reference
Inheritance diagram for com.mysql.clusterj.core.SessionFactoryImpl:
Collaboration diagram for com.mysql.clusterj.core.SessionFactoryImpl:

Public Member Functions

Session getSession ()
Session getSession (Map properties)
Table getTable (String tableName, Dictionary dictionary)
synchronized void close ()
void setDomainTypeHandlerFactory (DomainTypeHandlerFactory domainTypeHandlerFactory)
DomainTypeHandlerFactory getDomainTypeHandlerFactory ()
List< Integer > getConnectionPoolSessionCounts ()

Static Public Member Functions

static SessionFactoryImpl getSessionFactory (Map<?,?> props)
static< T > DomainTypeHandler< T > getDomainTypeHandler (Class< T > cls)

Protected Member Functions

ClusterConnectionService getClusterConnectionService ()
 SessionFactoryImpl (Map<?,?> props)
void createClusterConnectionPool ()
ClusterConnection createClusterConnection (ClusterConnectionService service, Map<?,?> props, int nodeId)

Static Protected Member Functions

static< T > Class< T > getClassForProxy (T object)
static String getStringProperty (Map<?,?> props, String propertyName)
static String getStringProperty (Map<?,?> props, String propertyName, String defaultValue)
static String getRequiredStringProperty (Map<?,?> props, String propertyName)
static int getIntProperty (Map<?,?> props, String propertyName, int defaultValue)

Protected Attributes

Map<?,?> props

Static Protected Attributes

static final Map< Class
<?>, DomainTypeHandler<?> > 
typeToHandlerMap
static final Map< String,
SessionFactoryImpl
sessionFactoryMap

Additional Inherited Members

- Static Public Attributes inherited from com.mysql.clusterj.Constants
static final String PROPERTY_CLUSTER_CONNECTION_SERVICE = "com.mysql.clusterj.connection.service"
static final String PROPERTY_CLUSTER_CONNECTSTRING = "com.mysql.clusterj.connectstring"
static final String PROPERTY_CLUSTER_CONNECT_RETRIES = "com.mysql.clusterj.connect.retries"
static final int DEFAULT_PROPERTY_CLUSTER_CONNECT_RETRIES = 4
static final String PROPERTY_CONNECTION_POOL_SIZE = "com.mysql.clusterj.connection.pool.size"
static final int DEFAULT_PROPERTY_CONNECTION_POOL_SIZE = 1
static final String PROPERTY_CONNECTION_POOL_NODEIDS = "com.mysql.clusterj.connection.pool.nodeids"
static final String PROPERTY_CLUSTER_CONNECT_DELAY = "com.mysql.clusterj.connect.delay"
static final int DEFAULT_PROPERTY_CLUSTER_CONNECT_DELAY = 5
static final String PROPERTY_CLUSTER_CONNECT_VERBOSE = "com.mysql.clusterj.connect.verbose"
static final int DEFAULT_PROPERTY_CLUSTER_CONNECT_VERBOSE = 0
static final String PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFORE = "com.mysql.clusterj.connect.timeout.before"
static final int DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_BEFORE = 30
static final String PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTER = "com.mysql.clusterj.connect.timeout.after"
static final int DEFAULT_PROPERTY_CLUSTER_CONNECT_TIMEOUT_AFTER = 20
static final String PROPERTY_CLUSTER_DATABASE = "com.mysql.clusterj.database"
static final String DEFAULT_PROPERTY_CLUSTER_DATABASE = "test"
static final String PROPERTY_CLUSTER_MAX_TRANSACTIONS = "com.mysql.clusterj.max.transactions"
static final int DEFAULT_PROPERTY_CLUSTER_MAX_TRANSACTIONS = 4
static final String PROPERTY_DEFER_CHANGES = "com.mysql.clusterj.defer.changes"
static final String SESSION_FACTORY_SERVICE_CLASS_NAME = "com.mysql.clusterj.SessionFactoryService"
static final String SESSION_FACTORY_SERVICE_FILE_NAME = "META-INF/services/" + SESSION_FACTORY_SERVICE_CLASS_NAME
static final String PROPERTY_JDBC_DRIVER_NAME = "com.mysql.clusterj.jdbc.driver"
static final String PROPERTY_JDBC_URL = "com.mysql.clusterj.jdbc.url"
static final String PROPERTY_JDBC_USERNAME = "com.mysql.clusterj.jdbc.username"
static final String PROPERTY_JDBC_PASSWORD = "com.mysql.clusterj.jdbc.password"

Detailed Description

Definition at line 49 of file SessionFactoryImpl.java.

Constructor & Destructor Documentation

com.mysql.clusterj.core.SessionFactoryImpl.SessionFactoryImpl ( Map<?,?>  props)
inlineprotected

Create a new SessionFactoryImpl from the properties in the Map, and connect to the ndb cluster.

Parameters
propsthe properties for the factory

Definition at line 152 of file SessionFactoryImpl.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

synchronized void com.mysql.clusterj.core.SessionFactoryImpl.close ( )
inline

Close this session factory. Release all resources.

Implements com.mysql.clusterj.SessionFactory.

Definition at line 464 of file SessionFactoryImpl.java.

Here is the caller graph for this function:

ClusterConnectionService com.mysql.clusterj.core.SessionFactoryImpl.getClusterConnectionService ( )
inlineprotected

Get a cluster connection service.

Returns
the cluster connection service

Definition at line 106 of file SessionFactoryImpl.java.

Here is the call graph for this function:

static <T> DomainTypeHandler<T> com.mysql.clusterj.core.SessionFactoryImpl.getDomainTypeHandler ( Class< T >  cls)
inlinestatic

Get the DomainTypeHandler for a class. If the handler is not already available, null is returned.

Parameters
clsthe Class for which to get domain type handler
Returns
the DomainTypeHandler or null if not available

Definition at line 316 of file SessionFactoryImpl.java.

Here is the caller graph for this function:

static int com.mysql.clusterj.core.SessionFactoryImpl.getIntProperty ( Map<?,?>  props,
String  propertyName,
int  defaultValue 
)
inlinestaticprotected

Get the property from the properties map as an int. If the user has not provided a value in the props, use the supplied default value.

Parameters
propsthe properties
propertyNamethe name of the property
defaultValuethe value to return if there is no property by that name
Returns
the value from the properties or the default value

Definition at line 444 of file SessionFactoryImpl.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static String com.mysql.clusterj.core.SessionFactoryImpl.getRequiredStringProperty ( Map<?,?>  props,
String  propertyName 
)
inlinestaticprotected

Get the property from the properties map as a String. If the user has not provided a value in the props, throw an exception.

Parameters
propsthe properties
propertyNamethe name of the property
Returns
the value from the properties (may not be null)

Definition at line 428 of file SessionFactoryImpl.java.

Here is the call graph for this function:

Here is the caller graph for this function:

Session com.mysql.clusterj.core.SessionFactoryImpl.getSession ( )
inline

Get a session to use with the cluster.

Returns
the session

Implements com.mysql.clusterj.SessionFactory.

Definition at line 258 of file SessionFactoryImpl.java.

Here is the caller graph for this function:

Session com.mysql.clusterj.core.SessionFactoryImpl.getSession ( Map  properties)
inline

Get a session to use with the cluster, overriding some properties. Properties PROPERTY_CLUSTER_CONNECTSTRING, PROPERTY_CLUSTER_DATABASE, and PROPERTY_CLUSTER_MAX_TRANSACTIONS may not be overridden.

Parameters
propertiesoverriding some properties for this session
Returns
the session

Implements com.mysql.clusterj.SessionFactory.

Definition at line 268 of file SessionFactoryImpl.java.

Here is the call graph for this function:

static SessionFactoryImpl com.mysql.clusterj.core.SessionFactoryImpl.getSessionFactory ( Map<?,?>  props)
inlinestatic

Get a session factory. If using connection pooling and there is already a session factory with the same connect string and database, return it, regardless of whether other properties of the factory are the same as specified in the Map. If not using connection pooling (maximum sessions per connection == 0), create a new session factory.

Parameters
propsproperties of the session factory
Returns
the session factory

Definition at line 118 of file SessionFactoryImpl.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static String com.mysql.clusterj.core.SessionFactoryImpl.getStringProperty ( Map<?,?>  props,
String  propertyName 
)
inlinestaticprotected

Get the property from the properties map as a String.

Parameters
propsthe properties
propertyNamethe name of the property
Returns
the value from the properties (may be null)

Definition at line 403 of file SessionFactoryImpl.java.

Here is the caller graph for this function:

static String com.mysql.clusterj.core.SessionFactoryImpl.getStringProperty ( Map<?,?>  props,
String  propertyName,
String  defaultValue 
)
inlinestaticprotected

Get the property from the properties map as a String. If the user has not provided a value in the props, use the supplied default value.

Parameters
propsthe properties
propertyNamethe name of the property
defaultValuethe value to return if there is no property by that name
Returns
the value from the properties or the default value

Definition at line 414 of file SessionFactoryImpl.java.

Member Data Documentation

Map<?, ?> com.mysql.clusterj.core.SessionFactoryImpl.props
protected

The properties

Definition at line 58 of file SessionFactoryImpl.java.

final Map<String, SessionFactoryImpl> com.mysql.clusterj.core.SessionFactoryImpl.sessionFactoryMap
staticprotected
Initial value:

The tables. The session factories.

Definition at line 94 of file SessionFactoryImpl.java.

final Map<Class<?>, DomainTypeHandler<?> > com.mysql.clusterj.core.SessionFactoryImpl.typeToHandlerMap
staticprotected
Initial value:
new HashMap<Class<?>, DomainTypeHandler<?>>()

Map of Domain Class to DomainTypeHandler.

Definition at line 83 of file SessionFactoryImpl.java.


The documentation for this class was generated from the following file: