Permalink
Browse files

Merge pull request #55 from dizzzz/develop

CHanges for preparing replication/messaging extension
  • Loading branch information...
2 parents 9811cfb + 888c35a commit 809149104c4f430eaf958ea22b13e60beebc172f @shabanovd shabanovd committed Sep 25, 2013
Showing with 16 additions and 3 deletions.
  1. +8 −0 src/org/exist/storage/BrokerPool.java
  2. +8 −3 src/org/exist/xquery/Profiler.java
@@ -1516,6 +1516,13 @@ public Subject getSubject() {
return securityManager.getGuestSubject();
}
+ /**
+ * Get active broker for current thread
+ *
+ * @return Database broker
+ * @throws RuntimeException NO broker available for current thread.
+ *
+ */
public DBBroker getActiveBroker() { //throws EXistException {
//synchronized(this) {
//Try to get an active broker
@@ -1540,6 +1547,7 @@ public void execute(Map<Thread, DBBroker> map) {
}
}
});
+ LOG.debug(sb.toString());
throw new RuntimeException(sb.toString());
}
return broker;
@@ -139,9 +139,14 @@ public final boolean isEnabled() {
}
public final boolean isLogEnabled() {
- final DBBroker broker = db.getActiveBroker();
- final Boolean globalProp = (Boolean) broker.getConfiguration().getProperty(CONFIG_PROPERTY_TRACELOG);
- return logEnabled || (globalProp != null && globalProp.booleanValue());
+ try {
+ final DBBroker broker = db.getActiveBroker();
+ final Boolean globalProp = (Boolean) broker.getConfiguration().getProperty(CONFIG_PROPERTY_TRACELOG);
+ return logEnabled || (globalProp != null && globalProp.booleanValue());
+ } catch (Throwable t) {
+ log.debug("Ignored exception: " + t.getMessage());
+ return logEnabled;
+ }
}
public final void setLogEnabled(boolean enabled) {

0 comments on commit 8091491

Please sign in to comment.