org.hibernate.connection
Class SimpleConnectionProvider

java.lang.Object
  extended by org.hibernate.connection.SimpleConnectionProvider
All Implemented Interfaces:
org.hibernate.connection.ConnectionProvider

public class SimpleConnectionProvider
extends Object
implements org.hibernate.connection.ConnectionProvider

This is the Hibernate class org.hibernate.connection.connection.DriverManagerConnectionProvider, tweaked in order to work with Mule's hot deployment. A very simple connection provider which does not use java.sql.DriverManager. This provider also implements a very rudimentary connection pool.

Author:
Gavin King
See Also:
ConnectionProvider

Constructor Summary
SimpleConnectionProvider()
           
 
Method Summary
 void close()
           
 void closeConnection(Connection conn)
           
 void configure(Properties props)
           
protected  void finalize()
           
static boolean getBoolean(String name, Map values)
          Get the config value as a boolean (default of false)
static boolean getBoolean(String name, Map values, boolean defaultValue)
          Get the config value as a boolean.
 Connection getConnection()
           
static int getInt(String name, Map values, int defaultValue)
          Get the config value as an int
static Integer getInteger(String name, Map values)
          Get the config value as an Integer
static Properties maskOut(Properties props, String key)
          replace a property by a starred version
 boolean supportsAggressiveRelease()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleConnectionProvider

public SimpleConnectionProvider()
Method Detail

configure

public void configure(Properties props)
               throws org.hibernate.HibernateException
Specified by:
configure in interface org.hibernate.connection.ConnectionProvider
Throws:
org.hibernate.HibernateException

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface org.hibernate.connection.ConnectionProvider
Throws:
SQLException

closeConnection

public void closeConnection(Connection conn)
                     throws SQLException
Specified by:
closeConnection in interface org.hibernate.connection.ConnectionProvider
Throws:
SQLException

finalize

protected void finalize()
Overrides:
finalize in class Object

close

public void close()
Specified by:
close in interface org.hibernate.connection.ConnectionProvider

supportsAggressiveRelease

public boolean supportsAggressiveRelease()
Specified by:
supportsAggressiveRelease in interface org.hibernate.connection.ConnectionProvider
See Also:
ConnectionProvider.supportsAggressiveRelease()

getBoolean

public static boolean getBoolean(String name,
                                 Map values)
Get the config value as a boolean (default of false)

Parameters:
name - The config setting name.
values - The map of config values
Returns:
The value.

getBoolean

public static boolean getBoolean(String name,
                                 Map values,
                                 boolean defaultValue)
Get the config value as a boolean.

Parameters:
name - The config setting name.
values - The map of config values
defaultValue - The default value to use if not found
Returns:
The value.

getInt

public static int getInt(String name,
                         Map values,
                         int defaultValue)
Get the config value as an int

Parameters:
name - The config setting name.
values - The map of config values
defaultValue - The default value to use if not found
Returns:
The value.

getInteger

public static Integer getInteger(String name,
                                 Map values)
Get the config value as an Integer

Parameters:
name - The config setting name.
values - The map of config values
Returns:
The value, or null if not found

maskOut

public static Properties maskOut(Properties props,
                                 String key)
replace a property by a starred version

Parameters:
props - properties to check
key - proeprty to mask
Returns:
cloned and masked properties


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.