Class TimeGuard.TimeData

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    TimeGuard

    public static final class TimeGuard.TimeData
    extends java.lang.Object
    implements java.io.Serializable
    Data container for time watching action.
    Since:
    1.0
    See Also:
    Serialized Form
    • Field Detail

      • stackDepth

        private final int stackDepth
        Contains detected stack depth for creation.
        Since:
        1.0
      • maxAllowedDelayInMilliseconds

        private final long maxAllowedDelayInMilliseconds
        Max allowed time delay in milliseconds.
        Since:
        1.0
      • creationTimeInMilliseconds

        private final long creationTimeInMilliseconds
        The Creation time of the data container in milliseconds.
        Since:
        1.0
      • alertMessage

        private final java.lang.String alertMessage
        The Alert message to be provided into log or somewhere else, for time points it is ID.
        Since:
        1.0
    • Constructor Detail

      • TimeData

        @Weight(LIGHT)
        public TimeData​(@Constraint("X>1")
                        int stackDepth,
                        java.lang.String alertMessage,
                        long maxAllowedDelayInMilliseconds,
                        TimeGuard.TimeAlertListener violationListener)
        The Constructor
        Parameters:
        stackDepth - stack depth
        alertMessage - alert message for time violation
        maxAllowedDelayInMilliseconds - max allowed time gap in milliseconds
        violationListener - listener for the violation alert
        Since:
        1.0
    • Method Detail

      • getAlertListener

        public TimeGuard.TimeAlertListener getAlertListener()
        Get alert listener if provided
        Returns:
        the provided alert listener
        Since:
        1.0
      • getAlertMessage

        public java.lang.String getAlertMessage()
        Get the alert message. For time points it is ID.
        Returns:
        defined alert message.
        Since:
        1.0
      • getDetectedStackDepth

        public int getDetectedStackDepth()
        Get the detected stack depth during the container creation.
        Returns:
        the detected stack depth
        Since:
        1.0
      • getCreationTimeInMilliseconds

        public long getCreationTimeInMilliseconds()
        Get the creation time of the container.
        Returns:
        the creation time in milliseconds
        Since:
        1.0
      • getMaxAllowedDelayInMilliseconds

        public long getMaxAllowedDelayInMilliseconds()
        Get defined max allowed time delay in milliseconds.
        Returns:
        the max allowed time delay in milliseconds
        Since:
        1.0
      • isTimePoint

        public boolean isTimePoint()
        Check that the object represents a named time point.
        Returns:
        true if the object represents a time point created for statistics.