public abstract class PersistenceBrokerAbstractImpl extends java.lang.Object implements PersistenceBrokerInternal
PersistenceBroker
encapsulating the used PB-event/listener concept.PersistenceBroker
,
PBLifeCycleListener
,
PersistenceBrokerAware
,
PBStateListener
Constructor and Description |
---|
PersistenceBrokerAbstractImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(PBListener listener)
Adds a temporary
PBListener to this broker. |
void |
addListener(PBListener listener,
boolean permanent)
Adds a temporary or permanent
PBListener to this broker,
depending on the parameter value. |
void |
configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
Override if needed.
|
void |
fireBrokerEvent(PBLifeCycleEvent event)
Fires a life cycle event to inform all registered
PBListener instances. |
void |
fireBrokerEvent(PBStateEvent event)
Fires a state event to inform all registered
PBListener instances. |
void |
fireBrokerEvent(PersistenceBrokerEvent event)
Fires a broker event to inform all registered
PBListener instances. |
boolean |
isTxCheck()
Returns true if the development checks are enabled.
|
void |
removeAllListeners()
Removes all temporary listeners from this broker.
|
void |
removeAllListeners(boolean permanent)
Removes all temporary and, if desired, permanent listeners from this broker.
|
void |
removeListener(PBListener listener)
Removes the specified listener from this broker.
|
void |
setTxCheck(boolean txCheck)
This setting can be helpful during development if the PersistenceBroker transaction
demarcation was used (this is true in most cases).
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkRefreshRelationships, createProxy, delete, getProxyFactory, getReferenceBroker, getRelationshipPrefetcherFactory, isManaged, setManaged, store
abortTransaction, addMtoNImplementor, beginTransaction, clearCache, close, commitTransaction, delete, deleteByQuery, deleteMtoNImplementor, getClassDescriptor, getCollectionByQuery, getCollectionByQuery, getCount, getDescriptorRepository, getIteratorByQuery, getObjectByIdentity, getObjectByQuery, getPBKey, getPKEnumerationByQuery, getReportQueryIteratorByQuery, getTopLevelClass, hasClassDescriptor, isClosed, isInTransaction, removeFromCache, retrieveAllReferences, retrieveReference, serviceBrokerHelper, serviceConnectionManager, serviceIdentity, serviceJdbcAccess, serviceObjectCache, serviceSequenceManager, serviceSqlGenerator, serviceStatementManager, store, store
query
public void configure(org.apache.ojb.broker.util.configuration.Configuration pConfig) throws org.apache.ojb.broker.util.configuration.ConfigurationException
configure
in interface org.apache.ojb.broker.util.configuration.Configurable
pConfig
- the Configuration object used to configure current instanceorg.apache.ojb.broker.util.configuration.ConfigurationException
Configurable.configure(Configuration)
public boolean isTxCheck()
setTxCheck(boolean)
public void setTxCheck(boolean txCheck)
txCheck
- Set true to enable the checkspublic void addListener(PBListener listener) throws PersistenceBrokerException
PersistenceBroker
PBListener
to this broker.
Note that temporary listeners will be removed upon closing a broker (returning
it to the pool).addListener
in interface PersistenceBroker
listener
- The listener to addPersistenceBrokerException
PersistenceBroker.addListener(PBListener listener)
public void addListener(PBListener listener, boolean permanent) throws PersistenceBrokerException
PersistenceBroker
PBListener
to this broker,
depending on the parameter value. Note that temporary listeners will be removed upon
closing a broker (returning it to the pool).
PersistenceBrokerFactoryIF
or extend the default
one, PersistenceBrokerFactoryDefaultImpl
. There you
can add the listener at creation of the PersistenceBroker
instances.addListener
in interface PersistenceBroker
listener
- The listener to addpermanent
- Whether the listener will stay registered after closing
the brokerPersistenceBrokerException
PersistenceBroker.addListener(PBListener listener, boolean permanent)
public void removeListener(PBListener listener) throws PersistenceBrokerException
PersistenceBroker
removeListener
in interface PersistenceBroker
listener
- The listener to removePersistenceBrokerException
PersistenceBroker.removeListener(PBListener listener)
public void removeAllListeners(boolean permanent) throws PersistenceBrokerException
PersistenceBroker
removeAllListeners
in interface PersistenceBroker
permanent
- Whether the listener will stay registered after closing
the brokerPersistenceBrokerException
PersistenceBroker.removeAllListeners(boolean)
public void removeAllListeners() throws PersistenceBrokerException
PersistenceBroker
removeAllListeners
in interface PersistenceBroker
PersistenceBrokerException
PersistenceBroker.removeAllListeners()
public void fireBrokerEvent(PersistenceBrokerEvent event)
PersistenceBroker
PBListener
instances.fireBrokerEvent
in interface PersistenceBroker
event
- The event to firepublic void fireBrokerEvent(PBLifeCycleEvent event)
PersistenceBroker
PBListener
instances.fireBrokerEvent
in interface PersistenceBroker
event
- The event to firepublic void fireBrokerEvent(PBStateEvent event)
PersistenceBroker
PBListener
instances.fireBrokerEvent
in interface PersistenceBroker
event
- The event to fire(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