你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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: