public class DefaultNodeMainExecutor extends java.lang.Object implements NodeMainExecutor
NodeMains in separate threads.| Modifier and Type | Method and Description |
|---|---|
void |
execute(NodeMain nodeMain,
NodeConfiguration nodeConfiguration)
Executes the supplied
NodeMain using the supplied
NodeConfiguration. |
void |
execute(NodeMain nodeMain,
NodeConfiguration nodeConfiguration,
java.util.Collection<NodeListener> nodeListeners)
Executes the supplied
NodeMain using the supplied
NodeConfiguration. |
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutorService() |
static NodeMainExecutor |
newDefault() |
static NodeMainExecutor |
newDefault(java.util.concurrent.ScheduledExecutorService executorService) |
void |
shutdown()
Shutdown all started
Nodes. |
void |
shutdownNodeMain(NodeMain nodeMain)
Shuts down the supplied
NodeMain (i.e. |
public static NodeMainExecutor newDefault()
DefaultNodeMainExecutor that uses a
ScheduledExecutorService that is suitable for both
executing tasks immediately and scheduling tasks to execute in the
futurepublic static NodeMainExecutor newDefault(java.util.concurrent.ScheduledExecutorService executorService)
DefaultNodeMainExecutor that uses the
supplied ExecutorServicepublic java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
getScheduledExecutorService in interface NodeMainExecutorScheduledExecutorService that this
NodeMainExecutor usespublic void execute(NodeMain nodeMain, NodeConfiguration nodeConfiguration, java.util.Collection<NodeListener> nodeListeners)
NodeMainExecutorNodeMain using the supplied
NodeConfiguration.execute in interface NodeMainExecutornodeMain - the NodeMain to executenodeConfiguration - the NodeConfiguration that will be used to create the
NodenodeListeners - a Collection of NodeListeners to be added to the
Node before it starts, can be nullpublic void execute(NodeMain nodeMain, NodeConfiguration nodeConfiguration)
NodeMainExecutorNodeMain using the supplied
NodeConfiguration.execute in interface NodeMainExecutornodeMain - the NodeMain to executenodeConfiguration - the NodeConfiguration that will be used to create the
Nodepublic void shutdownNodeMain(NodeMain nodeMain)
NodeMainExecutorNodeMain (i.e.
NodeListener.onShutdown(Node) will be called). This does not
necessarily shut down the Node that is associated with the
NodeMain.
This has no effect if the NodeMain has not started.
shutdownNodeMain in interface NodeMainExecutornodeMain - the NodeMain to shutdownpublic void shutdown()
NodeMainExecutorNodes. This does not shut down the supplied
ExecutorService.shutdown in interface NodeMainExecutor