Interface to handle any of the events that occur in HL7Connect. The different events may be differentiated either by their class or by their EventName property

Once loaded, the event handler will be kept loaded until all the contexts in which it is used are closed. (i.e. interfaces stopped, and/or kernel shut down).

Event handlers generally need to be thread safe - see discussion on the Start method

Properties


Methods

void Start(TEventHandlerThreadMode threadMode, HL7Connect.Services.Access services);
   Initialises the interface that will be handling events. Usually called when the kernel starts or when an interface starts. Start will only be called once for each instance - there will be a separate instance of the COM Interface for each event/Interface combination on HL7Connect.

The threadmode defines how the interface will be used in regard to threads. There is three possibilities:

  • etmSingleThread (0): the interface will only ever be used from one thread (Start, Execute and Stop are all called from the same thread)
  • etmLimitedThreading = (1): the interface will only ever be called by one thread at once, but it may not be the same thread
  • etmMultithread = (2): the interface may be used by multiple threads concurrently
Kernel start and stop are single threaded, as is the User Initiated Event. Interface start and Stop are limited multithread because start, stop and Execute occur in different threads. Events in outbound interfaces are limited multithread: start and stop are called on a different thread to the Execute method, but there is only a single thread servicing the outbound interface. Inbound threads may be actually be limited multi-thread (files, scripts) or fully multithreaded (HTTP, Web, XDR, etc) or it may depend on the configuration (TCP/IP - whether multiple clients are allowed), but all this depends on the configuration of the interface which may change over the lifecycle of the interface, so they are always stated to be fully multithreaded.

The rest of the server interfaces (IHL7ConnectServerMessageReceiverPlugin, etc) are effectively limited multithread.

Note that all of the interfaces are defined as fully multi-threaded to COM. Note also that when run test cases are run, threadmode is always single threaded.

void Execute(HL7Connect.Events.Base event_);
   Called when the event occurs, as configured in HL7Connect.

void Stop();
   Called when the interface or kernel is stopping as appropriate for the event type.


© Kestral Computing P/L 2000 - 2003. HL7Connect v2.00-063 generated on 30-Nov 2015.
Keywords: Start, Execute, Stop, HL7Connect.Kernel.EventHandler, EventHandler