/** * * @return true if a {@link ObservationConstants#XML_NOLOCAL} element * is present in the {@link SubscriptionInfo}. */ boolean isNoLocal() { return info.isNoLocal(); }
/** * Creates a new transaction listener for the scope of a transaction * commit (save call). * @return a transaction listener for this subscription. */ TransactionListener createTransactionListener() { if (info.isNoLocal()) { // a subscription which is not interested in local changes does // not need the transaction id return new TransactionEvent() { @Override public void onEvent(EventIterator events) { // ignore } @Override public void beforeCommit(TransactionResource resource, String lockToken) { // ignore } @Override public void afterCommit(TransactionResource resource, String lockToken, boolean success) { // ignore } }; } else { return new TransactionEvent(); } }