Package org.aoju.bus.core.io.timout
Class AssignTimeout
java.lang.Object
org.aoju.bus.core.io.timout.Timeout
org.aoju.bus.core.io.timout.AssignTimeout
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClears the deadline.Clears the timeout.longReturns the nano time when the deadline will be reached.deadlineNanoTime(long deadlineNanoTime) Sets the nano time when the deadline will be reached.final Timeoutdelegate()Timeoutinstance to which this instance is currently delegating.booleanReturns true if a deadline is enabled.final AssignTimeoutsetDelegate(Timeout delegate) voidThrows anInterruptedIOExceptionif the deadline has been reached or if the current thread has been interrupted.Wait at mosttimeouttime before aborting an operation.longReturns the timeout in nanoseconds, or0for no timeout.Methods inherited from class org.aoju.bus.core.io.timout.Timeout
deadline, waitUntilNotified
-
Constructor Details
-
AssignTimeout
-
-
Method Details
-
delegate
-
setDelegate
-
timeout
Description copied from class:TimeoutWait at mosttimeouttime before aborting an operation. Using a per-operation timeout means that as long as forward progress is being made, no sequence of operations will fail.If
timeout == 0, operations will run indefinitely. (Operating system timeouts may still apply.) -
timeoutNanos
public long timeoutNanos()Description copied from class:TimeoutReturns the timeout in nanoseconds, or0for no timeout.- Overrides:
timeoutNanosin classTimeout
-
hasDeadline
public boolean hasDeadline()Description copied from class:TimeoutReturns true if a deadline is enabled.- Overrides:
hasDeadlinein classTimeout
-
deadlineNanoTime
public long deadlineNanoTime()Description copied from class:TimeoutReturns the nano time when the deadline will be reached.- Overrides:
deadlineNanoTimein classTimeout
-
deadlineNanoTime
Description copied from class:TimeoutSets the nano time when the deadline will be reached. All operations must complete before this time. Use a deadline to set a maximum bound on the time spent on a sequence of operations.- Overrides:
deadlineNanoTimein classTimeout
-
clearTimeout
Description copied from class:TimeoutClears the timeout. Operating system timeouts may still apply.- Overrides:
clearTimeoutin classTimeout
-
clearDeadline
Description copied from class:TimeoutClears the deadline.- Overrides:
clearDeadlinein classTimeout
-
throwIfReached
Description copied from class:TimeoutThrows anInterruptedIOExceptionif the deadline has been reached or if the current thread has been interrupted. This method doesn't detect timeouts; that should be implemented to asynchronously abort an in-progress operation.- Overrides:
throwIfReachedin classTimeout- Throws:
IOException
-