org.apache.ojb.broker.core
Class PersistenceBrokerHandle

java.lang.Object
  extended byorg.apache.ojb.broker.core.DelegatingPersistenceBroker
      extended byorg.apache.ojb.broker.core.PersistenceBrokerHandle
All Implemented Interfaces:
org.apache.ojb.broker.util.configuration.Configurable, ObjectContainer, PBState, PersistenceBroker

public final class PersistenceBrokerHandle
extends DelegatingPersistenceBroker

A handle wraps a real (pooled) PB instance. In addition this class does set itself as current broker instance in PersistenceBrokerThreadMapping.setCurrentPersistenceBroker(org.apache.ojb.broker.PBKey, org.apache.ojb.broker.PersistenceBroker) when instantiate and unset on broker close call.

Version:
$Id: PersistenceBrokerHandle.java,v 1.8 2003/10/28 21:18:47 arminw Exp $
Author:
Armin Waibel

Constructor Summary
PersistenceBrokerHandle(PersistenceBroker broker)
          Constructor for the handle, set itself in PersistenceBrokerThreadMapping.setCurrentPersistenceBroker(org.apache.ojb.broker.PBKey, org.apache.ojb.broker.PersistenceBroker)
 
Method Summary
 boolean close()
          Destroy this handle and return the underlying (wrapped) PB instance to pool (when using default implementation of PersistenceBrokerFactory), unset this instance from PersistenceBrokerThreadMapping.
 boolean isClosed()
           
 boolean isInTransaction()
          Returns true if the broker performs a transaction, false in the other case
 
Methods inherited from class org.apache.ojb.broker.core.DelegatingPersistenceBroker
abortTransaction, addListener, addListener, addMtoNImplementor, beginTransaction, clearCache, commitTransaction, configure, delete, deleteByQuery, deleteMtoNImplementor, fireBrokerEvent, fireBrokerEvent, fireBrokerEvent, getClassDescriptor, getCollectionByQuery, getCollectionByQuery, getCount, getDelegate, getDescriptorRepository, getInnermostDelegate, getIteratorByQuery, getObjectByIdentity, getObjectByQuery, getPBKey, getPKEnumerationByQuery, getReportQueryIteratorByQuery, getTopLevelClass, hasClassDescriptor, query, removeAllListeners, removeAllListeners, removeFromCache, removeListener, retrieveAllReferences, retrieveReference, serviceBrokerHelper, serviceConnectionManager, serviceJdbcAccess, serviceObjectCache, serviceSequenceManager, serviceSqlGenerator, serviceStatementManager, setClosed, setDelegate, store, store
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerHandle

public PersistenceBrokerHandle(PersistenceBroker broker)
Constructor for the handle, set itself in PersistenceBrokerThreadMapping.setCurrentPersistenceBroker(org.apache.ojb.broker.PBKey, org.apache.ojb.broker.PersistenceBroker)

Method Detail

isClosed

public boolean isClosed()
Specified by:
isClosed in interface PersistenceBroker
Overrides:
isClosed in class DelegatingPersistenceBroker

isInTransaction

public boolean isInTransaction()
                        throws PersistenceBrokerException
Description copied from interface: PersistenceBroker
Returns true if the broker performs a transaction, false in the other case

Specified by:
isInTransaction in interface PersistenceBroker
Overrides:
isInTransaction in class DelegatingPersistenceBroker
Throws:
PersistenceBrokerException

close

public boolean close()
Destroy this handle and return the underlying (wrapped) PB instance to pool (when using default implementation of PersistenceBrokerFactory), unset this instance from PersistenceBrokerThreadMapping.

Specified by:
close in interface PersistenceBroker
Overrides:
close in class DelegatingPersistenceBroker


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14