Usage patterns
Usage patterns that the Java Driver user can expect:
- A piece of Java code is invoked every time this thread receives a message, that is, from another system thread. The return value of the Java code is turned into a list of reply messages back into the system engine of this thread. The thick arrow indicates the possibility of zero or more messages; the thin arrow means one message. The FromCloverleafLink class should be extended to implement this pattern.
- This thread contains any
number of named queues.
- Messages coming from other system threads are placed into these named queues.
- A piece of Java code can then issue various commands (queries) to access the messages in the named queues and manage the queues. Examples include: retrieving metadata about the messages, retrieving actual messages, deleting messages, and others.
- The
CloverleafLinkAbstract
orToCloverleafLink
class should be extended to implement this pattern.
- A piece of Java code can create one or more messages, send them into the thread's system engine, and expect a reply message from the engine.
The processing of the reply can take two forms:
- Await reply: The Java code that submits the messages into the engine waits for the reply to come back and process it. Extend the ToCloverleafLink class to implement this pattern.
- Callback: A callback is defined to
process the reply when it comes back from the engine. The Java code that submits
the message can do other tasks. Extend the
ToCloverleafLink
class to implement this pattern.Or, the Java code can not process any reply. The
CloverleafLinkAbstract
orToCloverleafLink
class should be extended to implement this pattern.Patterns involving Java initiating messages (3.a, 3.b) or queries (2.b) require a Java thread to be started. This sends messages into the engine based on some stimulus, such as starting a web server that sends messages into the engine to answer requests. Patterns that react to requests from the engine can be a Java library that is passively invoked.