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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondispatchRequest
(String serviceName, Message message, PipeLineSession session) Dispatch a requestMessage
to a service by its configured name.static ServiceDispatcher
Use this method to get hold of theServiceDispatcher
getListener
(String name) Retrieve the names of the registered listeners in alphabetical order.boolean
Check whether a serviceName is registered at theServiceDispatcher
.void
registerServiceClient
(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 requestMessage
to a service by its configured name.- Parameters:
serviceName
- ServiceName given to theServiceClient
implementation that is to be calledmessage
-Message
to be processedsession
- ExistingPipeLineSession
.- Returns:
Message
with 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
-