Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa » kernel » [javadoc | source]
org.apache.openjpa.kernel
abstract public class: AbstractBrokerFactory [javadoc | source]
java.lang.Object
   org.apache.openjpa.kernel.AbstractBrokerFactory

All Implemented Interfaces:
    BrokerFactory

Direct Known Subclasses:
    JDBCBrokerFactory, DistributedJDBCBrokerFactory, AbstractStoreBrokerFactory

Abstract implementation of the BrokerFactory that must be subclassed for a specific runtime.
Constructor:
 protected AbstractBrokerFactory(OpenJPAConfiguration config) 
    Constructor. Configuration must be provided on construction.
Method from org.apache.openjpa.kernel.AbstractBrokerFactory Summary:
addLifecycleListener,   addListeners,   addTransactionListener,   close,   configureBroker,   findBroker,   findTransactionalBroker,   getConfiguration,   getFactoryInitializationBanner,   getOpenBrokers,   getPoolKey,   getPooledFactoryForKey,   getProperties,   getUserObject,   initializeBroker,   isClosed,   lock,   makeReadOnly,   newBroker,   newBroker,   newBroker,   newBroker,   newBroker,   newBrokerImpl,   newStoreManager,   pool,   putUserObject,   readResolve,   releaseBroker,   removeLifecycleListener,   removeTransactionListener,   setPoolKey,   setup,   syncWithManagedTransaction,   toPoolKey,   unlock
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.kernel.AbstractBrokerFactory Detail:
 public  void addLifecycleListener(Object listener,
    Class[] classes) 
 protected  void addListeners(BrokerImpl broker) 
    Add factory-registered lifecycle listeners to the broker.
 public  void addTransactionListener(Object listener) 
 public  void close() 
 protected  void configureBroker(BrokerImpl broker) 
    Configures the given broker with the current factory option settings.
 protected BrokerImpl findBroker(String user,
    String pass,
    boolean managed) 
    Find a pooled broker, or return null if none. If using managed transactions, looks for a transactional broker; otherwise returns null by default. This method will be called before #newStoreManager so that factory subclasses implementing pooling can return a matching manager before a new StoreManager is created.
 protected BrokerImpl findTransactionalBroker(String user,
    String pass) 
    Find a managed runtime broker associated with the current transaction, or returns null if none.
 public OpenJPAConfiguration getConfiguration() 
    Return the configuration for this factory.
 protected Object getFactoryInitializationBanner() 
    Return an object to be written to the log when this broker factory initializes. This happens after the configuration is fully loaded.
 public Collection getOpenBrokers() 
    Returns a set of all the open brokers associated with this factory. The returned set is unmodifiable, and may contain null references.
 public Object getPoolKey() 
 public static AbstractBrokerFactory getPooledFactoryForKey(Object key) 
    Return the pooled factory matching the given key, or null if none. The key must be of the form created by #getPoolKey .
 public Properties getProperties() 
    Subclasses should override this method to add a Platform property listing the runtime platform, such as: OpenJPA JDBC Edition: Oracle Database
 public Object getUserObject(Object key) 
  void initializeBroker(boolean managed,
    int connRetainMode,
    BrokerImpl broker,
    boolean fromDeserialization) 
 public boolean isClosed() 
    Returns true if this broker factory is closed.
 public  void lock() 
 public  void makeReadOnly() 
    Freezes the configuration of this factory.
 public Broker newBroker() 
 public Broker newBroker(String user,
    String pass) 
 public Broker newBroker(boolean managed,
    int connRetainMode) 
 public Broker newBroker(String user,
    String pass,
    boolean managed,
    int connRetainMode) 
 public Broker newBroker(String user,
    String pass,
    boolean managed,
    int connRetainMode,
    boolean findExisting) 
 protected BrokerImpl newBrokerImpl(String user,
    String pass) 
    Return a broker configured with the proper settings. By default, this method constructs a new BrokerImpl of the class set for this factory.
 abstract protected StoreManager newStoreManager()
    Return a new StoreManager for this runtime. Note that the instance returned here may be wrapped before being passed to the #newBroker method.
 protected static  void pool(Object key,
    AbstractBrokerFactory factory) 
    Register factory in the pool under key.
 public Object putUserObject(Object key,
    Object val) 
 protected Object readResolve() throws ObjectStreamException 
    Replaces the factory with this JVMs pooled version if it exists. Also freezes the factory.
 protected  void releaseBroker(BrokerImpl broker) 
    Release broker from any internal data structures. This is invoked by broker after the broker is fully closed.
 public  void removeLifecycleListener(Object listener) 
 public  void removeTransactionListener(Object listener) 
  void setPoolKey(Object key) 
    Set a key that can be used to obtain this broker factory from the pool at a later time.
 protected  void setup() 
    Setup transient state used by this factory based on the current configuration, which will subsequently be locked down. This method will be called before the first broker is requested, and will be re-called each time the factory is deserialized into a JVM that has no configuration for this data store.
 boolean syncWithManagedTransaction(BrokerImpl broker,
    boolean begin) 
    Synchronize the given broker with a managed transaction, optionally starting one if none is in progress.
 protected static Object toPoolKey(Map map) 
    Return an internal factory pool key for the given configuration.
 public  void unlock()