Class FSDChannel
java.lang.Object
java.util.Observable
org.jpos.iso.BaseChannel
org.jpos.iso.channel.NACChannel
org.jpos.iso.channel.FSDChannel
- All Implemented Interfaces:
Cloneable, Configurable, ExceptionHandlerAware, BaseChannelMBean, ClientChannel, FactoryChannel, FilteredChannel, ISOChannel, ISOSource, ServerChannel, ISOMsgMetrics.Source, LogSource
-
Field Summary
Fields inherited from class BaseChannel
cnt, header, incomingFilters, logger, originalRealm, outgoingFilters, overrideHeader, packager, realm, serverIn, serverInLock, serverOut, serverOutLock, serverSocket, socketFactory, usableFields inherited from interface ISOChannel
CONNECT, RX, SIZEOF_CNT, TX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsupport old factory method name for backward compatibilityprotected intvoidSends the specifiedISOMsgover this ISOChannel.voidImplements 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)Methods inherited from class NACChannel
sendMessageHeader, sendMessageLength, setHeaderMethods inherited from class BaseChannel
accept, addFilter, addFilter, addIncomingFilter, addOutgoingFilter, applyIncomingFilters, applyIncomingFilters, applyOutgoingFilters, applyTimeout, clone, closeSocket, connect, connect, createISOMsg, disconnect, getBytes, getChannel, getConfiguration, getCounters, getDynamicHeader, getDynamicPackager, getDynamicPackager, getDynamicPackager, getExceptionHandlers, getHeader, getHeaderLength, getHeaderLength, getHeaderLength, getHost, getIncomingFilters, getISOMsgMetrics, getLogger, getMaxPacketLength, getMessage, getMessageTrailer, getMessageTrailler, getName, getOriginalRealm, getOutgoingFilters, getPackager, getPort, getRealm, getServerSocket, getSocket, getSocketFactory, getSoLingerSeconds, getTimeout, incrementMsgInCounter, incrementMsgOutCounter, isConnected, isExpectKeepAlive, isOverrideHeader, isRejected, isSoLingerOn, newSocket, newSocket, pack, postConnectHook, readHeader, receive, reconnect, removeFilter, removeFilter, removeIncomingFilter, removeOutgoingFilter, resetCounters, send, sendKeepAlive, sendMessage, sendMessageTrailer, sendMessageTrailler, sendMessageTrailler, setHeader, setHost, setHost, setIncomingFilters, setISOMsgMetrics, setLocalAddress, setLogger, setMaxPacketLength, setName, setOutgoingFilters, setOverrideHeader, setPackager, setPort, setServerSocket, setSocketFactory, setSoLinger, setTimeout, setUsable, shouldIgnore, streamReceive, unpackMethods inherited from class Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ExceptionHandlerAware
addHandler, addHandler, handle, removeHandler, removeHandler, removeHandlers
-
Constructor Details
-
FSDChannel
public FSDChannel()
-
-
Method Details
-
createMsg
Description copied from class:BaseChannelsupport old factory method name for backward compatibility- Overrides:
createMsgin classBaseChannel- Returns:
- newly created ISOMsg
-
setConfiguration
Description copied from class:BaseChannelImplements 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)
- Specified by:
setConfigurationin interfaceConfigurable- Overrides:
setConfigurationin classNACChannel- Parameters:
cfg- Configuration- Throws:
ConfigurationException
-
send
Description copied from class:BaseChannelSends the specifiedISOMsgover 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
ChannelEventandLogEvent.
ISOFilter.VetoExceptionis thrown by a filter, the message is not sent, and the exception is logged.- Specified by:
sendin interfaceISOChannel- Specified by:
sendin interfaceISOSource- Overrides:
sendin classBaseChannel- 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
- Overrides:
getMessageLengthin classNACChannel- Throws:
IOExceptionISOException
-