public class DisconnectBehavior extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DisconnectBehavior.Action
The action to trigger to close a resource.
|
| Modifier and Type | Method and Description |
|---|---|
DisconnectBehavior.Action |
getAction()
Returns the action to perform while closing a resource.
|
Throwable |
getCause()
Returns the cause that triggered this close intent.
|
static DisconnectBehavior |
retry(Throwable cause)
Create a
DisconnectBehavior that instructs a client to retry in a graceful manner, with an optional cause. |
static DisconnectBehavior |
retryAbruptly(Throwable cause)
Create a
DisconnectBehavior that instructs a client to retry abruptly, with an optional cause. |
static DisconnectBehavior |
stop(Throwable cause)
Create a
DisconnectBehavior that instructs a client to stop in a graceful manner, with an optional cause. |
static DisconnectBehavior |
stopAbruptly(Throwable cause)
Create a
DisconnectBehavior that instructs a client to stop abruptly, with an optional cause. |
String |
toString() |
public static DisconnectBehavior retry(@Nullable Throwable cause)
DisconnectBehavior that instructs a client to retry in a graceful manner, with an optional cause.cause - optionally, a Throwable that triggered this close intentDisconnectBehavior that will gracefully attempt to retrypublic static DisconnectBehavior stop(@Nullable Throwable cause)
DisconnectBehavior that instructs a client to stop in a graceful manner, with an optional cause.cause - optionally, a Throwable that triggered this close intentDisconnectBehavior that will gracefully stop and release resourcespublic static DisconnectBehavior retryAbruptly(@Nullable Throwable cause)
DisconnectBehavior that instructs a client to retry abruptly, with an optional cause.cause - optionally, a Throwable that triggered this close intentDisconnectBehavior that will abruptly close before attempting to retrypublic static DisconnectBehavior stopAbruptly(@Nullable Throwable cause)
DisconnectBehavior that instructs a client to stop abruptly, with an optional cause.cause - optionally, a Throwable that triggered this close intentDisconnectBehavior that will abruptly stop and release resourcespublic DisconnectBehavior.Action getAction()
DisconnectBehavior.Action to perform upon closing@Nullable public Throwable getCause()
Throwable representing the cause that triggers an action