You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by le...@apache.org on 2004/07/28 17:38:13 UTC

svn commit: rev 30845 - excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager

Author: leif
Date: Wed Jul 28 08:38:12 2004
New Revision: 30845

Modified:
   excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentProxy.java
   excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentableProxy.java
Log:
Fix a problem where changes to the registered flag of instrumentable and instrument proxies was not causing the state version to be incremented.  This was causing problems with the optimization of the client as it never recognized that the object became registered.

Modified: excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentProxy.java
==============================================================================
--- excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentProxy.java	(original)
+++ excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentProxy.java	Wed Jul 28 08:38:12 2004
@@ -350,7 +350,11 @@
      */
     void setRegistered()
     {
-        m_registered = true;
+        if ( !m_registered )
+        {
+            m_registered = true;
+            stateChanged();
+        }
     }
     
     /**
@@ -375,7 +379,16 @@
      */
     void setDescription( String description )
     {
-        m_description = description;
+        String oldDescription = m_description; // thread safety.
+        if ( ( oldDescription == description ) || ( ( description != null ) && description.equals( oldDescription ) ) )
+        {
+            // No change
+        }
+        else
+        {
+            m_description = description;
+            stateChanged();
+        }
     }
     
     /**

Modified: excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentableProxy.java
==============================================================================
--- excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentableProxy.java	(original)
+++ excalibur/trunk/containerkit/instrument/mgr-impl/src/java/org/apache/excalibur/instrument/manager/InstrumentableProxy.java	Wed Jul 28 08:38:12 2004
@@ -245,7 +245,11 @@
      */
     void setRegistered()
     {
-        m_registered = true;
+        if ( !m_registered )
+        {
+            m_registered = true;
+            stateChanged();
+        }
     }
     
     /**
@@ -270,7 +274,16 @@
      */
     void setDescription( String description )
     {
-        m_description = description;
+        String oldDescription = m_description; // thread safety.
+        if ( ( oldDescription == description ) || ( ( description != null ) && description.equals( oldDescription ) ) )
+        {
+            // No change
+        }
+        else
+        {
+            m_description = description;
+            stateChanged();
+        }
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org