This package was originally design to support HL7 messaging.
An application generates events as a result of some action by the user. These events are stored in persistent queues. These queues are processed by background threads that read the event from storage and perform an action such as sending an HL7 message, sending an email, etc.
Two predefined queues exist: {@link gov.va.med.term.access.maint.event.Queues#inBound inbound} and {@link gov.va.med.term.access.maint.event.Queues#outBound outbound}. These queues are used to handled inbound and outbound HL7 messages. However, other application specific queues can be created.
An event can be any java.io.Serializable object. The event can be stored in a queue using the following code:
Event event = new Event(myEventData); event.setQueue(Queue.obtainByName(myQueueName)); event.create();A {@link gov.va.med.term.access.maint.event.QueueProcessor queue processor} must be created for each queue. Two default queue processors, {@link gov.va.med.term.access.maint.event.factory.InBoundQueueProcessor inbound queue processor} and {@link gov.va.med.term.access.maint.event.factory.OutBoundQueueProcessor outbound queue processor}, have been created to process the inbound and outbound queues. These processors are specializations that merely provide a new namespace for defining configuration paramaters.
A queue processor reads one event at a time from persistent in FIFO order. It then looks for an {@link gov.va.med.term.access.maint.event.EventProcessor event processor} that can process the event. Event processors must be registered using the implementor registry. If one cannot be found, an exception is thrown.