org.apache.turbine.services.db
Class TurbineMapBrokerService
java.lang.Object
|
+--org.apache.turbine.services.BaseInitable
|
+--org.apache.turbine.services.BaseService
|
+--org.apache.turbine.services.db.TurbineMapBrokerService
- All Implemented Interfaces:
- Initable, MapBrokerService, Service
- public class TurbineMapBrokerService
- extends BaseService
- implements MapBrokerService
Turbine's default implmentation of MapBrokerService
.
- Version:
- $Id$
- Author:
- Frank Y. Kim, Brett McLaughlin, Greg Ritter, Daniel Rall, Magnús Þór Torfason, Jason van Zyl, Rafal Krzewski
Field Summary |
private java.util.Map |
dbMaps
The global cache of database maps |
Method Summary |
DatabaseMap |
getDatabaseMap()
Returns the default database map information. |
DatabaseMap |
getDatabaseMap(java.lang.String name)
Returns the database map information. |
private static java.lang.String |
getDatabaseProperty(java.lang.String db,
java.lang.String prop)
Returns the specified property of the given database, or the empty
string if no value is set for the property. |
void |
init()
Initializes the service. |
private void |
setupIdTable(DatabaseMap map)
Setup IDBroker's table information within given database map. |
void |
shutdown()
Shuts down the service. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
dbMaps
private java.util.Map dbMaps
- The global cache of database maps
TurbineMapBrokerService
public TurbineMapBrokerService()
init
public void init()
- Initializes the service.
- Specified by:
init
in interface Initable
- Overrides:
init
in class BaseInitable
- Following copied from interface:
org.apache.turbine.services.Initable
- Throws:
InitializationException,
- if initialization of this
class was not successful.
shutdown
public void shutdown()
- Shuts down the service.
This method halts the IDBroker's daemon thread in all of
the DatabaseMap's.
- Specified by:
shutdown
in interface Initable
- Overrides:
shutdown
in class BaseInitable
getDatabaseMap
public DatabaseMap getDatabaseMap()
throws TurbineException
- Returns the default database map information.
- Specified by:
getDatabaseMap
in interface MapBrokerService
- Returns:
- A DatabaseMap.
- Throws:
TurbineException
- Any exceptions caught during procssing will be
rethrown wrapped into a TurbineException.
getDatabaseMap
public DatabaseMap getDatabaseMap(java.lang.String name)
throws TurbineException
- Returns the database map information. Name relates to the name
of the connection pool to associate with the map.
- Specified by:
getDatabaseMap
in interface MapBrokerService
- Parameters:
name
- The name of the DatabaseMap
to
retrieve.- Returns:
- The named
DatabaseMap
. - Throws:
TurbineException
- Any exceptions caught during procssing will be
rethrown wrapped into a TurbineException.
getDatabaseProperty
private static final java.lang.String getDatabaseProperty(java.lang.String db,
java.lang.String prop)
- Returns the specified property of the given database, or the empty
string if no value is set for the property.
- Parameters:
db
- The name of the database whose property to get.prop
- The name of the property to get.- Returns:
- The property's value.
setupIdTable
private void setupIdTable(DatabaseMap map)
- Setup IDBroker's table information within given database map.
This method should be called on all new database map to ensure that
IDBroker functionality is available in all databases userd by the
application.
- Parameters:
map
- the DataBaseMap to setup.
Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.