Targets

Letter box, van Gogh

The class that programmers work with most often is the Target class. Targets are lightweight Java Objects that send and receive messages.

Registration

To make this possible, they are registered in the Target Registry. Upon successful registration, a target receives an ID, the target ID (TID for short). It is possible to give constant TIDs to targets during registration, but usually a random ID generated by the target registry is sufficient.

Concurrency

All messages are sent asynchronously. Targets are bound to a thread during registration, which is part of a so-called namespace. All messages, which they receive in the lifetime, they will always receive in this thread. Messages are never passed to the target at the same time, but they are always processed one after the other. This avoids problems with concurrency. If several targets are to exchange data together, they should be registered in the same namespace thread.

Message handlers

Many targets process a whole range of messages. So that the messages do not have to be processed cumbersomely in a long method, there is a MessageHandler registry in each target. Here, methods can be mapped to messages, which greatly simplifies and unifies the structure of targets.