|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.broker.core.PersistenceBrokerBean
| Constructor Summary | |
PersistenceBrokerBean()
|
|
| Method Summary | |
void |
abortTransaction()
Aborts and closes the current transaction. |
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 |
addMtoNImplementor(MtoNImplementor m2nImpl)
Stores the given m:n implementor int the underlying persistence system. |
void |
beginTransaction()
Begins a transaction against the underlying RDBMS. |
void |
clearCache()
Clears the broker's internal cache. |
boolean |
close()
Closes this broker so that no further requests may be made on it. |
void |
commitTransaction()
Commits and closes the current transaction. |
void |
configure(org.apache.ojb.broker.util.configuration.Configuration pConfig)
|
java.lang.Object |
createProxy(java.lang.Class proxyClass,
Identity realSubjectsIdentity)
|
void |
delete(java.lang.Object obj)
Deletes the given object's persistent representation in the underlying persistence system. |
void |
deleteByQuery(Query query)
Deletes all objects matching the given query, from the underlying persistence system. |
void |
deleteMtoNImplementor(MtoNImplementor m2nImpl)
Deletes an m:n implementor which defines the relationship between two persistent objects. |
void |
ejbActivate()
|
void |
ejbPassivate()
|
void |
ejbRemove()
|
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. |
ClassDescriptor |
getClassDescriptor(java.lang.Class clazz)
Returns the class descriptor for the given persistence capable class. |
ManageableCollection |
getCollectionByQuery(java.lang.Class collectionClass,
Query query)
Retrieves the persistent objects matching the given query. |
java.util.Collection |
getCollectionByQuery(Query query)
Retrieves the persistent objects matching the given query. |
int |
getCount(Query query)
Returns the number of elements that the given query will return. |
DescriptorRepository |
getDescriptorRepository()
Returns the metadata descriptor repository associated with this broker. |
java.util.Iterator |
getIteratorByQuery(Query query)
Retrieves the persistent objects matching the given query and returns them as an iterator which may, depending on the configured collection type, be reloading the objects from the database upon calling Iterator.next(). |
java.lang.Object |
getObjectByIdentity(Identity id)
Retrieve a persistent object from the underlying datastore by its identity. |
java.lang.Object |
getObjectByQuery(Query query)
Retrieve the (first) persistent object from the underlying datastore that matches the given query. |
PBKey |
getPBKey()
Get the PBKey for this broker. |
java.util.Enumeration |
getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
Query query)
Returns an enumeration of objects representing the primary keys for the objects that match the given query. |
ProxyFactory |
getProxyFactory()
|
java.util.Iterator |
getReportQueryIteratorByQuery(Query query)
Retrieves the rows (as Object[] instances) matching the given query and
returns them as an iterator which may, depending on the configured collection type, be reloading
the objects from the database upon calling Iterator.next(). |
java.lang.Class |
getTopLevelClass(java.lang.Class clazz)
Returns the top level class (most abstract class in terms of extents) from which the given class extends. |
boolean |
hasClassDescriptor(java.lang.Class clazz)
Determines whether the given class is persistence capable and thus has an associated class descriptor in the metadata. |
boolean |
isClosed()
Determines whether this broker is closed. |
boolean |
isInTransaction()
Determines whether there is currently a transaction in progress. |
Query |
query()
factory method to create a new Query object. |
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 |
removeFromCache(java.lang.Object obj)
Removes the given object or, if it is an instance of Identity,
the object identified by it, from the broker's internal cache. |
void |
removeListener(PBListener listener)
Removes the specified listener from this broker. |
void |
retrieveAllReferences(java.lang.Object pInstance)
Retrieve all references and collections of the given object irrespective of the metadata settings defined for them. |
void |
retrieveReference(java.lang.Object pInstance,
java.lang.String pAttributeName)
Retrieve the specified reference or collection attribute for the given persistent object. |
BrokerHelper |
serviceBrokerHelper()
Returns the BrokerHelper instance associated with this broker, which
makes some additional helper methods available. |
ConnectionManagerIF |
serviceConnectionManager()
Returns the ConnectionManagerIF instance associated with this broker. |
IdentityFactory |
serviceIdentity()
Return the IdentityFactory instance associated with this broker. |
JdbcAccess |
serviceJdbcAccess()
Returns the JdbcAccess instance associated with this broker. |
ObjectCache |
serviceObjectCache()
Returns the ObjectCache instance associated
with this broker. |
SequenceManager |
serviceSequenceManager()
Returns the SequenceManager instance associated with this broker. |
org.apache.ojb.broker.accesslayer.sql.SqlGenerator |
serviceSqlGenerator()
Returns the SqlGenerator instance associated with this broker. |
StatementManagerIF |
serviceStatementManager()
Returns the StatementManagerIF instance associated with this broker. |
void |
setSessionContext(javax.ejb.SessionContext sessionContext)
|
void |
store(java.lang.Object obj)
Make the given object persistent in the underlying persistence system. |
void |
store(java.lang.Object obj,
ObjectModification modification)
Makes the given object persistent in the underlying persistence system. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PersistenceBrokerBean()
| Method Detail |
public DescriptorRepository getDescriptorRepository()
PersistenceBroker
getDescriptorRepository in interface PersistenceBrokerPersistenceBroker.getDescriptorRepository()public PBKey getPBKey()
PersistenceBrokerPBKey for this broker.
getPBKey in interface PersistenceBrokerPersistenceBroker.getPBKey()
public void delete(java.lang.Object obj)
throws PersistenceBrokerException
PersistenceBroker
delete in interface PersistenceBrokerobj - The object to delete
PersistenceBrokerExceptionPersistenceBroker.delete(Object)
public void deleteByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
deleteByQuery in interface PersistenceBrokerquery - The query determining the objects to delete
PersistenceBrokerExceptionPersistenceBroker.deleteByQuery(Query)
public void removeFromCache(java.lang.Object obj)
throws PersistenceBrokerException
PersistenceBrokerIdentity,
the object identified by it, from the broker's internal cache. Note that the removal is
not recursive. This means, objects referenced by the removed object will not be
automatically removed from the cache by this operation.
removeFromCache in interface PersistenceBrokerobj - The object to be removed from the cache or its identity
PersistenceBrokerExceptionPersistenceBroker.removeFromCache(Object)
public void clearCache()
throws PersistenceBrokerException
PersistenceBroker
clearCache in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.clearCache()
public void store(java.lang.Object obj)
throws PersistenceBrokerException
PersistenceBroker
store in interface PersistenceBrokerobj - The object to store
PersistenceBrokerExceptionPersistenceBroker.store(Object)
public void abortTransaction()
throws TransactionNotInProgressException
PersistenceBroker
abortTransaction in interface PersistenceBrokerTransactionNotInProgressException - If no transaction is currently in progressPersistenceBroker.abortTransaction()
public void beginTransaction()
throws TransactionInProgressException,
TransactionAbortedException
PersistenceBroker
beginTransaction in interface PersistenceBrokerTransactionInProgressException - If there is already a transaction in progress
TransactionAbortedExceptionPersistenceBroker.beginTransaction()
public void commitTransaction()
throws TransactionNotInProgressException,
TransactionAbortedException
PersistenceBroker
commitTransaction in interface PersistenceBrokerTransactionAbortedException - If the transaction cannot be committed
TransactionNotInProgressException - If there is no transaction currently in progressPersistenceBroker.commitTransaction()
public boolean isInTransaction()
throws PersistenceBrokerException
PersistenceBroker
isInTransaction in interface PersistenceBrokertrue if there is a transaction in progress
PersistenceBrokerExceptionPersistenceBroker.isInTransaction()public boolean close()
PersistenceBroker
close in interface PersistenceBrokertrue if the broker was successfully closedPersistenceBroker.close()public boolean isClosed()
PersistenceBroker
isClosed in interface PersistenceBroker
public java.util.Collection getCollectionByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getCollectionByQuery in interface PersistenceBrokerquery - The query
PersistenceBrokerExceptionPersistenceBroker.getCollectionByQuery(Query)
public int getCount(Query query)
throws PersistenceBrokerException
PersistenceBroker
getCount in interface PersistenceBrokerquery - The query
PersistenceBrokerExceptionPersistenceBroker.getCount(Query)
public ManageableCollection getCollectionByQuery(java.lang.Class collectionClass,
Query query)
throws PersistenceBrokerException
PersistenceBroker
getCollectionByQuery in interface PersistenceBrokercollectionClass - The collection type which needs to implement
ManageableCollectionquery - The query
PersistenceBrokerExceptionPersistenceBroker.getCollectionByQuery(Class, Query)
public java.util.Iterator getIteratorByQuery(Query query)
throws PersistenceBrokerException
PersistenceBrokerIterator.next(). Note that if the Query has no criteria
ALL persistent objects of the class targeted by the query will be returned.
getIteratorByQuery in interface PersistenceBrokerquery - The query
PersistenceBrokerExceptionPersistenceBroker.getIteratorByQuery(Query)
public java.util.Iterator getReportQueryIteratorByQuery(Query query)
throws PersistenceBrokerException
PersistenceBrokerObject[] instances) matching the given query and
returns them as an iterator which may, depending on the configured collection type, be reloading
the objects from the database upon calling Iterator.next().
getReportQueryIteratorByQuery in interface PersistenceBrokerquery - The report query
PersistenceBrokerExceptionPersistenceBroker.getReportQueryIteratorByQuery(Query)
public java.lang.Object getObjectByIdentity(Identity id)
throws PersistenceBrokerException
PersistenceBrokerPersistenceBroker.getObjectByQuery(Query) instead, as this method is mainly
intended to be used for internal handling of materialization by OID (e.g. in Proxies).
getObjectByIdentity in interface PersistenceBrokerid - The persistent object's id
PersistenceBrokerExceptionPersistenceBroker.getObjectByIdentity(Identity)
public java.lang.Object getObjectByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getObjectByQuery in interface PersistenceBrokerquery - The query
PersistenceBrokerExceptionPersistenceBroker.getObjectByQuery(Query)
public java.util.Enumeration getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
Query query)
throws PersistenceBrokerException
PersistenceBroker
getPKEnumerationByQuery in interface PersistenceBrokerPrimaryKeyClass - The class to use for the primary keysquery - The query
PersistenceBrokerExceptionPersistenceBroker.getPKEnumerationByQuery(Class, Query)
public void store(java.lang.Object obj,
ObjectModification modification)
throws PersistenceBrokerException
PersistenceBroker
store in interface PersistenceBrokerobj - The object to storemodification - Specifies what operation to perform (for generating optimized SQL)
PersistenceBrokerExceptionPersistenceBroker.store(Object, ObjectModification)
public ClassDescriptor getClassDescriptor(java.lang.Class clazz)
throws PersistenceBrokerException
PersistenceBroker
getClassDescriptor in interface PersistenceBrokerclazz - The target class
PersistenceBrokerException - If the class is not persistence capable, i.e.
if no metadata was defined for this class and hence its class descriptor
was not foundPersistenceBroker.getClassDescriptor(Class)public boolean hasClassDescriptor(java.lang.Class clazz)
PersistenceBroker
hasClassDescriptor in interface PersistenceBrokerclazz - The target class
true if a class descriptor was foundPersistenceBroker.hasClassDescriptor(Class)
public java.lang.Class getTopLevelClass(java.lang.Class clazz)
throws PersistenceBrokerException
PersistenceBroker
getTopLevelClass in interface PersistenceBrokerclazz - The class to get the top level class for
PersistenceBrokerException - If the class is not persistence capable,
if no metadata was defined for this classPersistenceBroker.getTopLevelClass(Class)public StatementManagerIF serviceStatementManager()
PersistenceBrokerStatementManagerIF instance associated with this broker.
serviceStatementManager in interface PersistenceBrokerPersistenceBroker.serviceStatementManager()public ConnectionManagerIF serviceConnectionManager()
PersistenceBrokerConnectionManagerIF instance associated with this broker.
serviceConnectionManager in interface PersistenceBrokerPersistenceBroker.serviceConnectionManager()public JdbcAccess serviceJdbcAccess()
PersistenceBrokerJdbcAccess instance associated with this broker.
serviceJdbcAccess in interface PersistenceBrokerpublic org.apache.ojb.broker.accesslayer.sql.SqlGenerator serviceSqlGenerator()
PersistenceBrokerSqlGenerator instance associated with this broker.
serviceSqlGenerator in interface PersistenceBrokerPersistenceBroker.serviceSqlGenerator()public SequenceManager serviceSequenceManager()
PersistenceBrokerSequenceManager instance associated with this broker.
serviceSequenceManager in interface PersistenceBrokerpublic BrokerHelper serviceBrokerHelper()
PersistenceBrokerBrokerHelper instance associated with this broker, which
makes some additional helper methods available.
serviceBrokerHelper in interface PersistenceBrokerpublic ObjectCache serviceObjectCache()
PersistenceBrokerObjectCache instance associated
with this broker.
serviceObjectCache in interface PersistenceBrokerpublic IdentityFactory serviceIdentity()
PersistenceBrokerIdentityFactory instance associated with this broker.
serviceIdentity in interface PersistenceBrokerpublic void fireBrokerEvent(PersistenceBrokerEvent event)
PersistenceBrokerPBListener instances.
fireBrokerEvent in interface PersistenceBrokerevent - The event to firepublic void fireBrokerEvent(PBLifeCycleEvent event)
PersistenceBrokerPBListener instances.
fireBrokerEvent in interface PersistenceBrokerevent - The event to firepublic void fireBrokerEvent(PBStateEvent event)
PersistenceBrokerPBListener instances.
fireBrokerEvent in interface PersistenceBrokerevent - The event to firepublic ProxyFactory getProxyFactory()
public java.lang.Object createProxy(java.lang.Class proxyClass,
Identity realSubjectsIdentity)
public void addListener(PBListener listener)
throws PersistenceBrokerException
PersistenceBrokerPBListener to this broker.
Note that temporary listeners will be removed upon closing a broker (returning
it to the pool).
addListener in interface PersistenceBrokerlistener - The listener to add
PersistenceBrokerExceptionPersistenceBroker.addListener(PBListener)
public void addListener(PBListener listener,
boolean permanent)
throws PersistenceBrokerException
PersistenceBrokerPBListener 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 PersistenceBrokerlistener - The listener to addpermanent - Whether the listener will stay registered after closing
the broker
PersistenceBrokerExceptionPersistenceBroker.addListener(PBListener, boolean)
public void removeListener(PBListener listener)
throws PersistenceBrokerException
PersistenceBroker
removeListener in interface PersistenceBrokerlistener - The listener to remove
PersistenceBrokerExceptionPersistenceBroker.removeListener(PBListener)
public void retrieveAllReferences(java.lang.Object pInstance)
throws PersistenceBrokerException
PersistenceBroker
retrieveAllReferences in interface PersistenceBrokerpInstance - The persistent object
PersistenceBrokerExceptionPersistenceBroker.retrieveAllReferences(Object)
public void retrieveReference(java.lang.Object pInstance,
java.lang.String pAttributeName)
throws PersistenceBrokerException
PersistenceBroker
retrieveReference in interface PersistenceBrokerpInstance - The persistent objectpAttributeName - The name of the attribute to retrieve
PersistenceBrokerExceptionPersistenceBroker.retrieveReference(Object, String)
public void removeAllListeners(boolean permanent)
throws PersistenceBrokerException
PersistenceBroker
removeAllListeners in interface PersistenceBrokerpermanent - Whether the listener will stay registered after closing
the broker
PersistenceBrokerExceptionPersistenceBroker.removeListener(PBListener)
public void removeAllListeners()
throws PersistenceBrokerException
PersistenceBroker
removeAllListeners in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.removeAllListeners()
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.Configurableorg.apache.ojb.broker.util.configuration.ConfigurationExceptionConfigurable.configure(Configuration)public Query query()
ObjectContainerQuery object.
query in interface ObjectContainerObjectContainer.query()
public void ejbActivate()
throws javax.ejb.EJBException,
java.rmi.RemoteException
ejbActivate in interface javax.ejb.SessionBeanjavax.ejb.EJBException
java.rmi.RemoteException
public void ejbPassivate()
throws javax.ejb.EJBException,
java.rmi.RemoteException
ejbPassivate in interface javax.ejb.SessionBeanjavax.ejb.EJBException
java.rmi.RemoteException
public void ejbRemove()
throws javax.ejb.EJBException,
java.rmi.RemoteException
ejbRemove in interface javax.ejb.SessionBeanjavax.ejb.EJBException
java.rmi.RemoteException
public void setSessionContext(javax.ejb.SessionContext sessionContext)
throws javax.ejb.EJBException,
java.rmi.RemoteException
setSessionContext in interface javax.ejb.SessionBeanjavax.ejb.EJBException
java.rmi.RemoteException
public void deleteMtoNImplementor(MtoNImplementor m2nImpl)
throws PersistenceBrokerException
PersistenceBroker
deleteMtoNImplementor in interface PersistenceBrokerm2nImpl - The m:n implementor to delete
PersistenceBrokerExceptionorg.apache.ojb.broker.PersistenceBroker#deleteMtoNImplementor()
public void addMtoNImplementor(MtoNImplementor m2nImpl)
throws PersistenceBrokerException
PersistenceBroker
addMtoNImplementor in interface PersistenceBrokerm2nImpl - The m:n implementor to delete
PersistenceBrokerExceptionorg.apache.ojb.broker.PersistenceBroker#addMtoNImplementor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||