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:
- org.objectweb.fractal.api.control.AttributeController, org.objectweb.fractal.api.control.BindingController, org.objectweb.perseus.persistence.api.ConnectionHolderFactory, JDBCMapperAttributes, org.objectweb.fractal.api.control.LifeCycleController, org.objectweb.jorm.util.api.Loggable, MapperAttributes, org.objectweb.jorm.api.PMapper, org.objectweb.jorm.mapper.rdb.lib.PMapperRdb, org.objectweb.jorm.api.PMappingCallback, org.objectweb.jorm.api.PMappingStructuresManager, org.objectweb.perseus.pool.api.PoolMatchFactory
- public class JDBCMapper
- extends org.objectweb.jorm.mapper.rdb.lib.MapperJDBC
- implements org.objectweb.fractal.api.control.BindingController, org.objectweb.fractal.api.control.LifeCycleController, JDBCMapperAttributes, org.objectweb.perseus.pool.api.PoolMatchFactory, org.objectweb.perseus.persistence.api.ConnectionHolderFactory
A JDBC mapper component able to pool the JDBC connection in non managed
environnement.
- Author:
- S.Chassande-Barrioz
Field Summary |
protected org.objectweb.perseus.pool.api.Pool |
connectionPool
The pool of JDBC connection. |
static java.lang.String |
POOL_BINDING
|
Fields inherited from class org.objectweb.jorm.lib.Mapper |
logger, loggerFactory |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
STARTED, STOPPED |
Fields inherited from interface org.objectweb.jorm.api.PMapper |
JORMPROPFILE, PBINDINGAPPENDER, PCLASSMAPPINGAPPENDER |
Methods inherited from class org.objectweb.jorm.mapper.rdb.lib.MapperJDBC |
getConnection, getConnectionFactory, getRdbAdapter, setConnectionFactory, start |
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 |
Methods inherited from interface org.objectweb.jorm.api.PMappingStructuresManager |
addDependency, classDefined, declareClass, getPMapCluster, getPMapClusters, setLogger, setPMapper |
POOL_BINDING
public static final java.lang.String POOL_BINDING
- See Also:
- Constant Field Values
connectionPool
protected org.objectweb.perseus.pool.api.Pool connectionPool
- The pool of JDBC connection.
JDBCMapper
public JDBCMapper()
throws org.objectweb.jorm.api.PException
createConnectionHolder
public org.objectweb.perseus.persistence.api.ConnectionHolder createConnectionHolder()
throws org.objectweb.perseus.persistence.api.PersistenceException
- Specified by:
createConnectionHolder
in interface org.objectweb.perseus.persistence.api.ConnectionHolderFactory
- Throws:
org.objectweb.perseus.persistence.api.PersistenceException
createResource
public java.lang.Object createResource(java.lang.Object hints)
throws org.objectweb.perseus.pool.api.PoolException
- createResource creates a new PoolResource.
- Specified by:
createResource
in interface org.objectweb.perseus.pool.api.PoolMatchFactory
- Parameters:
hints
- The "properties" that the created PoolResource should
conform to.
- Returns:
- The created PoolResource.
- Throws:
org.objectweb.perseus.pool.api.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 org.objectweb.perseus.pool.api.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 org.objectweb.perseus.pool.api.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 org.objectweb.fractal.api.control.BindingController
lookupFc
public java.lang.Object lookupFc(java.lang.String s)
- Specified by:
lookupFc
in interface org.objectweb.fractal.api.control.BindingController
bindFc
public void bindFc(java.lang.String s,
java.lang.Object o)
- Specified by:
bindFc
in interface org.objectweb.fractal.api.control.BindingController
unbindFc
public void unbindFc(java.lang.String s)
- Specified by:
unbindFc
in interface org.objectweb.fractal.api.control.BindingController
getFcState
public java.lang.String getFcState()
- Specified by:
getFcState
in interface org.objectweb.fractal.api.control.LifeCycleController
startFc
public void startFc()
- Specified by:
startFc
in interface org.objectweb.fractal.api.control.LifeCycleController
stopFc
public void stopFc()
- Specified by:
stopFc
in interface org.objectweb.fractal.api.control.LifeCycleController
getConnection
public java.lang.Object getConnection()
throws org.objectweb.jorm.api.PException
- The pool is used to fetch a connection.
- Specified by:
getConnection
in interface org.objectweb.jorm.api.PMapper
- Throws:
org.objectweb.jorm.api.PException
getConnection
public java.lang.Object getConnection(java.lang.Object connectionContext,
java.lang.Object user)
throws org.objectweb.jorm.api.PException
- Specified by:
getConnection
in interface org.objectweb.jorm.api.PMapper
- Throws:
org.objectweb.jorm.api.PException
closeConnection
public void closeConnection(java.lang.Object conn)
throws org.objectweb.jorm.api.PException
- The connection is release into the pool
- Specified by:
closeConnection
in interface org.objectweb.jorm.api.PMapper
- Parameters:
conn
-
- Throws:
org.objectweb.jorm.api.PException
getCheckConnectivityAtStartup
public boolean getCheckConnectivityAtStartup()
- Specified by:
getCheckConnectivityAtStartup
in interface MapperAttributes
setCheckConnectivityAtStartup
public void setCheckConnectivityAtStartup(boolean b)
- Specified by:
setCheckConnectivityAtStartup
in interface MapperAttributes