Record Class FallbackRejectionHandler
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.network.scheduler.FallbackRejectionHandler
- Record Components:
fallbackExecutor- the fallback executor to start rejected starts in.
- All Implemented Interfaces:
RejectedExecutionHandler
record FallbackRejectionHandler(@NonNull ThreadPoolExecutor fallbackExecutor)
extends Record
implements RejectedExecutionHandler
A rejected execution handler that starts the rejected task in the provided fallback executor.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull ThreadPoolExecutorThe field for thefallbackExecutorrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionFallbackRejectionHandler(@NonNull ThreadPoolExecutor fallbackExecutor) Creates an instance of aFallbackRejectionHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thefallbackExecutorrecord component.final inthashCode()Returns a hash code value for this object.voidrejectedExecution(@NonNull Runnable task, @NonNull ThreadPoolExecutor rejectingExecutor) Schedules the given rejected task in the fallback executor.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
fallbackExecutor
The field for thefallbackExecutorrecord component.
-
-
Constructor Details
-
FallbackRejectionHandler
FallbackRejectionHandler(@NonNull @NonNull ThreadPoolExecutor fallbackExecutor) Creates an instance of aFallbackRejectionHandlerrecord class.- Parameters:
fallbackExecutor- the value for thefallbackExecutorrecord component
-
-
Method Details
-
rejectedExecution
public void rejectedExecution(@NonNull @NonNull Runnable task, @NonNull @NonNull ThreadPoolExecutor rejectingExecutor) Schedules the given rejected task in the fallback executor.- Specified by:
rejectedExecutionin interfaceRejectedExecutionHandler- Parameters:
task- the task requested to be executed.rejectingExecutor- the executor that failed to schedule the task.- Throws:
NullPointerException- if the given task or rejecting executor is null.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
fallbackExecutor
Returns the value of thefallbackExecutorrecord component.- Returns:
- the value of the
fallbackExecutorrecord component
-