CRecordStartTarget
The first message sent to a Target after registering with the TargetRegistry.
Description
The first message a target will get (asynchronously). The new target address. The message queue ID. The target registry the target was registered in. The message sender needed to send messages.
Example of use of the class CRecordStartTarget (after generating)
To catch this message, we need a message handler. We add it in the constructor of the message handler registry.
// constructor:
addMessageHandler(CRecordStartTarget.ID,
this::asyncStartTarget);
The message is handled in the local method asyncStartTarget:
private boolean asyncStartTarget(@NotNull final CEnvelope aEnvelope, @NotNull final CRecord aRecord) { // In the thread of the namespace where the target was registered // do something... aEnvelope.setResultSuccess(); return true; }
Well, every time a target is deregistered in our node, we get this message.