Handling Flow Failures
An instance of FlowListener may be configured as a SipListener. Whenever the flow fails, the container invokes all configured FlowListeners. Applications may retrieve the flow and complete the necessary business logic, which typically includes sending the REGISTER message again.
Example 8-2 shows the FlowListener and FlowFailedEvent definitions.
Example 8-2 Flow Failure Handling
public interface FlowListener extends EventListener {
void flowFailed(FlowFailedEvent flowFailedEvent);
}
public class FlowFailedEvent extends EventObject {
public FlowFailedEvent(Flow flow) {
super(flow);
}
public Flow getFlow() {
return (Flow) super.getSource();
}
}