The WHIP App module defines classes used by applications to become WHIP-aware. The most important of these are the org.whipplugin.app.AppService class, and the org.whipplugin.app.ArtefactReceiver interface.
The application should define a component that implements the ArtefactReceiver interface. This interface defines two methods:
/**
* called when something of interest arrives at a local Whippet
*
* @param key the key the bundle is mapped to locally
* @param bundle the bundle
*/
public void artefactArrived(String key, DataBundle bundle);
/**
* a name for this receiver.
*
* @return the name of the ArtefactReceiver
*/
public String getName();
The value returned from the getName() method, maps the listener to the application. Therefore it must match the value used in the whip.properties (user-application-data-directory/Whip/whip.properties) file. It allows WHIP to map from the statically defined mapping to a local HTTP Whippet running under that name.
The artefactArrived(String key, DataBundle bundle) method is called when a bundle 'arrives' at the doorstep of the application. The key is a key by which the bundle is mapped locally, while the DAtaBundle is the bundle itself.
A org.whipplugin.app.ArtefactReceiver is attached to a org.whipplugin.app.AppService object. This class provides the interface to WHIP for the application. It is this class that calls the artefactArrived method. It also provides the means for publishing bundles.