Delegating broker factory that can also perform exception translation
for use in facades.
| Method from org.apache.openjpa.kernel.DelegatingBrokerFactory Detail: |
public void addLifecycleListener(Object listener,
Class[] classes) {
try {
_factory.addLifecycleListener(listener, classes);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public void addTransactionListener(Object listener) {
try {
_factory.addTransactionListener(listener);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public void close() {
try {
_factory.close();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public boolean equals(Object other) {
if (other == this)
return true;
if (other instanceof DelegatingBrokerFactory)
other = ((DelegatingBrokerFactory) other).getInnermostDelegate();
return getInnermostDelegate().equals(other);
}
|
public OpenJPAConfiguration getConfiguration() {
try {
return _factory.getConfiguration();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public BrokerFactory getDelegate() {
return _factory;
}
Return the direct delegate. |
public BrokerFactory getInnermostDelegate() {
return (_del == null) ? _factory : _del.getInnermostDelegate();
}
Return the native delegate. |
public Properties getProperties() {
try {
return _factory.getProperties();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public Object getUserObject(Object key) {
try {
return _factory.getUserObject(key);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public int hashCode() {
return getInnermostDelegate().hashCode();
}
|
public boolean isClosed() {
try {
return _factory.isClosed();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public void lock() {
try {
_factory.lock();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public Broker newBroker() {
try {
return _factory.newBroker();
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public Broker newBroker(String user,
String pass,
boolean managed,
int connRetainMode,
boolean findExisting) {
try {
return _factory.newBroker(user, pass, managed, connRetainMode,
findExisting);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public Object putUserObject(Object key,
Object val) {
try {
return _factory.putUserObject(key, val);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public void removeLifecycleListener(Object listener) {
try {
_factory.removeLifecycleListener(listener);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
public void removeTransactionListener(Object listener) {
try {
_factory.removeTransactionListener(listener);
} catch (RuntimeException re) {
throw translate(re);
}
}
|
protected RuntimeException translate(RuntimeException re) {
return (_trans == null) ? re : _trans.translate(re);
}
Translate the OpenJPA exception. |
public void unlock() {
try {
_factory.unlock();
} catch (RuntimeException re) {
throw translate(re);
}
}
|