[jbosscache-commits] JBoss Cache SVN: r8471 - core/trunk/src/main/java/org/jboss/cache/factories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Oct 6 19:35:02 EDT 2011


Author: dereed
Date: 2011-10-06 19:35:01 -0400 (Thu, 06 Oct 2011)
New Revision: 8471

Modified:
   core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
Log:
[JBCACHE-1605] synchronize methods that change the Cache's state


Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java	2011-08-19 00:25:58 UTC (rev 8470)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java	2011-10-06 23:35:01 UTC (rev 8471)
@@ -578,7 +578,7 @@
     * Creates the components needed by a cache instance and sets the cache status to {@link org.jboss.cache.CacheStatus#CREATED}
     * when it is done.
     */
-   public void create()
+   public synchronized void create()
    {
       if (!state.createAllowed())
       {
@@ -606,7 +606,7 @@
     * This starts the components in the cache, connecting to channels, starting service threads, etc.  If the cache is
     * not in the {@link org.jboss.cache.CacheStatus#CREATED} state, {@link #create()} will be invoked first.
     */
-   public void start()
+   public synchronized void start()
    {
       boolean createdInStart = false;
       if (!state.startAllowed())
@@ -641,7 +641,7 @@
     * Stops the cache and sets the cache status to {@link org.jboss.cache.CacheStatus#STOPPED} once it is done.  If the cache is not in
     * the {@link org.jboss.cache.CacheStatus#STARTED} state, this is a no-op.
     */
-   public void stop()
+   public synchronized void stop()
    {
       if (!state.stopAllowed())
       {
@@ -676,7 +676,7 @@
     * If the cache is in {@link org.jboss.cache.CacheStatus#STARTED} when this method is called, it will first call {@link #stop()}
     * to stop the cache.
     */
-   public void destroy()
+   public synchronized void destroy()
    {
       if (!state.destroyAllowed())
       {



More information about the jbosscache-commits mailing list