Class IbisLocalSender
- All Implemented Interfaces:
ConfigurationAware,FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IScopeProvider,ISender,ISenderWithParameters,IWithParameters,NameAware,IThreadCreator,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.Lifecycle
- Direct Known Subclasses:
SendMessageJob.SendMessageJobSender
exit>
that has state PipeLine.ExitState.ERROR, an error is considered to happen
in the caller which means that the exception forward is followed if it is present.
The IbisLocalSender is now considered to be legacy. The new way to call another adapter from your own
adapter is by using the FrankSender.
Returns exit.code as forward name to SenderPipe provided that exit.code can be parsed as integer.
For example, if the called adapter has an exit state with code
2, then the SenderPipe supports a forward with name 2
that is followed when the called adapter exits with the mentioned exit. This does not work if the code is for example c2.
An IbisLocalSender makes a call to a Receiver with either a WebServiceListener
or a JavaListener.
Configuration of the Adapter to be called
A call to another Adapter in the same Frank!Framework instance is preferably made using the combination of an IbisLocalSender and aJavaListener. If,
however, a Receiver with a WebServiceListener is already present, that can be used in some cases, too.
configuring IbisLocalSender and JavaListener
- Define a SenderPipe with an IbisLocalSender
- Set the attribute
javaListenerto yourServiceName - Do not set the attribute
serviceName
- Define a Receiver with a JavaListener
- Set the attribute
nameto yourServiceName - Do not set the attribute
serviceName, except if the service is to be called also from applications other than this Frank!Framework-instance
configuring IbisLocalSender and WebServiceListener
- Define a SenderPipe with an IbisLocalSender
- Set the attribute
serviceNameto yourIbisWebServiceName - Do not set the attribute
javaListener
- Define a Receiver with a WebServiceListener
- Set the attribute
nameto yourIbisWebServiceName
- Since:
- 4.2
- Author:
- Gerrit van Brakel
- Parameters
- All parameters are copied to the PipeLineSession of the service called.
-
Field Summary
FieldsFields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramListFields inherited from class org.frankframework.senders.AbstractSender
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this component.sendMessage(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).voidsetCheckDependency(boolean b) Iftrue, the sender waits upon open until the calledJavaListeneris openedvoidsetDependencyTimeOut(int i) Maximum time (in seconds) the sender waits for the listener to start.voidsetIsolated(boolean b) Iftrue, the call is made in a separate thread, possibly using separate transactionvoidsetJavaListener(String string) Name of theJavaListenerthat should be called (will be ignored when javaListenerSessionKey is set)voidsetJavaListenerSessionKey(String string) Name of the sessionKey which holds the name of theJavaListenerthat should be calledvoidsetReturnedSessionKeys(String string) Comma separated list of keys of session variables that will be returned to caller, for correct results as well as for erroneous results.voidsetServiceName(String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.voidsetSynchronous(boolean b) Iffalse, the call is made asynchronously.voidsetThrowJavaListenerNotFoundException(boolean b) Iffalse, the xml-string "<error>could not find JavaListener [...]</error>" is returned instead of throwing a senderexceptionvoidstart()This method will be called to start the sender.Methods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueListMethods inherited from class org.frankframework.senders.AbstractSender
createBean, getLogPrefix, getName, isRunning, setApplicationContext, setName, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.configuration.ConfigurationAware
setConfigurationMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow, stopMethods inherited from interface org.frankframework.threading.IThreadCreator
setThreadLifeCycleEventListener
-
Field Details
-
threadLifeCycleEventListener
-
-
Constructor Details
-
IbisLocalSender
public IbisLocalSender()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Overrides:
configurein classAbstractSenderWithParameters- Throws:
ConfigurationException- in case it was not able to configure the component.
-
start
public void start()Description copied from interface:ISenderThis method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()method.- Specified by:
startin interfaceISender- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Overrides:
startin classAbstractSender
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationNamein interfaceHasPhysicalDestination
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Description copied from interface:ISenderSend a message to some destination (as configured in the Sender object). This method may only be called after theconfigure()method is called.The following table shows the difference between synchronous and a-synchronous senders:
synchronous a-synchronous ISender.isSynchronous()returnstruefalsereturn value of sendMessage()isthe reply-message the messageId of the message sent the correlationID specified with sendMessage()may be ignored is sent with the message a {link TimeOutException} may be thrown if a timeout occurs waiting for a reply should not be expected Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or
synchronized.- Specified by:
sendMessagein interfaceISender- Throws:
SenderExceptionTimeoutException
-
setServiceName
Deprecated, for removal: This API element is subject to removal in a future version.Name of theWebServiceListenerthat should be called -
setJavaListener
Name of theJavaListenerthat should be called (will be ignored when javaListenerSessionKey is set) -
setJavaListenerSessionKey
Name of the sessionKey which holds the name of theJavaListenerthat should be called -
setReturnedSessionKeys
Comma separated list of keys of session variables that will be returned to caller, for correct results as well as for erroneous results. The set of available sessionKeys to be returned might be limited by the returnedSessionKeys attribute of the corresponding JavaListener. -
setSynchronous
public void setSynchronous(boolean b) Iffalse, the call is made asynchronously. This impliesisolated=true- Default value
- true
-
setIsolated
public void setIsolated(boolean b) Iftrue, the call is made in a separate thread, possibly using separate transaction- Default value
- false
-
setCheckDependency
public void setCheckDependency(boolean b) Iftrue, the sender waits upon open until the calledJavaListeneris opened- Default value
- true
-
setDependencyTimeOut
public void setDependencyTimeOut(int i) Maximum time (in seconds) the sender waits for the listener to start. A value of -1 indicates to wait indefinitely- Default value
- 60
-
setThrowJavaListenerNotFoundException
public void setThrowJavaListenerNotFoundException(boolean b) Iffalse, the xml-string "<error>could not find JavaListener [...]</error>" is returned instead of throwing a senderexception- Default value
- true
-