Skip to content

Commit

Permalink
Compile against RabbitMQ Java client 3.2.0
Browse files Browse the repository at this point in the history
Fixes #33.
  • Loading branch information
Michael Klishin committed Nov 5, 2013
1 parent c6ab3d3 commit 81c0d26
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/java/com/novemberain/langohr/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import clojure.lang.IPersistentMap;
import clojure.lang.Keyword;
import clojure.lang.PersistentHashMap;
import com.rabbitmq.client.BlockedListener;
import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
Expand All @@ -13,6 +14,7 @@
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;

public class Connection implements com.rabbitmq.client.Connection, Recoverable {
Expand All @@ -31,6 +33,7 @@ public class Connection implements com.rabbitmq.client.Connection, Recoverable {
*/
private ShutdownListener automaticRecoveryListener;
private Map<Integer, Channel> channels;
private final Collection<BlockedListener> blockedListeners = new CopyOnWriteArrayList<BlockedListener>();

private static IPersistentMap buildDefaultOptions() {
Map<Keyword, Boolean> m = new HashMap<Keyword, Boolean>();
Expand Down Expand Up @@ -420,4 +423,16 @@ public int getFrameMax() {
public void abort(int closeCode, String closeMessage, int timeout) {
delegate.abort(closeCode, closeMessage, timeout);
}

public void addBlockedListener(BlockedListener listener) {
blockedListeners.add(listener);
}

public boolean removeBlockedListener(BlockedListener listener) {
return blockedListeners.remove(listener);
}

public void clearBlockedListeners() {
blockedListeners.clear();
}
}

0 comments on commit 81c0d26

Please sign in to comment.