|
|||||||||
| 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()
Abort and close the transaction. |
void |
addListener(PBListener listener)
Adds a temporary PBListener
to this PersistenceBroker instance - when PersistenceBroker.close() was
called the listener was removed. |
void |
addListener(PBListener listener,
boolean permanent)
Adds a permanent PBListener
to this PersistenceBroker instance if parameter permanent
was true. |
void |
addMtoNImplementor(MtoNImplementor m2nImpl)
|
void |
beginTransaction()
Begin a transaction against the underlying RDBMS. |
void |
clearCache()
clears the brokers internal cache. |
boolean |
close()
Close this PersistenceBroker so that no further requests may be made on it. |
void |
commitTransaction()
Commit and close the transaction. |
void |
configure(Configuration pConfig)
configure an object using the Configuration pConfig |
void |
delete(java.lang.Object obj)
deletes the objects obj concrete representation in the underlying persistence system. |
void |
deleteByQuery(Query query)
Deletes all objects matching the query from the underlying persistence system. |
void |
deleteMtoNImplementor(MtoNImplementor m2nImpl)
Deletes and MtoN implementor (a row on a indirection table) As it is today, ojb doesn't handle collection inherence, so collections descriptors are written per class. |
void |
ejbActivate()
|
void |
ejbPassivate()
|
void |
ejbRemove()
|
void |
fireBrokerEvent(PBLifeCycleEvent event)
Performs a broker event to inform all managed PBListener implementations. |
void |
fireBrokerEvent(PBStateEvent event)
Performs a broker event to inform all managed PBListener implementations. |
void |
fireBrokerEvent(PersistenceBrokerEvent event)
Performs a broker event to inform all managed PBListener implementations. |
ClassDescriptor |
getClassDescriptor(java.lang.Class clazz)
returns a ClassDescriptor for the persistence capable class clazz. |
ManageableCollection |
getCollectionByQuery(java.lang.Class collectionClass,
Query query)
Retrieve a userdefined Collection that implements the interface Manageable collection that contains all Objects matching the Query query. |
java.util.Collection |
getCollectionByQuery(Query query)
Retrieve a collection of itemClass Objects matching the Query query. |
int |
getCount(Query query)
Returns the count of elements a given query will return. |
DescriptorRepository |
getDescriptorRepository()
Returns the DescriptorRepository
associated with this broker. |
java.util.Iterator |
getIteratorByQuery(Query query)
returns an Iterator that iterates Objects of class c if calling the .next() method. |
java.lang.Object |
getObjectByIdentity(Identity id)
Retrieve an Object by its Identity. |
java.lang.Object |
getObjectByQuery(Query query)
Retrieve an Object by query. |
PBKey |
getPBKey()
Get the PBKey for this broker. |
java.util.Enumeration |
getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
Query query)
Returns an Enumeration of PrimaryKey Objects for objects of class DataClass. |
java.util.Iterator |
getReportQueryIteratorByQuery(Query query)
Returns an Iterator that iterates Object[] calling the .next() method. |
java.lang.Class |
getTopLevelClass(java.lang.Class clazz)
Returns the top level (extent) class to which the given class belongs. |
boolean |
hasClassDescriptor(java.lang.Class clazz)
same as getClassDescriptor, but does not throw. |
boolean |
isClosed()
|
boolean |
isInTransaction()
Returns true if the broker performs a transaction, false in the other case |
Query |
query()
factory method to create a new Query object. |
void |
removeAllListeners()
Removes all temporary listeners from this PersistenceBroker instance - Handle with care! |
void |
removeAllListeners(boolean permanent)
If parameter permanet was true all permanent and temporary listeners
will be removed from this PersistenceBroker instance. |
void |
removeFromCache(java.lang.Object obj)
Removes the object from the brokers internal cache. |
void |
removeListener(PBListener listener)
Removes a listener from this PersistenceBroker instance |
void |
retrieveAllReferences(java.lang.Object pInstance)
Retrieve all Reference- and Collection-attributes of a given instance |
void |
retrieveReference(java.lang.Object pInstance,
java.lang.String pAttributeName)
retrieve a single reference- or collection attribute of a persistent instance. |
BrokerHelper |
serviceBrokerHelper()
Returns the BrokerHelper instance associated with this broker. |
ConnectionManagerIF |
serviceConnectionManager()
Returns the ConnectionManagerIF 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. |
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 object obj persistent in the underlying persistence system. |
void |
store(java.lang.Object obj,
ObjectModification modification)
makes object obj persistent in the underlying persistence system. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PersistenceBrokerBean()
| Method Detail |
public DescriptorRepository getDescriptorRepository()
PersistenceBrokerDescriptorRepository
associated with this broker.
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 PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.delete(Object)
public void deleteByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
deleteByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.deleteByQuery(Query)
public void removeFromCache(java.lang.Object obj)
throws PersistenceBrokerException
PersistenceBrokerIdentity,
the associated object was removed from cache.
removeFromCache in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.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 PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.store(Object)
public void abortTransaction()
throws TransactionNotInProgressException
PersistenceBroker
abortTransaction in interface PersistenceBrokerTransactionNotInProgressExceptionPersistenceBroker.abortTransaction()
public void beginTransaction()
throws TransactionInProgressException,
TransactionAbortedException
PersistenceBrokerbeginTransaction multiple times,
without an intervening call to commitTransaction or abortTransaction,
causes the exception TransactionInProgressException to be thrown
on the second and subsequent calls.
beginTransaction in interface PersistenceBrokerTransactionInProgressException
TransactionAbortedExceptionPersistenceBroker.beginTransaction()
public void commitTransaction()
throws TransactionNotInProgressException,
TransactionAbortedException
PersistenceBrokercommit commits to the database all
UPDATE, INSERT and DELETE statements called within the transaction and
releases any locks held by the transaction.
If beginTransaction() has not been called before a
TransactionNotInProgressException exception is thrown.
If the transaction cannot be commited a TransactionAbortedException exception is thrown.
commitTransaction in interface PersistenceBrokerTransactionNotInProgressException
TransactionAbortedExceptionPersistenceBroker.commitTransaction()
public boolean isInTransaction()
throws PersistenceBrokerException
PersistenceBroker
isInTransaction in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.isInTransaction()public boolean close()
PersistenceBroker
close in interface PersistenceBrokerPersistenceBroker.close()public boolean isClosed()
isClosed in interface PersistenceBroker
public java.util.Collection getCollectionByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getCollectionByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getCollectionByQuery(Query)
public int getCount(Query query)
throws PersistenceBrokerException
PersistenceBroker
getCount in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getCount(Query)
public ManageableCollection getCollectionByQuery(java.lang.Class collectionClass,
Query query)
throws PersistenceBrokerException
PersistenceBroker
getCollectionByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getCollectionByQuery(Class, Query)
public java.util.Iterator getIteratorByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getIteratorByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getIteratorByQuery(Query)
public java.util.Iterator getReportQueryIteratorByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getReportQueryIteratorByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getReportQueryIteratorByQuery(Query)
public java.lang.Object getObjectByIdentity(Identity id)
throws PersistenceBrokerException
PersistenceBroker
getObjectByIdentity in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getObjectByIdentity(Identity)
public java.lang.Object getObjectByQuery(Query query)
throws PersistenceBrokerException
PersistenceBroker
getObjectByQuery in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getObjectByQuery(Query)
public java.util.Enumeration getPKEnumerationByQuery(java.lang.Class PrimaryKeyClass,
Query query)
throws PersistenceBrokerException
PersistenceBroker
getPKEnumerationByQuery in interface PersistenceBrokerPrimaryKeyClass - the pk class for the searched objectsquery - the query
PersistenceBrokerExceptionPersistenceBroker.getPKEnumerationByQuery(Class, Query)
public void store(java.lang.Object obj,
ObjectModification modification)
throws PersistenceBrokerException
PersistenceBroker
store in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.store(Object, ObjectModification)
public ClassDescriptor getClassDescriptor(java.lang.Class clazz)
throws PersistenceBrokerException
PersistenceBroker
getClassDescriptor in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.getClassDescriptor(Class)public boolean hasClassDescriptor(java.lang.Class clazz)
PersistenceBroker
hasClassDescriptor in interface PersistenceBrokerclazz -
PersistenceBroker.hasClassDescriptor(Class)
public java.lang.Class getTopLevelClass(java.lang.Class clazz)
throws PersistenceBrokerException
PersistenceBroker
getTopLevelClass in interface PersistenceBrokerPersistenceBrokerException - if clazz is not persistence capable,
i.e. if clazz is not defined in the DescriptorRepository.PersistenceBroker.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 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.
Makes some helper methods available.
serviceBrokerHelper in interface PersistenceBrokerpublic ObjectCache serviceObjectCache()
PersistenceBrokerObjectCache instance associated
with this broker.
serviceObjectCache in interface PersistenceBrokerpublic void fireBrokerEvent(PersistenceBrokerEvent event)
PersistenceBrokerPBListener implementations.
fireBrokerEvent in interface PersistenceBrokerpublic void fireBrokerEvent(PBLifeCycleEvent event)
PersistenceBrokerPBListener implementations.
fireBrokerEvent in interface PersistenceBrokerpublic void fireBrokerEvent(PBStateEvent event)
PersistenceBrokerPBListener implementations.
fireBrokerEvent in interface PersistenceBroker
public void addListener(PBListener listener)
throws PersistenceBrokerException
PersistenceBrokerPBListener
to this PersistenceBroker instance - when PersistenceBroker.close() was
called the listener was removed.
addListener in interface PersistenceBrokerlistener - The listener to add
PersistenceBrokerExceptionPersistenceBroker.addListener(PBListener)
public void addListener(PBListener listener,
boolean permanent)
throws PersistenceBrokerException
PersistenceBrokerPBListener
to this PersistenceBroker instance if parameter permanent
was true. This means the listener will be
hold the whole life time of the broker.
PersistenceBrokerFactoryIF or extend the default
implementation PersistenceBrokerFactoryDefaultImpl
and add the listener at creation of the PersistenceBroker
instances.
addListener in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.addListener(PBListener, boolean)
public void removeListener(PBListener listener)
throws PersistenceBrokerException
PersistenceBroker
removeListener in interface PersistenceBrokerlistener -
PersistenceBrokerExceptionPersistenceBroker.removeListener(PBListener)
public void retrieveAllReferences(java.lang.Object pInstance)
throws PersistenceBrokerException
PersistenceBroker
retrieveAllReferences in interface PersistenceBrokerpInstance - the persistent instance
PersistenceBrokerExceptionPersistenceBroker.retrieveAllReferences(Object)
public void retrieveReference(java.lang.Object pInstance,
java.lang.String pAttributeName)
throws PersistenceBrokerException
PersistenceBroker
retrieveReference in interface PersistenceBrokerpInstance - the persistent instancepAttributeName - the name of the Attribute to load
PersistenceBrokerExceptionPersistenceBroker.retrieveReference(Object, String)
public void removeAllListeners(boolean permanent)
throws PersistenceBrokerException
PersistenceBrokerpermanet was true all permanent and temporary listeners
will be removed from this PersistenceBroker instance.
removeAllListeners in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.removeListener(PBListener listener)
public void removeAllListeners()
throws PersistenceBrokerException
PersistenceBroker
removeAllListeners in interface PersistenceBrokerPersistenceBrokerExceptionPersistenceBroker.removeAllListeners()
public void configure(Configuration pConfig)
throws ConfigurationException
Configurable
configure in interface ConfigurablepConfig - the Configuration object used to configure current instance
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 -
PersistenceBrokerException - if an error occoursorg.apache.ojb.broker.PersistenceBroker#deleteMtoNImplementor()
public void addMtoNImplementor(MtoNImplementor m2nImpl)
throws PersistenceBrokerException
addMtoNImplementor in interface PersistenceBrokerPersistenceBrokerExceptionorg.apache.ojb.broker.PersistenceBroker#addMtoNImplementor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||