Package org.frankframework.receivers
Class ServiceDispatcher
java.lang.Object
org.frankframework.receivers.ServiceDispatcher
Singleton class that knows about the ServiceListeners that are active.
This class is to be used as a facade for different services that implement the
This class is exposed as a webservice, to be able to provide a single point of entry to all adapters that have a ServiceListener as a IReceiver.
This class is to be used as a facade for different services that implement the
ServiceClient interface.This class is exposed as a webservice, to be able to provide a single point of entry to all adapters that have a ServiceListener as a IReceiver.
- Author:
- Johan Verrips, Niels Meijer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondispatchRequest(String serviceName, Message message, PipeLineSession session) Dispatch a requestMessageto a service by its configured name.static ServiceDispatcherUse this method to get hold of theServiceDispatchergetListener(String name) Retrieve the names of the registered listeners in alphabetical order.booleanCheck whether a serviceName is registered at theServiceDispatcher.voidregisterServiceClient(String name, ServiceClient listener) void
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
ServiceDispatcher
public ServiceDispatcher()
-
-
Method Details
-
getInstance
Use this method to get hold of theServiceDispatcher- Returns:
- an instance of this class
-
dispatchRequest
public Message dispatchRequest(String serviceName, Message message, PipeLineSession session) throws ListenerException Dispatch a requestMessageto a service by its configured name.- Parameters:
serviceName- ServiceName given to theServiceClientimplementation that is to be calledmessage-Messageto be processedsession- ExistingPipeLineSession.- Returns:
Messagewith the result of the requested adapter execution.- Throws:
ListenerException- If there was an error in request execution.
-
getRegisteredListenerNames
Retrieve the names of the registered listeners in alphabetical order.- Returns:
- Set with the names.
-
isRegisteredServiceListener
Check whether a serviceName is registered at theServiceDispatcher.- Returns:
- true if the service is registered at this dispatcher, otherwise false
-
registerServiceClient
-
unregisterServiceClient
-
getListener
-