public interface BrokerFactory extends Serializable, Closeable
Broker
instances.Modifier and Type | Method and Description |
---|---|
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.
|
OpenJPAConfiguration |
getConfiguration()
Return the configuration for this factory.
|
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.
|
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.
|
void |
unlock()
Release the internal lock.
|
OpenJPAConfiguration getConfiguration()
Set<String> getSupportedProperties()
Object putUserObject(Object key, Object val)
Object getUserObject(Object key)
Broker newBroker()
Broker newBroker(String user, String pass, boolean managed, int connRetainMode, boolean findExisting)
Broker newBroker(String user, String pass, boolean managed, int connRetainMode, boolean findExisting, String cfName, String cf2Name)
user
- 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
- ConnectionRetainMode
findExisting
- Whether the internal pool of brokers should be used.cfName
- JTA ConnectionFactory to usecf2Name
- Non-JTA ConnectionFactory to use.void addLifecycleListener(Object listener, Class<?>[] classes)
void removeLifecycleListener(Object listener)
void addTransactionListener(Object listener)
Broker
s created
from this instance moving forward.void removeTransactionListener(Object listener)
Broker
s created from this instance.boolean isClosed()
void lock()
void unlock()
void assertOpen()
void postCreationCallback()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.