Issue #2357: Close JmsSession when it has no producers or consumers
Change-Id: Icd0d29c0e6a43109ac26a1d1ad1bbeef9d7aca5f Former-commit-id:60d691f58c
[formerlyfe249a9fc2
] [formerly953ddccdb0
] [formerly60d691f58c
[formerlyfe249a9fc2
] [formerly953ddccdb0
] [formerlyc3529a1769
[formerly953ddccdb0
[formerly 2a152d5ef2b0e3f54948f3679be74ecd717c02f9]]]] Former-commit-id:c3529a1769
Former-commit-id:e2ff6cce4e
[formerly84f9abdeaf
] [formerly df2182ad6687468f9d0fb2525fed80affd253a5e [formerly31e2bd3555
]] Former-commit-id: 22fa1d1118aae64a028fdec05f493b050bd66574 [formerly7014a2af24
] Former-commit-id:f9b58971b5
This commit is contained in:
parent
00078715f4
commit
b8e5209d0a
1 changed files with 8 additions and 1 deletions
|
@ -60,6 +60,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Apr 15, 2011 rjpeter Initial creation
|
||||
* Mar 08, 2012 194 njensen Improved logging
|
||||
* Feb 21, 2013 1642 rjpeter Fix deadlock scenario
|
||||
* Jan 26, 2014 2357 rjpeter Close a session when it has no producers or consumers.
|
||||
* </pre>
|
||||
*
|
||||
* @author rjpeter
|
||||
|
@ -627,7 +628,7 @@ public class JmsPooledSession {
|
|||
}
|
||||
}
|
||||
|
||||
boolean valid = isValid();
|
||||
boolean valid = isValid() && hasProducersOrConsumers();
|
||||
if (valid && returnToPool) {
|
||||
valid = conn.returnSessionToPool(this);
|
||||
}
|
||||
|
@ -654,4 +655,10 @@ public class JmsPooledSession {
|
|||
public Object getStateLock() {
|
||||
return stateLock;
|
||||
}
|
||||
|
||||
public boolean hasProducersOrConsumers() {
|
||||
return !inUseConsumers.isEmpty() || !inUseProducers.isEmpty()
|
||||
|| !availableConsumers.isEmpty()
|
||||
|| !availableProducers.isEmpty();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue