public static class EmbeddedEngine.CompletionResult extends Object implements EmbeddedEngine.CompletionCallback
| Modifier and Type | Field and Description |
|---|---|
private CountDownLatch |
completed |
private EmbeddedEngine.CompletionCallback |
delegate |
private Throwable |
error |
private String |
message |
private boolean |
success |
| Constructor and Description |
|---|
CompletionResult() |
CompletionResult(EmbeddedEngine.CompletionCallback delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Causes the current thread to wait until the
completion occurs
or until the thread is interrupted. |
boolean |
await(long timeout,
TimeUnit unit)
Causes the current thread to wait until the
completion occurs,
unless the thread is interrupted, or the specified waiting time elapses. |
Throwable |
error()
Get the completion error, if there is one.
|
void |
handle(boolean success,
String message,
Throwable error)
Handle the completion of the embedded connector engine.
|
boolean |
hasCompleted()
Determine if the connector has completed.
|
boolean |
hasError()
Determine if there is a completion error.
|
String |
message()
Get the completion message.
|
boolean |
success()
Get whether the connector completed normally.
|
private final EmbeddedEngine.CompletionCallback delegate
private final CountDownLatch completed
private boolean success
private String message
private Throwable error
public CompletionResult()
public CompletionResult(EmbeddedEngine.CompletionCallback delegate)
public void handle(boolean success,
String message,
Throwable error)
EmbeddedEngine.CompletionCallbackhandle in interface EmbeddedEngine.CompletionCallbacksuccess - true if the connector completed normally, or false if the connector produced an error
that prevented startup or premature termination.message - the completion message; never nullerror - the error, or null if there was no exceptionpublic void await()
throws InterruptedException
completion occurs
or until the thread is interrupted.
This method returns immediately if the connector has completed already.
InterruptedException - if the current thread is interrupted while waitingpublic boolean await(long timeout,
TimeUnit unit)
throws InterruptedException
completion occurs,
unless the thread is interrupted, or the specified waiting time elapses.
This method returns immediately if the connector has completed already.
timeout - the maximum time to waitunit - the time unit of the timeout argumenttrue if the completion was received, or false if the waiting time elapsed before the completion
was received.InterruptedException - if the current thread is interrupted while waitingpublic boolean hasCompleted()
true if the connector has completed, or false if the connector is still running and this
callback has not yet been notifiedpublic boolean success()
true if the connector completed normally, or false if the connector produced an error that
prevented startup or premature termination (or the connector has not yet completed)public String message()
completedpublic Throwable error()
completedpublic boolean hasError()
true if there is a completion error, or false if there is no error or
the connector has not yet completedCopyright © 2020 JBoss by Red Hat. All rights reserved.