Class IbisLocalSender
- All Implemented Interfaces:
HasPhysicalDestination
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,IThreadCreator
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- 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
javaListener
to yourServiceName - Do not set the attribute
serviceName
- Define a Receiver with a JavaListener
- Set the attribute
name
to 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
serviceName
to yourIbisWebServiceName - Do not set the attribute
javaListener
- Define a Receiver with a WebServiceListener
- Set the attribute
name
to yourIbisWebServiceName
- Since:
- 4.2
- Author:
- Gerrit van Brakel
- Parameters
- All parameters are copied to the PipeLineSession of the service called.
-
Field Summary
Fields inherited from class org.frankframework.senders.AbstractSenderWithParameters
parameterNamesMustBeUnique, paramList
Fields inherited from class org.frankframework.senders.AbstractSender
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure()
is called once at startup of the framework in the configure method of the owner of this sender.int
boolean
boolean
boolean
Whentrue
, the result of sendMessage is the reply of the request.boolean
sendMessage
(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).void
setCheckDependency
(boolean b) Iftrue
, the sender waits upon open until the calledJavaListener
is openedvoid
setDependencyTimeOut
(int i) Maximum time (in seconds) the sender waits for the listener to start.void
setIsolated
(boolean b) Iftrue
, the call is made in a separate thread, possibly using separate transactionvoid
setIsolatedServiceCaller
(IsolatedServiceCaller isolatedServiceCaller) void
setJavaListener
(String string) Name of theJavaListener
that should be called (will be ignored when javaListenerSessionKey is set)void
setJavaListenerSessionKey
(String string) Name of the sessionKey which holds the name of theJavaListener
that should be calledvoid
setReturnedSessionKeys
(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.void
setServiceName
(String serviceName) Deprecated, for removal: This API element is subject to removal in a future version.void
setSynchronous
(boolean b) If setfalse
, the call is made asynchronously.void
setThreadLifeCycleEventListener
(ThreadLifeCycleEventListener<Object> threadLifeCycleEventListener) void
setThrowJavaListenerNotFoundException
(boolean b) If setfalse
, the xml-string \"<error>could not find JavaListener [...]</error>\" is returned instead of throwing a senderexceptionvoid
start()
This method will be called to start the sender.Methods inherited from class org.frankframework.senders.AbstractSenderWithParameters
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
Methods inherited from class org.frankframework.senders.AbstractSender
createBean, getApplicationContext, getConfigurationClassLoader, getLogPrefix, getName, setApplicationContext, setName, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.ISender
sendMessageOrThrow, stop
-
Field Details
-
threadLifeCycleEventListener
-
-
Constructor Details
-
IbisLocalSender
public IbisLocalSender()
-
-
Method Details
-
configure
Description copied from interface:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classAbstractSenderWithParameters
- Throws:
ConfigurationException
-
start
public void start()Description copied from interface:ISender
This 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:
start
in interfaceISender
- Overrides:
start
in classAbstractSender
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
-
sendMessage
@Nonnull public SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Description copied from interface:ISender
Send 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()
returnstrue
false
return 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:
sendMessage
in interfaceISender
- Throws:
SenderException
TimeoutException
-
setServiceName
Deprecated, for removal: This API element is subject to removal in a future version.Name of theWebServiceListener
that should be called -
setJavaListener
Name of theJavaListener
that should be called (will be ignored when javaListenerSessionKey is set) -
setJavaListenerSessionKey
Name of the sessionKey which holds the name of theJavaListener
that 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) If setfalse
, 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 calledJavaListener
is 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) If setfalse
, the xml-string \"<error>could not find JavaListener [...]</error>\" is returned instead of throwing a senderexception- Default value
- true
-
getDomain
- Specified by:
getDomain
in interfaceHasPhysicalDestination
-
getServiceName
-
getJavaListener
-
getJavaListenerSessionKey
-
isIsolated
public boolean isIsolated() -
isSynchronous
public boolean isSynchronous()Description copied from interface:ISender
Whentrue
, the result of sendMessage is the reply of the request.- Specified by:
isSynchronous
in interfaceISender
-
isCheckDependency
public boolean isCheckDependency() -
getDependencyTimeOut
public int getDependencyTimeOut() -
getReturnedSessionKeys
-
setIsolatedServiceCaller
-
isThrowJavaListenerNotFoundException
public boolean isThrowJavaListenerNotFoundException() -
setThreadLifeCycleEventListener
public void setThreadLifeCycleEventListener(ThreadLifeCycleEventListener<Object> threadLifeCycleEventListener) - Specified by:
setThreadLifeCycleEventListener
in interfaceIThreadCreator
-