JSR-043: JTAPI-1.4

javax.telephony.media.messaging
Interface NamedServiceListener

All Superinterfaces:
java.util.EventListener, MediaConstants, MediaListener, MessageConstants
All Known Implementing Classes:
NamedServiceListenerAdapter

public interface NamedServiceListener
extends MediaListener, MessageConstants

Listener for non-tranactional events from a NamedService.

A NamedServiceListener must must be supplied to openNamedService().

A NamedService on either end of a Messaging connection may receive Request or Event messages from the other end. Those messages are delivered to this Listener.

Service specific information can be accessed from the Dictionary returned from event.getPayload().

Since:
JTAPI-1.4

Fields inherited from interface javax.telephony.media.messaging.MessageConstants
e_NotFound, e_NotSupported, ev_Close, ev_OpenNamedService, ev_RegisterService, ev_ServiceClosed, ev_ServiceOpened, ev_UnregisterService, k_Error, k_EventData, k_Payload, k_Qualifier, k_ServiceName, k_Status, k_SubError, v_Null
 
Fields inherited from interface javax.telephony.media.MediaConstants
e_OK, q_Duration, q_Standard, q_Stop
 
Method Summary
 void onServiceClosed(ServiceEvent event)
          Indicates the service connection has been closed.
 void onServiceEvent(ServiceEvent event)
          a Non-Transactional Event has arrived.
 void onServiceOpened(ServiceEvent event)
          Indicates a NamedService connection has been opened.
 void onServiceRequest(ServiceRequestEvent event)
          a Transactional Service Request has arrived.
 

Method Detail

onServiceRequest

public void onServiceRequest(ServiceRequestEvent event)
a Transactional Service Request has arrived.

Note: if a ServiceRequestEvent is received, event.reply(...) must be invoked at some point. Failure to reply may confuse or break the process that sent the request.

See Also:
ServiceRequestEvent.reply(javax.telephony.media.Symbol, javax.telephony.media.Symbol, int, boolean, java.util.Dictionary)

onServiceEvent

public void onServiceEvent(ServiceEvent event)
a Non-Transactional Event has arrived.

onServiceOpened

public void onServiceOpened(ServiceEvent event)
Indicates a NamedService connection has been opened. EventID = ev_ServiceOpened.

The application can get a NamedService object representing this connection via event.getNamedService()

Note: other listeners can be added to the NamedService and the initial listener can be removed. For example,

event.getNamedService().addListener(newListener)
should direct all subsequent events to the newListener.

onServiceClosed

public void onServiceClosed(ServiceEvent event)
Indicates the service connection has been closed. EventID = ev_ServiceClosed.

Sent to the end that was still open. On reciept, the associated NamedService is closed.


JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org