Package org.ros.node
Class DefaultNodeMainExecutor
java.lang.Object
org.ros.node.DefaultNodeMainExecutor
- All Implemented Interfaces:
NodeMainExecutor
Executes
NodeMains in separate threads.- Author:
- damonkohler@google.com (Damon Kohler)
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(NodeMain nodeMain, NodeConfiguration nodeConfiguration) Executes the suppliedNodeMainusing the suppliedNodeConfiguration.voidexecute(NodeMain nodeMain, NodeConfiguration nodeConfiguration, Collection<NodeListener> nodeListeners) Executes the suppliedNodeMainusing the suppliedNodeConfiguration.static NodeMainExecutorstatic NodeMainExecutornewDefault(ScheduledExecutorService executorService) voidshutdown()Shutdown all startedNodes.voidshutdownNodeMain(NodeMain nodeMain) Shuts down the suppliedNodeMain(i.e.
-
Method Details
-
newDefault
- Returns:
- an instance of
DefaultNodeMainExecutorthat uses aScheduledExecutorServicethat is suitable for both executing tasks immediately and scheduling tasks to execute in the future
-
newDefault
- Returns:
- an instance of
DefaultNodeMainExecutorthat uses the suppliedExecutorService
-
getScheduledExecutorService
- Specified by:
getScheduledExecutorServicein interfaceNodeMainExecutor- Returns:
- the
ScheduledExecutorServicethat thisNodeMainExecutoruses
-
execute
public void execute(NodeMain nodeMain, NodeConfiguration nodeConfiguration, Collection<NodeListener> nodeListeners) Description copied from interface:NodeMainExecutorExecutes the suppliedNodeMainusing the suppliedNodeConfiguration.- Specified by:
executein interfaceNodeMainExecutor- Parameters:
nodeMain- theNodeMainto executenodeConfiguration- theNodeConfigurationthat will be used to create theNodenodeListeners- aCollectionofNodeListeners to be added to theNodebefore it starts, can benull
-
execute
Description copied from interface:NodeMainExecutorExecutes the suppliedNodeMainusing the suppliedNodeConfiguration.- Specified by:
executein interfaceNodeMainExecutor- Parameters:
nodeMain- theNodeMainto executenodeConfiguration- theNodeConfigurationthat will be used to create theNode
-
shutdownNodeMain
Description copied from interface:NodeMainExecutorShuts down the suppliedNodeMain(i.e.NodeListener.onShutdown(Node)will be called). This does not necessarily shut down theNodethat is associated with theNodeMain.This has no effect if the
NodeMainhas not started.- Specified by:
shutdownNodeMainin interfaceNodeMainExecutor- Parameters:
nodeMain- theNodeMainto shutdown
-
shutdown
public void shutdown()Description copied from interface:NodeMainExecutorShutdown all startedNodes. This does not shut down the suppliedExecutorService.- Specified by:
shutdownin interfaceNodeMainExecutor
-