Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Close context properly in MetricPublisher
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Feb 16, 2016
1 parent 39336ad commit 61b61d9
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Arrays;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.Asynchronous;
import javax.ejb.Singleton;
Expand Down Expand Up @@ -82,4 +83,13 @@ public void publish(PingStatus status) {

}

@PreDestroy
public void closeContext() {
if (context != null) {
try {
context.close();
} catch (Exception ignored) {
}
}
}
}

0 comments on commit 61b61d9

Please sign in to comment.