public abstract class AbstractTwillRunnable extends Object implements TwillRunnable
TwillRunnable.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTwillRunnable() |
protected |
AbstractTwillRunnable(Map<String,String> args) |
| Modifier and Type | Method and Description |
|---|---|
TwillRunnableSpecification |
configure()
Called at submission time.
|
void |
destroy()
Called when the
Runnable.run() completed. |
protected String |
getArgument(String key) |
protected Map<String,String> |
getArguments() |
protected TwillContext |
getContext() |
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.
|
public TwillRunnableSpecification configure()
TwillRunnableconfigure in interface TwillRunnableTwillRunnableSpecification built by TwillRunnableSpecification.Builder.public void initialize(TwillContext context)
TwillRunnableinitialize in interface TwillRunnablecontext - Contains information about the runtime context.public void handleCommand(Command command) throws Exception
TwillRunnableException should be thrown.handleCommand in interface TwillRunnablecommand - Contains details of the command.Exceptionpublic void stop()
TwillRunnablestop in interface TwillRunnablepublic void destroy()
TwillRunnableRunnable.run() completed. Useful for doing
resource cleanup. This method would only get called if the call to TwillRunnable.initialize(TwillContext) was
successful.destroy in interface TwillRunnableprotected TwillContext getContext()
Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.