Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.kernel
Interface BrokerFactory

All Superinterfaces:
  Closeable, Serializable

All Known Implementing Classes:
  AbstractBrokerFactory, AbstractStoreBrokerFactory, DelegatingBrokerFactory, JDBCBrokerFactory

    public interface BrokerFactory

extends Serializable, Closeable

Factory for `Broker` instances.

Since:
  0.4.0
Author:
  Abe White

Method Summary
`void` | `addLifecycleListener(Object listener, Class[] classes)` Register a listener for lifecycle-related events on the specified classes.
`void` | `close()` Close the factory.
`OpenJPAConfiguration` | `getConfiguration()` Return the configuration for this factory.
`Properties` | `getProperties()` Return properties describing this runtime.
`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.
`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` | `unlock()` Release the internal lock.

Method Detail

### getConfiguration

    OpenJPAConfiguration getConfiguration()

  Return the configuration for this factory.

### getProperties

    Properties getProperties()

  Return properties describing this runtime.

### putUserObject

    Object putUserObject(Object key,
                         Object val)

  Put the specified key-value pair into the map of user objects.

### getUserObject

    Object getUserObject(Object key)

  Get the value for the specified key from the map of user objects.

### newBroker

    Broker newBroker()

  Return a broker with default settings.

### newBroker

    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.

### addLifecycleListener

    void addLifecycleListener(Object listener,
                              Class[] classes)

  Register a listener for lifecycle-related events on the specified classes. If the classes are null, all events will be propagated to the listener. The listener will be passed on to all new brokers.

  Since:
    0.3.3

### removeLifecycleListener

    void removeLifecycleListener(Object listener)

  Remove a listener for lifecycle-related events.

  Since:
    0.3.3

### close

    void close()

  Close the factory.

  Specified by:
    `close` in interface `Closeable`

### isClosed

    boolean isClosed()

  Returns true if this broker factory is closed.

### lock

    void lock()

  Synchronizes on an internal lock.

### unlock

    void unlock()

  Release the internal lock.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Apache Software Foundation. All Rights Reserved.