org.objectweb.speedo.mapper.rdb
Class JDBCMapper
java.lang.Object
org.objectweb.jorm.lib.Mapper
org.objectweb.jorm.mapper.rdb.lib.MapperJDBC
org.objectweb.speedo.mapper.rdb.JDBCMapper
- All Implemented Interfaces:
- AttributeController, BindingController, ConnectionHolderFactory, JDBCMapperAttributes, LifeCycleController, Loggable, MapperAttributes, PMapper, PMapperRdb, PMappingCallback, PMappingStructuresManager, PoolMatchFactory
- public class JDBCMapper
- extends MapperJDBC
- implements BindingController, LifeCycleController, JDBCMapperAttributes, PoolMatchFactory, ConnectionHolderFactory
A JDBC mapper component able to pool the JDBC connection in non managed
environnement.
- Author:
- S.Chassande-Barrioz
Methods inherited from class org.objectweb.jorm.lib.Mapper |
addDependency, addMapperEventListener, classDefined, cn2mn, createGenClassMapping, declareClass, equals, getJormConfigurator, getLogger, getLoggerFactory, getMappedClasses, getMapperName, getMetaInfoManager, getPMapCluster, getPMapClusters, getPMappingStructuresManager, getPrefetchCache, getPTypeSpace, hashCode, lookup, map, map, map, removeMapperEventListener, scheduleEvent, setJormConfigurator, setLogger, setLoggerFactory, setMapperName, setPMapper, setPrefetchCache, stop, unmap |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jorm.api.PMapper |
addMapperEventListener, cn2mn, createGenClassMapping, getMappedClasses, getMapperName, getMetaInfoManager, getPMappingStructuresManager, getPrefetchCache, getPTypeSpace, lookup, map, map, map, removeMapperEventListener, setMapperName, setPrefetchCache, stop, unmap |
POOL_BINDING
public static final java.lang.String POOL_BINDING
- See Also:
- Constant Field Values
connectionPool
protected Pool connectionPool
- The pool of JDBC connection.
JDBCMapper
public JDBCMapper()
throws PException
createConnectionHolder
public ConnectionHolder createConnectionHolder()
throws PersistenceException
- Specified by:
createConnectionHolder
in interface ConnectionHolderFactory
- Throws:
PersistenceException
createResource
public java.lang.Object createResource(java.lang.Object hints)
throws PoolException
- createResource creates a new PoolResource.
- Specified by:
createResource
in interface PoolMatchFactory
- Parameters:
hints
- The "properties" that the created PoolResource should
conform to.
- Returns:
- The created PoolResource.
- Throws:
PoolException
matchResource
public boolean matchResource(java.lang.Object pr,
java.lang.Object hints)
- matchResource tests if a given resource of a Pool matches with
the hints passed with the Pool getResource method.
- Specified by:
matchResource
in interface PoolMatchFactory
- Parameters:
pr
- The PoolResource to test its matching with some
"properties" specified by hints.hints
- The "properties" that the PoolResource specified by pr
should match.
- Returns:
- true if the pr PoolResource matches the hints
"properties".
destroyResource
public void destroyResource(java.lang.Object resource)
- Specified by:
destroyResource
in interface PoolMatchFactory
getDriverClassName
public java.lang.String getDriverClassName()
- Specified by:
getDriverClassName
in interface JDBCMapperAttributes
setDriverClassName
public void setDriverClassName(java.lang.String dcn)
- Specified by:
setDriverClassName
in interface JDBCMapperAttributes
getURL
public java.lang.String getURL()
- Specified by:
getURL
in interface JDBCMapperAttributes
setURL
public void setURL(java.lang.String url)
- Specified by:
setURL
in interface JDBCMapperAttributes
getUserName
public java.lang.String getUserName()
- Specified by:
getUserName
in interface JDBCMapperAttributes
setUserName
public void setUserName(java.lang.String userName)
- Specified by:
setUserName
in interface JDBCMapperAttributes
getPassword
public java.lang.String getPassword()
- Specified by:
getPassword
in interface JDBCMapperAttributes
setPassword
public void setPassword(java.lang.String password)
- Specified by:
setPassword
in interface JDBCMapperAttributes
setPoolConnection
public void setPoolConnection(boolean pc)
- Specified by:
setPoolConnection
in interface JDBCMapperAttributes
getPoolConnection
public boolean getPoolConnection()
- Specified by:
getPoolConnection
in interface JDBCMapperAttributes
listFc
public java.lang.String[] listFc()
- Specified by:
listFc
in interface BindingController
lookupFc
public java.lang.Object lookupFc(java.lang.String s)
- Specified by:
lookupFc
in interface BindingController
bindFc
public void bindFc(java.lang.String s,
java.lang.Object o)
- Specified by:
bindFc
in interface BindingController
unbindFc
public void unbindFc(java.lang.String s)
- Specified by:
unbindFc
in interface BindingController
getFcState
public java.lang.String getFcState()
- Specified by:
getFcState
in interface LifeCycleController
startFc
public void startFc()
- Specified by:
startFc
in interface LifeCycleController
stopFc
public void stopFc()
- Specified by:
stopFc
in interface LifeCycleController
getConnection
public java.lang.Object getConnection()
throws PException
- The pool is used to fetch a connection.
- Specified by:
getConnection
in interface PMapper
- Throws:
PException
getConnection
public java.lang.Object getConnection(java.lang.Object connectionContext,
java.lang.Object user)
throws PException
- Specified by:
getConnection
in interface PMapper
- Throws:
PException
closeConnection
public void closeConnection(java.lang.Object conn)
throws PException
- The connection is release into the pool
- Specified by:
closeConnection
in interface PMapper
- Parameters:
conn
-
- Throws:
PException
getCheckConnectivityAtStartup
public boolean getCheckConnectivityAtStartup()
- Specified by:
getCheckConnectivityAtStartup
in interface MapperAttributes
setCheckConnectivityAtStartup
public void setCheckConnectivityAtStartup(boolean b)
- Specified by:
setCheckConnectivityAtStartup
in interface MapperAttributes