JSR-043: JTAPI-1.4

javax.telephony.media.messaging
Class NamedServiceListenerAdapter

java.lang.Object
  |
  +--javax.telephony.media.messaging.NamedServiceListenerAdapter
All Implemented Interfaces:
java.util.EventListener, MediaConstants, MediaListener, MessageConstants, NamedServiceListener

public class NamedServiceListenerAdapter
extends java.lang.Object
implements NamedServiceListener

Minimal implementation of NamedServiceListener.

Note: the implementation of onServiceRequest() invokes reply on the given event, returning the error/exception e_NotSupported to the invoking application. To handle service requests, you must override this method. The Service Request protocol expects/demands that reply will be invoked on the given event.

The other methods of this implementation do nothing and simply return.

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
 
Constructor Summary
NamedServiceListenerAdapter()
           
 
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 Request has arrived.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedServiceListenerAdapter

public NamedServiceListenerAdapter()
Method Detail

onServiceRequest

public void onServiceRequest(ServiceRequestEvent event)
a Transactional 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.

Note: this Adapter by default sends a reply with an Exception, e_NotSupported, q_Standard, and a null payload.

Specified by:
onServiceRequest in interface NamedServiceListener
See Also:
ServiceRequestEvent.reply(javax.telephony.media.Symbol, javax.telephony.media.Symbol, int, boolean, java.util.Dictionary)

onServiceEvent

public void onServiceEvent(ServiceEvent event)
Description copied from interface: NamedServiceListener
a Non-Transactional Event has arrived.
Specified by:
onServiceEvent in interface NamedServiceListener

onServiceOpened

public void onServiceOpened(ServiceEvent event)
Description copied from interface: NamedServiceListener
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.
Specified by:
onServiceOpened in interface NamedServiceListener

onServiceClosed

public void onServiceClosed(ServiceEvent event)
Description copied from interface: NamedServiceListener
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.

Specified by:
onServiceClosed in interface NamedServiceListener

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org