Class RdfCanonTimeTicker

  • All Implemented Interfaces:
    RdfCanonTicker

    public final class RdfCanonTimeTicker
    extends java.lang.Object
    implements RdfCanonTicker
    An implementation of RdfCanonTicker that monitors elapsed time in milliseconds and interrupts the RDF canonicalization process if a specified maximum duration is exceeded.

    This ticker uses System.currentTimeMillis() to measure elapsed time. It throws an IllegalStateException if the canonicalization process runs longer than the allowed time limit.

    Example usage:

    
     RdfCanonTicker ticker = new ElapsedTimeTicker(5000); // 5 seconds timeout
     
    See Also:
    RdfCanonTicker
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long maxDurationMillis
      Maximum allowed execution time in milliseconds.
      private long startTimeMillis
      Start time in milliseconds, initialized on the first tick() call.
    • Constructor Summary

      Constructors 
      Constructor Description
      RdfCanonTimeTicker​(long maxDurationMillis)
      Creates a new ElapsedTimeTicker with a specified timeout duration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void tick()
      Invoked periodically during RDF canonicalization to check if the maximum execution time has been exceeded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxDurationMillis

        private final long maxDurationMillis
        Maximum allowed execution time in milliseconds.
      • startTimeMillis

        private long startTimeMillis
        Start time in milliseconds, initialized on the first tick() call.
    • Constructor Detail

      • RdfCanonTimeTicker

        public RdfCanonTimeTicker​(long maxDurationMillis)
        Creates a new ElapsedTimeTicker with a specified timeout duration.
        Parameters:
        maxDurationMillis - the maximum allowed execution time in milliseconds; must be positive
        Throws:
        java.lang.IllegalArgumentException - if maxDurationMillis is zero or negative
    • Method Detail

      • tick

        public void tick()
                  throws java.lang.IllegalStateException
        Invoked periodically during RDF canonicalization to check if the maximum execution time has been exceeded.
        Specified by:
        tick in interface RdfCanonTicker
        Throws:
        java.lang.IllegalStateException - if the allowed time limit has been reached