public interface SparkAppHandle
Provides runtime information about the underlying Spark application, and actions to control it.
Modifier and Type | Interface and Description |
---|---|
static interface |
SparkAppHandle.Listener
Listener for updates to a handle's state.
|
static class |
SparkAppHandle.State
Represents the application's state.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(SparkAppHandle.Listener l)
Adds a listener to be notified of changes to the handle's information.
|
void |
disconnect()
Disconnects the handle from the application, without stopping it.
|
java.lang.String |
getAppId()
Returns the application ID, or
null if not yet known. |
SparkAppHandle.State |
getState()
Returns the current application state.
|
void |
kill()
Tries to kill the underlying application.
|
void |
stop()
Asks the application to stop.
|
void addListener(SparkAppHandle.Listener l)
l
- Listener to add.SparkAppHandle.State getState()
java.lang.String getAppId()
null
if not yet known.void stop()
void kill()
disconnect()
. This will not send
a stop()
message to the application, so it's recommended that users first try to
stop the application cleanly and only resort to this method if that fails.
Note that if the application is running as a child process, this method fail to kill the process when using Java 7. This may happen if, for example, the application is deadlocked.
void disconnect()