directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r595814 - /directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
Date Fri, 16 Nov 2007 20:35:59 GMT
Author: seelmann
Date: Fri Nov 16 12:35:58 2007
New Revision: 595814

URL: http://svn.apache.org/viewvc?rev=595814&view=rev
Log:
Performance improvement

Modified:
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java

Modified: directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java?rev=595814&r1=595813&r2=595814&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
Fri Nov 16 12:35:58 2007
@@ -57,6 +57,9 @@
     /** The current input */
     private ModificationLogsViewInput input;
 
+    /** The last refresh timestamp. */
+    private long lastRefreshTimestamp;
+
     /** Listener that listens for selections of connections */
     private INullSelectionListener connectionSelectionListener = new INullSelectionListener()
     {
@@ -175,10 +178,16 @@
      */
     public void entryUpdated( EntryModificationEvent event )
     {
-        if ( !( event instanceof AttributesInitializedEvent ) && !( event instanceof
ChildrenInitializedEvent ) )
+        // performance optimization: refresh only once per second
+        long now = System.currentTimeMillis();
+        if ( lastRefreshTimestamp + 1000 < now )
         {
-            refreshInput();
-            scrollToNewest();
+            if ( !( event instanceof AttributesInitializedEvent ) && !( event instanceof
ChildrenInitializedEvent ) )
+            {
+                refreshInput();
+                scrollToNewest();
+                lastRefreshTimestamp = now;
+            }
         }
     }
 
@@ -209,10 +218,10 @@
         catch ( Exception e )
         {
         }
-
     }
-    
-	/**
+
+
+    /**
      * Clears the input and deletes the logfiles for it
      * 
      */



Mime
View raw message