I am not as familiar with JTAPI as DMCC but my understanding is that JTAPI is very much Object Orientated. It abstracts away things like monitorCrossRefID.
When an application receives an event, it is often interested in which object the event is for, as I think you are here. TSAPI does this by using the monitorCrossRefID to map between the station/VDN and the event.
With JTAPI, you start a monitor using something like Terminal.addCallListener(TerminalConnectionListener mylistener). To process the events, you implement TerminalConnectionListener with, say MyTerminalConnectionListener. If you create a new MyTerminalConnectionListener object for each Terminal that you monitor, the MyTerminalConnectionListener object that receives the event can be mapped to the associated Terminal.
For example, you can save the Terminal as a member variable in the MyTerminalConnectionListener object or you can manage a global Hashmap that maps [TerminalConnectionListener -> Terminal].
If you look at the AgentView sample application on Devconnect, you will see something similar done (Hashmap). AgentView only uses this to stop the correct listener but there is no reason not to use the same mechanism to map events to monitored terminal.
Martin
|