Class ShutdownCommand
- java.lang.Object
-
- org.apache.hc.core5.http.nio.command.ShutdownCommand
-
- All Implemented Interfaces:
Cancellable
,Command
public final class ShutdownCommand extends java.lang.Object implements Command
Shutdown command. Two shutdown modes are supported:CloseMode.GRACEFUL
andCloseMode.IMMEDIATE
. The exact implementation of both modes is protocol or handler specific.- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.hc.core5.reactor.Command
Command.Priority
-
-
Field Summary
Fields Modifier and Type Field Description static ShutdownCommand
GRACEFUL
static Callback<IOSession>
GRACEFUL_IMMEDIATE_CALLBACK
static Callback<IOSession>
GRACEFUL_NORMAL_CALLBACK
static ShutdownCommand
IMMEDIATE
private CloseMode
type
-
Constructor Summary
Constructors Constructor Description ShutdownCommand(CloseMode type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
Cancels the ongoing operation or process.private static Callback<IOSession>
createIOSessionCallback(Command.Priority priority)
CloseMode
getType()
java.lang.String
toString()
-
-
-
Field Detail
-
GRACEFUL
public static final ShutdownCommand GRACEFUL
-
IMMEDIATE
public static final ShutdownCommand IMMEDIATE
-
type
private final CloseMode type
-
-
Constructor Detail
-
ShutdownCommand
public ShutdownCommand(CloseMode type)
-
-
Method Detail
-
createIOSessionCallback
private static Callback<IOSession> createIOSessionCallback(Command.Priority priority)
-
getType
public CloseMode getType()
-
cancel
public boolean cancel()
Description copied from interface:Cancellable
Cancels the ongoing operation or process.- Specified by:
cancel
in interfaceCancellable
- Returns:
true
if the operation or process has been cancelled as a result of this method call orfalse
if it has already been cancelled or not started.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-