Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference

Calling Order Dependencies

When you are constructing programs, there is a calling order for the MTA SDK routines that must be observed; some routines must be called before others.

Figure 4–1 visually depicts the calling order dependency of the message dequeue routines. To the right of each routine name appears a horizontal line segment, possibly broken across a column, for example, mtaDequeueRecipientNext(). Routines for which two horizontal line segments, one atop the other, appear are required routines; that is, routines that must be called in order to successfully enqueue a message. The required routines are mtaInit(), mtaDequeueStart(), mtaDequeueRecipientNext(), and mtaDqueueMessageFinish().

To determine at which point a routine may be called, start in the leftmost column and work towards the rightmost column. Any routine whose line segment lies in the first (leftmost) column may be called first. Any routine whose line segment falls in the second column may next be called, after which any routine whose line segment falls in the third column may be called, and so forth. When more than one routine appears in the same column, any or all of those routines may be called in any order. Progression from left to right across the columns is mandated by the need to call the required routines.

After calling mtaDequeueRewind(), the read point into the underlying queued message file is reset to the start of the message’s outermost header; that is, you’re back in the third column.

Figure 4–1 Calling Order Dependency for Message Dequeue Routines

Calling order dependency for message dequeue routines. mtaInit,
mtaDequeueStart, mtaDequeueRecipientNext, and mtaDequeueMessageFinish are required.