public interface TwillRunnable extends Runnable
TwillRunnable interface should be implemented by any
class whose instances are intended to be executed in a Twill cluster.| Modifier and Type | Method and Description |
|---|---|
TwillRunnableSpecification |
configure()
Called at submission time.
|
void |
destroy()
Called when the
Runnable.run() completed. |
void |
handleCommand(Command command)
Called when a command is received.
|
void |
initialize(TwillContext context)
Called when the container process starts.
|
void |
stop()
Requests to stop the running service.
|
TwillRunnableSpecification configure()
TwillRunnableSpecification built by TwillRunnableSpecification.Builder.void initialize(TwillContext context)
context - Contains information about the runtime context.void handleCommand(Command command) throws Exception
Exception should be thrown.command - Contains details of the command.Exceptionvoid stop()
void destroy()
Runnable.run() completed. Useful for doing
resource cleanup. This method would only get called if the call to initialize(TwillContext) was
successful.Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.