The way it works is that in the init() or any other method in the jiplet, you must initialize your connection to the external entity and create a listener for external event. For example, If your jiplet wants to receive a message from a UDP socket, you should initialize the open the socket connection and create a thread from where you can listen to the socket. When a message arrives, your listener must call the org.cafesip.jiplet.JipletContext.sendSignal() message to pass on the message to the jiplet.
The jiplet container allocates a thread from the thread pool and calls the processSignal() method of the jiplet to deliver the message. The jiplet has access to the scoped variables and can also forward the event from one jiplet to another using standard mechanisms laid out by the jiplet container. @author Amit Chatterjee
|
|