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()
TwillRunnable
configure
in interface TwillRunnable
TwillRunnableSpecification
built by TwillRunnableSpecification.Builder
.public void initialize(TwillContext context)
TwillRunnable
initialize
in interface TwillRunnable
context
- Contains information about the runtime context.public void handleCommand(Command command) throws Exception
TwillRunnable
Exception
should be thrown.handleCommand
in interface TwillRunnable
command
- Contains details of the command.Exception
public void stop()
TwillRunnable
stop
in interface TwillRunnable
public void destroy()
TwillRunnable
Runnable.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 TwillRunnable
protected TwillContext getContext()
Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.