Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Klishin committed Nov 5, 2013
1 parent 81c0d26 commit af3cb93
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/java/com/novemberain/langohr/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import java.net.InetAddress;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentSkipListSet;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;

Expand Down Expand Up @@ -59,7 +58,7 @@ public Connection(ConnectionFactory cf, IPersistentMap options) {
}

public Connection init() throws IOException {
ExecutorService es = (ExecutorService)this.options.valAt(EXECUTOR_KEYWORD);
ExecutorService es = (ExecutorService) this.options.valAt(EXECUTOR_KEYWORD);
this.delegate = cf.newConnection(es);

if (this.automaticRecoveryEnabled()) {
Expand All @@ -74,7 +73,7 @@ private void addAutomaticRecoveryHook() {
automaticRecoveryListener = new ShutdownListener() {
public void shutdownCompleted(ShutdownSignalException cause) {
try {
if(!cause.isInitiatedByApplication()){
if (!cause.isInitiatedByApplication()) {
c.beginAutomaticRecovery();
}
} catch (InterruptedException e) {
Expand All @@ -88,9 +87,9 @@ public void shutdownCompleted(ShutdownSignalException cause) {
}
};

synchronized(this) {
this.shutdownHooks.add(automaticRecoveryListener);
this.delegate.addShutdownListener(automaticRecoveryListener);
synchronized (this) {
this.shutdownHooks.add(automaticRecoveryListener);
this.delegate.addShutdownListener(automaticRecoveryListener);
}
}

Expand All @@ -108,7 +107,7 @@ private void beginAutomaticRecovery() throws InterruptedException, IOException {
}

private void runChannelRecoveryHooks() {
Iterator<Map.Entry<Integer,Channel>> it = this.channels.entrySet().iterator();
Iterator<Map.Entry<Integer, Channel>> it = this.channels.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Integer, Channel> e = it.next();
Channel ch = e.getValue();
Expand All @@ -118,7 +117,7 @@ private void runChannelRecoveryHooks() {
}

private void recoverChannels() throws IOException {
Iterator<Map.Entry<Integer,Channel>> it = this.channels.entrySet().iterator();
Iterator<Map.Entry<Integer, Channel>> it = this.channels.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<Integer, Channel> e = it.next();
Channel ch = e.getValue();
Expand All @@ -134,7 +133,7 @@ private void recoverShutdownHooks() {
}

private void recoverConnection() throws IOException {
ExecutorService es = (ExecutorService)this.options.valAt(EXECUTOR_KEYWORD);
ExecutorService es = (ExecutorService) this.options.valAt(EXECUTOR_KEYWORD);
this.delegate = this.cf.newConnection(es);
}

Expand Down

0 comments on commit af3cb93

Please sign in to comment.