public abstract class Hooklet extends Object implements Comparable<Hooklet>
| Constructor and Description |
|---|
Hooklet() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(@NotNull Hooklet other) |
boolean |
equals(Object obj) |
int |
hashCode() |
protected Object |
identity()
Hooks are only called once but may be registered multiple times.
|
static Hooklet |
of(int priority,
Runnable hook)
Accepts callback and priority to produce shutdown hook object.
|
abstract void |
onShutdown()
The callback which will be invoked on shutdown.
|
abstract int |
priority()
Hooks with lesser priority will be called before hooks with greater priority.
|
public abstract void onShutdown()
public abstract int priority()
protected Object identity()
public static Hooklet of(int priority, Runnable hook)
identity().priority - See priority()hook - See onShutdown()PriorityHook.addAndGet(Hooklet)public int compareTo(@NotNull
@NotNull Hooklet other)
compareTo in interface Comparable<Hooklet>Copyright © 2022. All rights reserved.