You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2022/07/29 23:05:15 UTC

svn commit: r1903116 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java

Author: seanfinan
Date: Fri Jul 29 23:05:15 2022
New Revision: 1903116

URL: http://svn.apache.org/viewvc?rev=1903116&view=rev
Log:
Clean up PausableAE a little

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java?rev=1903116&r1=1903115&r2=1903116&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java (original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/inert/PausableAE.java Fri Jul 29 23:05:15 2022
@@ -16,7 +16,7 @@ import java.io.IOException;
  */
 @PipeBitInfo(
       name = "PausableAE",
-      description = "Does something.",
+      description = "Can be extended to add Pause capabilities to an Annotation Engine",
       role = PipeBitInfo.Role.ANNOTATOR
 )
 abstract public class PausableAE extends JCasAnnotator_ImplBase {
@@ -29,7 +29,7 @@ abstract public class PausableAE extends
          description = PAUSE_DESC,
          mandatory = false
    )
-   protected int _pause = 0;
+   private int _pause = 0;
 
    /**
     * {@inheritDoc}
@@ -44,16 +44,17 @@ abstract public class PausableAE extends
    }
 
    protected void pause( final Logger logger ) {
-      if ( _pause > 0 ) {
-         final long pause = _pause * 1000L;
-         if ( logger != null ) {
-            logger.info( "Pausing " + _pause + " seconds ..." );
-         }
-         try ( DotLogger dotter = new DotLogger() ) {
-            Thread.sleep( pause );
-         } catch ( IOException | InterruptedException multE ) {
-            // do nothing
-         }
+      if ( _pause <= 0 ) {
+         return;
+      }
+      final long pause = _pause * 1000L;
+      if ( logger != null ) {
+         logger.info( "Pausing " + _pause + " seconds ..." );
+      }
+      try ( DotLogger dotter = new DotLogger() ) {
+         Thread.sleep( pause );
+      } catch ( IOException | InterruptedException multE ) {
+         // do nothing
       }
    }