Class FSDChannel

All Implemented Interfaces:
Cloneable, Configurable, ExceptionHandlerAware, BaseChannelMBean, ClientChannel, FactoryChannel, FilteredChannel, ISOChannel, ISOSource, ServerChannel, ISOMsgMetrics.Source, LogSource

public class FSDChannel extends NACChannel
NACChannel variant that uses FSDMsg as its message factory.
  • Constructor Details

    • FSDChannel

      public FSDChannel()
      Default constructor; no instance state to initialise.
  • Method Details

    • createMsg

      public ISOMsg createMsg()
      Description copied from class: BaseChannel
      support old factory method name for backward compatibility
      Overrides:
      createMsg in class BaseChannel
      Returns:
      newly created ISOMsg
    • setConfiguration

      Description copied from class: BaseChannel
      Implements Configurable
      Properties:
      • host - destination host (if ClientChannel)
      • port - port number (if ClientChannel)
      • local-iface - local interfase to use (if ClientChannel)
      • local-port - local port to bind (if ClientChannel)
      (host not present indicates a ServerChannel)
      Specified by:
      setConfiguration in interface Configurable
      Overrides:
      setConfiguration in class NACChannel
      Parameters:
      cfg - Configuration
      Throws:
      ConfigurationException - if configuration is invalid
    • send

      public void send(ISOMsg m) throws IOException, ISOException
      Description copied from class: BaseChannel
      Sends the specified ISOMsg over this ISOChannel.

      This method performs the following steps:

      • Verifies the channel is connected.
      • Sets the message direction to ISOMsg.OUTGOING.
      • Retrieves and sets a dynamic packager for the message.
      • Applies all registered outgoing filters, allowing them to modify or veto the message.
      • Packs the message and writes its length, header, body, and trailer to the underlying stream, protected by a locking mechanism to ensure thread safety.
      • Flushes the output stream and increments message counters.
      • Notifies observers of the sent message.
      • Logs both the message and the send operation through ChannelEvent and LogEvent.
      If a ISOFilter.VetoException is thrown by a filter, the message is not sent, and the exception is logged.
      Specified by:
      send in interface ISOChannel
      Specified by:
      send in interface ISOSource
      Overrides:
      send in class BaseChannel
      Parameters:
      m - the ISO message to be sent. The message will be modified in-place: its direction and packager will be updated, and filters may alter its content.
      Throws:
      IOException - if the channel is not connected, if the output stream fails, if locking times out, or if an unexpected I/O error occurs.
      ISOException - if packing the message fails or other ISO-specific issues occur.
      See Also:
    • getMessageLength

      protected int getMessageLength() throws IOException, ISOException
      Description copied from class: BaseChannel
      Reads and returns the message length prefix from the stream.
      Overrides:
      getMessageLength in class NACChannel
      Returns:
      the message length
      Throws:
      IOException - on I/O error
      ISOException - on protocol error