org.apache.ojb.broker.core
Class PersistenceBrokerThreadMapping

java.lang.Object
  extended byorg.apache.ojb.broker.core.PersistenceBrokerThreadMapping

public class PersistenceBrokerThreadMapping
extends java.lang.Object

Helper class that tracks correspondence between PersistenceBroker instances and threads. The main task that this class solves is: to get current PersistenceBroker for the given thread. For internal use only.

Version:
$Id: PersistenceBrokerThreadMapping.java,v 1.4 2003/10/28 21:21:19 arminw Exp $
Author:
Oleg Nitz

Constructor Summary
PersistenceBrokerThreadMapping()
           
 
Method Summary
static PersistenceBroker currentPersistenceBroker(PBKey key)
          Return the current open PersistenceBroker instance for the given PBKey, if any.
static void setCurrentPersistenceBroker(PBKey key, PersistenceBroker broker)
           
static void unsetCurrentPersistenceBroker(PBKey key, PersistenceBroker broker)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerThreadMapping

public PersistenceBrokerThreadMapping()
Method Detail

setCurrentPersistenceBroker

public static void setCurrentPersistenceBroker(PBKey key,
                                               PersistenceBroker broker)
                                        throws PBFactoryException
Throws:
PBFactoryException

unsetCurrentPersistenceBroker

public static void unsetCurrentPersistenceBroker(PBKey key,
                                                 PersistenceBroker broker)
                                          throws PBFactoryException
Throws:
PBFactoryException

currentPersistenceBroker

public static PersistenceBroker currentPersistenceBroker(PBKey key)
                                                  throws PBFactoryException,
                                                         PersistenceBrokerException
Return the current open PersistenceBroker instance for the given PBKey, if any.

Parameters:
key -
Returns:
null if no open PersistenceBroker found.
Throws:
PBFactoryException
PersistenceBrokerException


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