|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.kernel.DelegatingBrokerFactory
public class DelegatingBrokerFactory
Delegating broker factory that can also perform exception translation for use in facades.
| Constructor Summary | |
|---|---|
DelegatingBrokerFactory(BrokerFactory factory)
Constructor; supply delegate. |
|
DelegatingBrokerFactory(BrokerFactory factory,
RuntimeExceptionTranslator trans)
Constructor; supply delegate and exception translator. |
|
| Method Summary | |
|---|---|
void |
addLifecycleListener(Object listener,
Class[] classes)
Register a listener for lifecycle-related events on the specified classes. |
void |
addTransactionListener(Object listener)
Register a listener for transaction-related events on the specified classes. |
void |
assertOpen()
assert that this broker is open. |
void |
close()
Close the factory. |
boolean |
equals(Object other)
|
OpenJPAConfiguration |
getConfiguration()
Return the configuration for this factory. |
BrokerFactory |
getDelegate()
Return the direct delegate. |
BrokerFactory |
getInnermostDelegate()
Return the native delegate. |
Map<String,Object> |
getProperties()
Return properties describing this runtime. |
Set<String> |
getSupportedProperties()
Return all of the supported properties as a set of keys. |
Object |
getUserObject(Object key)
Get the value for the specified key from the map of user objects. |
int |
hashCode()
|
boolean |
isClosed()
Returns true if this broker factory is closed. |
void |
lock()
Synchronizes on an internal lock. |
Broker |
newBroker()
Return a broker with default settings. |
Broker |
newBroker(String user,
String pass,
boolean managed,
int connRetainMode,
boolean findExisting)
Return a broker using the given credentials and in the given transaction and connection retain mode, optionally finding existing broker in the global transaction. |
Broker |
newBroker(String user,
String pass,
boolean managed,
int connRetainMode,
boolean findExisting,
String cfName,
String cf2Name)
Return a new broker using the supplied credentials transaction management mode connectionRetainMode connectionFactories |
void |
postCreationCallback()
This method is invoked AFTER a BrokerFactory has been instantiated. |
Object |
putUserObject(Object key,
Object val)
Put the specified key-value pair into the map of user objects. |
void |
removeLifecycleListener(Object listener)
Remove a listener for lifecycle-related events. |
void |
removeTransactionListener(Object listener)
Remove a listener for transaction-related events. |
protected RuntimeException |
translate(RuntimeException re)
Translate the OpenJPA exception. |
void |
unlock()
Release the internal lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DelegatingBrokerFactory(BrokerFactory factory)
public DelegatingBrokerFactory(BrokerFactory factory,
RuntimeExceptionTranslator trans)
| Method Detail |
|---|
public BrokerFactory getDelegate()
public BrokerFactory getInnermostDelegate()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Objectprotected RuntimeException translate(RuntimeException re)
public OpenJPAConfiguration getConfiguration()
BrokerFactory
getConfiguration in interface BrokerFactorypublic Map<String,Object> getProperties()
BrokerFactory
getProperties in interface BrokerFactorypublic Set<String> getSupportedProperties()
BrokerFactory
getSupportedProperties in interface BrokerFactory
public Object putUserObject(Object key,
Object val)
BrokerFactory
putUserObject in interface BrokerFactorypublic Object getUserObject(Object key)
BrokerFactory
getUserObject in interface BrokerFactorypublic Broker newBroker()
BrokerFactory
newBroker in interface BrokerFactory
public Broker newBroker(String user,
String pass,
boolean managed,
int connRetainMode,
boolean findExisting)
BrokerFactory
newBroker in interface BrokerFactory
public Broker newBroker(String user,
String pass,
boolean managed,
int connRetainMode,
boolean findExisting,
String cfName,
String cf2Name)
BrokerFactory
newBroker in interface BrokerFactoryuser - Username to use when obtaining a connection. Will be ignored if a connection factory is
obtained from JNDI.pass - Password to use when obtaining a connection. Will be ignored if a connection factory is
obtained from JNDI.managed - Whether managed transactions will be used by this BrokerconnRetainMode - ConnectionRetainModefindExisting - Whether the internal pool of brokers should be used.cfName - JTA ConnectionFactory to usecf2Name - Non-JTA ConnectionFactory to use.
public void addLifecycleListener(Object listener,
Class[] classes)
BrokerFactory
addLifecycleListener in interface BrokerFactorypublic void removeLifecycleListener(Object listener)
BrokerFactory
removeLifecycleListener in interface BrokerFactorypublic void addTransactionListener(Object listener)
BrokerFactoryBrokers created
from this instance moving forward.
addTransactionListener in interface BrokerFactorypublic void removeTransactionListener(Object listener)
BrokerFactoryBrokers created from this instance.
removeTransactionListener in interface BrokerFactorypublic void close()
BrokerFactory
close in interface BrokerFactoryclose in interface Closeablepublic boolean isClosed()
BrokerFactory
isClosed in interface BrokerFactorypublic void lock()
BrokerFactory
lock in interface BrokerFactorypublic void unlock()
BrokerFactory
unlock in interface BrokerFactorypublic void assertOpen()
BrokerFactory
assertOpen in interface BrokerFactorypublic void postCreationCallback()
BrokerFactory
postCreationCallback in interface BrokerFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||