public class PersistenceBrokerFactoryBaseImpl extends java.lang.Object implements PersistenceBrokerFactoryIF
PersistenceBrokerFactoryIF
interface. Each request (PersistenceBrokerFactoryIF.createPersistenceBroker(org.apache.ojb.broker.PBKey) or
PersistenceBrokerFactoryIF.defaultPersistenceBroker() call) creates a new
PersistenceBroker instance. No pooling of broker instances is used.PersistenceBrokerFactoryDefaultImpl| Constructor and Description |
|---|
PersistenceBrokerFactoryBaseImpl() |
| Modifier and Type | Method and Description |
|---|---|
int |
activePersistenceBroker()
Not implemented!
|
void |
configure(org.apache.ojb.broker.util.configuration.Configuration config)
configure an object using the Configuration pConfig
|
PersistenceBrokerInternal |
createPersistenceBroker(PBKey pbKey)
Always return a new created
PersistenceBroker instance |
PersistenceBrokerInternal |
createPersistenceBroker(java.lang.String jcdAlias,
java.lang.String user,
java.lang.String password)
Return a ready for action
PersistenceBroker instance. |
PersistenceBrokerInternal |
defaultPersistenceBroker()
Return a default broker instance, specified in configuration
or set using
PersistenceBrokerFactoryIF.setDefaultKey(org.apache.ojb.broker.PBKey). |
PBKey |
getDefaultKey()
Get the default
PBKey. |
void |
releaseAllInstances()
release all broker instances pooled by the factory.
|
void |
setDefaultKey(PBKey key)
Set the
PBKey used for convinience PersistenceBroker
lookup method PersistenceBrokerFactoryIF.defaultPersistenceBroker(). |
void |
shutdown()
Shutdown method for OJB, kills all running processes within OJB - after
shutdown OJB can no longer be used.
|
public void setDefaultKey(PBKey key)
PersistenceBrokerFactoryIFPBKey used for convinience PersistenceBroker
lookup method PersistenceBrokerFactoryIF.defaultPersistenceBroker().
PBKey once.
All further calls will cause an exception.
If a default JdbcConnectionDescriptor
was declared in configuration file, OJB will set the declared PBKey as default.
MetadataManager.setDefaultPBKey(org.apache.ojb.broker.PBKey).setDefaultKey in interface PersistenceBrokerFactoryIFPersistenceBrokerFactoryIF.setDefaultKey(org.apache.ojb.broker.PBKey)public PBKey getDefaultKey()
PersistenceBrokerFactoryIFPBKey.
This method is convenience for
MetadataManager.getDefaultPBKey().getDefaultKey in interface PersistenceBrokerFactoryIFPersistenceBrokerFactoryIF.getDefaultKey()public PersistenceBrokerInternal createPersistenceBroker(PBKey pbKey) throws PBFactoryException
PersistenceBroker instancecreatePersistenceBroker in interface PersistenceBrokerFactoryIFpbKey - PBFactoryExceptionpublic PersistenceBrokerInternal createPersistenceBroker(java.lang.String jcdAlias, java.lang.String user, java.lang.String password) throws PBFactoryException
PersistenceBrokerFactoryIFPersistenceBroker instance.createPersistenceBroker in interface PersistenceBrokerFactoryIFjcdAlias - An jcdAlias name specified in a jdbc-connection-descriptoruser - user name specified in a jdbc-connection-descriptorpassword - valid password specified in a jdbc-connection-descriptorPBFactoryExceptionPersistenceBrokerFactoryIF.createPersistenceBroker(
String jcdAlias, String user, String password)public PersistenceBrokerInternal defaultPersistenceBroker() throws PBFactoryException
PersistenceBrokerFactoryIFPersistenceBrokerFactoryIF.setDefaultKey(org.apache.ojb.broker.PBKey).defaultPersistenceBroker in interface PersistenceBrokerFactoryIFPBFactoryExceptionPersistenceBrokerFactoryIF.createPersistenceBroker(PBKey key)public void configure(org.apache.ojb.broker.util.configuration.Configuration config)
throws org.apache.ojb.broker.util.configuration.ConfigurationException
org.apache.ojb.broker.util.configuration.Configurableconfigure in interface org.apache.ojb.broker.util.configuration.Configurableconfig - the Configuration object used to configure current instanceorg.apache.ojb.broker.util.configuration.ConfigurationExceptionpublic void releaseAllInstances()
PersistenceBrokerFactoryIFreleaseAllInstances in interface PersistenceBrokerFactoryIFPersistenceBrokerFactoryIF.releaseAllInstances()public int activePersistenceBroker()
activePersistenceBroker in interface PersistenceBrokerFactoryIFpublic void shutdown()
PersistenceBrokerFactoryIFThreadLocal instances in OJB source and the reuse of threads
by the container (e.g. servlet- or ejb-container).shutdown in interface PersistenceBrokerFactoryIF(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30