org.ros.node
Class AbstractNodeMain

java.lang.Object
  extended by org.ros.node.AbstractNodeMain
All Implemented Interfaces:
NodeListener, NodeMain
Direct Known Subclasses:
Client, Listener, Server, Talker

public abstract class AbstractNodeMain
extends java.lang.Object
implements NodeMain

A NodeMain which provides empty defaults for all signals.


Constructor Summary
AbstractNodeMain()
           
 
Method Summary
 void onError(Node node, java.lang.Throwable throwable)
          Called when the Node experiences an unrecoverable error.
 void onShutdown(Node node)
          Called when the ConnectedNode has started shutting down.
 void onShutdownComplete(Node node)
          Called when the Node has shut down.
 void onStart(ConnectedNode connectedNode)
          Called when the Node has started and successfully connected to the master.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ros.node.NodeMain
getDefaultNodeName
 

Constructor Detail

AbstractNodeMain

public AbstractNodeMain()
Method Detail

onStart

public void onStart(ConnectedNode connectedNode)
Description copied from interface: NodeListener
Called when the Node has started and successfully connected to the master.

Specified by:
onStart in interface NodeListener
Parameters:
connectedNode - the ConnectedNode that has been started

onShutdown

public void onShutdown(Node node)
Description copied from interface: NodeListener
Called when the ConnectedNode has started shutting down. Shutdown will be delayed, although not indefinitely, until all NodeListeners have returned from this method.

Since this method can potentially delay ConnectedNode shutdown, it is preferred to use NodeListener.onShutdownComplete(Node) when ConnectedNode resources are not required during the method call.

Specified by:
onShutdown in interface NodeListener
Parameters:
node - the Node that has started shutting down

onShutdownComplete

public void onShutdownComplete(Node node)
Description copied from interface: NodeListener
Called when the Node has shut down.

Specified by:
onShutdownComplete in interface NodeListener
Parameters:
node - the Node that has shut down

onError

public void onError(Node node,
                    java.lang.Throwable throwable)
Description copied from interface: NodeListener
Called when the Node experiences an unrecoverable error.

Specified by:
onError in interface NodeListener
Parameters:
node - the Node that experienced the error
throwable - the Throwable describing the error condition