Author: seanahn
Date: Mon Jun  8 01:21:00 2009
New Revision: 782490

URL: http://svn.apache.org/viewvc?rev=782490&view=rev
Log:
Cron cleanup filter calculation refactored

Modified:
    
ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/cron/RuntimeDataCleanupRunnable.java

Modified: 
ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/cron/RuntimeDataCleanupRunnable.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/cron/RuntimeDataCleanupRunnable.java?rev=782490&r1=782489&r2=782490&view=diff
==============================================================================
--- 
ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/cron/RuntimeDataCleanupRunnable.java
 (original)
+++ 
ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/cron/RuntimeDataCleanupRunnable.java
 Mon Jun  8 01:21:00 2009
@@ -49,11 +49,25 @@
     }
     
     public void run() {
-        _log.info("CleanInstances.run().");
+        _log.info("CRON CLEAN.run().");
         try {
             for( String filter : _cleanupInfo.getFilters() ) {
-                if( filter != null && filter.trim().length() > 0 ) {
-                    _log.info("CleanInstances.run(" + filter + ")");
+                _log.info("CRON CLEAN.run(" + filter + ")");
+
+                if( _pid != null ) {
+                    filter += " pid=" + _pid;
+                } else if( _pidsToExclude != null ) {
+                    StringBuffer pids = new StringBuffer();
+                    for( QName pid : _pidsToExclude ) {
+                        if( pids.length() > 0 ) {
+                            pids.append("|");
+                        }
+                        pids.append(pid);
+                    }
+                    filter += " pid<>" + pids.toString();
+                }
+
+                if( filter.trim().length() > 0 ) {
                     long numberOfDeletedInstances = 0;
                     do {
                         numberOfDeletedInstances = cleanInstances(filter, 
_cleanupInfo.getCategories(), _transactionSize);
@@ -68,19 +82,6 @@
     }
     
     int cleanInstances(String filter, final Set<CLEANUP_CATEGORY> categories, 
int limit) {
-        if( _pid != null ) {
-            filter += " pid=" + _pid;
-        } else if( _pidsToExclude != null ) {
-            StringBuffer pids = new StringBuffer();
-            for( QName pid : _pidsToExclude ) {
-                if( pids.length() > 0 ) {
-                    pids.append("|");
-                }
-                pids.append(pid);
-            }
-            filter += " pid<>" + pids.toString();
-        }
-        
         _log.debug("CleanInstances using filter: " + filter + ", limit: " + 
limit);
         
         final InstanceFilter instanceFilter = new InstanceFilter(filter, "", 
limit);


Reply via email to