Class DefaultAiServiceListenerRegistrar
java.lang.Object
dev.langchain4j.observability.api.DefaultAiServiceListenerRegistrar
- All Implemented Interfaces:
AiServiceListenerRegistrar
A default registrar for registering
AiServiceListeners.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends AiServiceEvent>
voidfireEvent(T event) Fires the given event to all registeredAiServiceListeners.<T extends AiServiceEvent>
voidregister(AiServiceListener<T> listener) Registers a listener to receiveAiServiceEventnotifications.<T extends AiServiceEvent>
voidunregister(AiServiceListener<T> listener) Unregisters a previously registeredAiServiceListener, stopping it from receiving furtherAiServiceEventnotifications.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AiServiceListenerRegistrar
register, register, unregister, unregister
-
Constructor Details
-
DefaultAiServiceListenerRegistrar
public DefaultAiServiceListenerRegistrar()
-
-
Method Details
-
register
Registers a listener to receiveAiServiceEventnotifications.- Specified by:
registerin interfaceAiServiceListenerRegistrar
-
unregister
Unregisters a previously registeredAiServiceListener, stopping it from receiving furtherAiServiceEventnotifications.- Specified by:
unregisterin interfaceAiServiceListenerRegistrar
-
fireEvent
Fires the given event to all registeredAiServiceListeners.- Specified by:
fireEventin interfaceAiServiceListenerRegistrar- Type Parameters:
T- The type of the event, which must be a subtype ofAiServiceEvent.- Parameters:
event- The event to be fired to the listeners. Must not be null.
-