EventHandlerImpl<T> Class
- java.
lang. Object - com.
microsoft. cognitiveservices. speech. util. EventHandlerImpl<T>
- com.
Type Parameters
- T
public class EventHandlerImpl
Implements the binding between the Speech SDK core event handler and Java event handling.
Constructor Summary
Constructor | Description |
---|---|
EventHandlerImpl(AtomicInteger runCounter) |
Creates and initializes a new instance of the Event |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(EventHandler<T> handler)
Registers a new event handler with the associated event. |
void |
fireEvent(Object sender, T e)
Fires an event by calling sequentially all registered handlers. |
boolean |
isUpdateNotificationOnConnectedFired()
Checks if a client has subscribed to events. |
void |
removeEventListener(EventHandler<T> handler)
Unregisters the event handler from the associated event. |
void |
updateNotificationOnConnected(Runnable notifyConnectedOnce)
Updates the handler to be notified when the first client subscribes to the event. |
Methods inherited from java.lang.Object
Constructor Details
EventHandlerImpl
public EventHandlerImpl(AtomicInteger runCounter)
Creates and initializes a new instance of the EventHandlerImpl.
Parameters:
Method Details
addEventListener
public void addEventListener(EventHandler
Registers a new event handler with the associated event.
Parameters:
fireEvent
public void fireEvent(Object sender, T e)
Fires an event by calling sequentially all registered handlers.
Parameters:
isUpdateNotificationOnConnectedFired
public boolean isUpdateNotificationOnConnectedFired()
Checks if a client has subscribed to events.
Returns:
removeEventListener
public void removeEventListener(EventHandler
Unregisters the event handler from the associated event.
Parameters:
updateNotificationOnConnected
public void updateNotificationOnConnected(Runnable notifyConnectedOnce)
Updates the handler to be notified when the first client subscribes to the event.
Parameters:
Applies to
Azure SDK for Java
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour