org.dxc.api
Class DxcCallback

Object
  extended by org.dxc.api.DxcCallback

public abstract class DxcCallback
extends Object

The abstract definition of the DcxData callback class. This abstract class forms the base class for the DXC data callback. Users must extend this abstract class to give their own callback handler, and register the class with a DxcConnector via a ConnectorFactory. Only one callback can be registered per connector, but the same callback can be registered with different connectors. When new data is received by a connector, the handler function will be called in the context of a new thread. The DxcConnector stores a reference to the instance of the callback class; users are responsible for ensuring that the instance is not destroyed before the connector stops receiving data.


Constructor Summary
DxcCallback()
           
 
Method Summary
 void onDataReceived(DxcData data)
          Synchronized callback method.
abstract  void processData(DxcData data)
          Method to be called when data is received.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DxcCallback

public DxcCallback()
Method Detail

onDataReceived

public void onDataReceived(DxcData data)
Synchronized callback method. Do not override this method unless you know what you're doing.

Parameters:
data - the message to be processed by the processData function

processData

public abstract void processData(DxcData data)
Method to be called when data is received. Implement this method to receive DxcData messages. Each message must be downcast into its specific type.

Parameters:
data - the message to be processed by the callback function