Class IbisJavaSender

All Implemented Interfaces:
HasPhysicalDestination, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider, ISender, ISenderWithParameters, IWithParameters, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Category("Advanced") public class IbisJavaSender extends SenderWithParametersBase implements HasPhysicalDestination
Posts a message to another IBIS-adapter or application in the same JVM using IbisServiceDispatcher. An IbisJavaSender makes a call to a Receiver with a JavaListener or any other application in the same JVM that has registered a RequestProcessor with the IbisServiceDispatcher.

configuring IbisJavaSender and JavaListener

  • Define a SenderPipe with an IbisJavaSender
  • Set the attribute serviceName to yourExternalServiceName
In the Adapter to be called:
  • Define a Receiver with a JavaListener
  • Set the attribute serviceName to yourExternalServiceName
N.B. Please make sure that the IbisServiceDispatcher-1.4.jar or newer is present on the class path of the server.
Since:
4.4.5
Author:
Gerrit van Brakel
Parameters
All parameters are copied to the PipeLineSession of the service called.
  • Constructor Details

    • IbisJavaSender

      public IbisJavaSender()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      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 the configure() or open() method, to improve performance.
      Specified by:
      configure in interface IConfigurable
      Specified by:
      configure in interface ISender
      Overrides:
      configure in class SenderWithParametersBase
      Throws:
      ConfigurationException
    • getPhysicalDestinationName

      public String getPhysicalDestinationName()
      Specified by:
      getPhysicalDestinationName in interface HasPhysicalDestination
    • isSynchronous

      public boolean isSynchronous()
      Description copied from interface: ISender
      When true, the result of sendMessage is the reply of the request.
      Specified by:
      isSynchronous in interface ISender
    • sendMessage

      public SenderResult sendMessage(Message message, 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 the configure() method is called.

      The following table shows the difference between synchronous and a-synchronous senders:

       synchronousa-synchronous
      ISender.isSynchronous() returnstruefalse
      return value of sendMessage() isthe reply-messagethe messageId of the message sent
      the correlationID specified with sendMessage()may be ignoredis sent with the message
      a {link TimeOutException}may be thrown if a timeout occurs waiting for a replyshould 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 interface ISender
      Throws:
      SenderException
      TimeoutException
    • setServiceName

      public void setServiceName(String string)
      ServiceName of the JavaListener that should be called.
    • setServiceNameSessionKey

      public void setServiceNameSessionKey(String string)
      Key of session variable to specify ServiceName of the JavaListener that should be called.
    • setReturnedSessionKeys

      public void 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. The set of available sessionKeys to be returned might be limited by the returnedSessionKeys attribute of the corresponding JavaListener.
    • setMultipartResponse

      public void setMultipartResponse(boolean b)
      Currently used to mimic the HttpSender when it is stubbed locally. It could be useful in other situations too although currently the response string is used which isn't streamed, it would be better to pass the multipart as an input stream in the context map in which case content type and charset could also be passed
      Default value
      false
    • setDispatchType

      public void setDispatchType(String type) throws ConfigurationException
      Set to 'DLL' to make the dispatcher communicate with a DLL set on the classpath
      Throws:
      ConfigurationException
    • getDomain

      public String getDomain()
      Specified by:
      getDomain in interface HasPhysicalDestination
    • getServiceName

      public String getServiceName()
    • getServiceNameSessionKey

      public String getServiceNameSessionKey()
    • getReturnedSessionKeys

      public String getReturnedSessionKeys()
    • isMultipartResponse

      public boolean isMultipartResponse()
    • getDispatchType

      public String getDispatchType()