[
https://jira.jboss.org/browse/JBCACHE-1585?page=com.atlassian.jira.plugin...
]
Mats Henrikson updated JBCACHE-1585:
------------------------------------
Description:
There is a problem where the class
org.jboss.cache.eviction.RegionManager.EvictionTreeCacheListener.cacheStarted(), line
499:
evictionThread_ = new Timer();
Since the new Timer() is created without telling it that it is a daemon thread this Timer
thread will actually cause the JVM to not exit when the main() method of the application
finishes - it makes it necessary to call System.exit() to shut the JVM down.
Since this is the thread that periodically runs the specified eviction policy there is no
need for it to cause the JVM to stay running - it's up to the developer to say if the
JVM should stay running or not, not JBossCache.
The line should be changed to something like:
evictionThread_ = new Timer(true);
in order to specify that this is a daemon thread. (At the same time it would also be good
if the Timer is passed a thread name like for instance "JBossCache Eviction
Thread".)
Please see the JDK docs for more info:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html#Timer(java.l...
was:
There is a problem where the class
org.jboss.cache.eviction.RegionManager.EvictionTreeCacheListener.cacheStarted(), line
499:
{code}
evictionThread_ = new Timer();
{code}
Since the new Timer() is created without telling it that it is a daemon thread this Timer
thread will actually cause the JVM to not exit when the main() method of the application
finishes - it makes it necessary to call System.exit() to shut the JVM down.
Since this is the thread that periodically runs the specified eviction policy there is no
need for it to cause the JVM to stay running - it's up to the developer to say if the
JVM should stay running or not, not JBossCache.
The line should be changed to something like:
{code}
evictionThread_ = new Timer(true);
{code}
in order to specify that this is a daemon thread. (At the same time it would also be good
if the Timer is passed a thread name like for instance "JBossCache Eviction
Thread".)
Please see the JDK docs for more info:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html#Timer(java.l...
JBossCache eviction thread creating a Timer without making the new
thread a daemon thread
-----------------------------------------------------------------------------------------
Key: JBCACHE-1585
URL:
https://jira.jboss.org/browse/JBCACHE-1585
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 1.4.1.SP13
Reporter: Mats Henrikson
Assignee: Manik Surtani
There is a problem where the class
org.jboss.cache.eviction.RegionManager.EvictionTreeCacheListener.cacheStarted(), line
499:
evictionThread_ = new Timer();
Since the new Timer() is created without telling it that it is a daemon thread this Timer
thread will actually cause the JVM to not exit when the main() method of the application
finishes - it makes it necessary to call System.exit() to shut the JVM down.
Since this is the thread that periodically runs the specified eviction policy there is no
need for it to cause the JVM to stay running - it's up to the developer to say if the
JVM should stay running or not, not JBossCache.
The line should be changed to something like:
evictionThread_ = new Timer(true);
in order to specify that this is a daemon thread. (At the same time it would also be good
if the Timer is passed a thread name like for instance "JBossCache Eviction
Thread".)
Please see the JDK docs for more info:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html#Timer(java.l...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira