Author: nbelaevski
Date: 2011-04-29 09:38:53 -0400 (Fri, 29 Apr 2011)
New Revision: 22457
Modified:
trunk/examples/push-demo/src/main/java/demo/JMSBean.java
Log:
JMSBean produced NPE on application undeploy - fixed
Modified: trunk/examples/push-demo/src/main/java/demo/JMSBean.java
===================================================================
--- trunk/examples/push-demo/src/main/java/demo/JMSBean.java 2011-04-29 13:10:52 UTC (rev
22456)
+++ trunk/examples/push-demo/src/main/java/demo/JMSBean.java 2011-04-29 13:38:53 UTC (rev
22457)
@@ -70,6 +70,8 @@
private static final Logger LOGGER = RichfacesLogger.APPLICATION.getLogger();
+ private static final PublishTask SHUTDOWN_TASK = new PublishTask(null, null);
+
private Connection connection;
private final class PublishRunnable implements Runnable {
@@ -91,7 +93,7 @@
while (true) {
PublishTask task = tasks.take();
- if (task == null) {
+ if (task == SHUTDOWN_TASK) {
break;
}
@@ -230,7 +232,7 @@
@PreDestroy
public void destroy() {
- tasks.add(null);
+ tasks.add(SHUTDOWN_TASK);
if (connection != null) {
try {
connection.close();
Show replies by date