Package org.jpos.iso.channel
Class LogChannel
- java.lang.Object
-
- java.util.Observable
-
- org.jpos.iso.BaseChannel
-
- org.jpos.iso.channel.LogChannel
-
- All Implemented Interfaces:
java.lang.Cloneable
,Configurable
,ExceptionHandlerAware
,BaseChannelMBean
,ClientChannel
,FactoryChannel
,FilteredChannel
,ISOChannel
,ISOSource
,ServerChannel
,LogSource
public class LogChannel extends BaseChannel
Extracts <isomsg> blocks from standard jPOS log- See Also:
ISOMsg
,ISOException
,ISOChannel
-
-
Field Summary
-
Fields inherited from class org.jpos.iso.BaseChannel
cnt, header, incomingFilters, logger, originalRealm, outgoingFilters, overrideHeader, packager, realm, serverIn, serverInLock, serverOut, serverOutLock, serverSocket, socketFactory, usable
-
Fields inherited from interface org.jpos.iso.ISOChannel
CONNECT, RX, SIZEOF_CNT, TX
-
-
Constructor Summary
Constructors Constructor Description LogChannel()
Public constructor (used by Class.forName("...").newInstance())LogChannel(java.lang.String host, int port, ISOPackager p)
Constructs client ISOChannelLogChannel(ISOPackager p)
Construct server ISOChannelLogChannel(ISOPackager p, java.net.ServerSocket serverSocket)
constructs a server ISOChannel associated with a Server Socket
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connect(java.net.Socket socket)
setup I/O Streams from socketvoid
disconnect()
disconnects the TCP/IP session.protected int
getHeaderLength()
void
setConfiguration(Configuration cfg)
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)protected byte[]
streamReceive()
-
Methods inherited from class org.jpos.iso.BaseChannel
accept, addFilter, addFilter, addIncomingFilter, addOutgoingFilter, applyIncomingFilters, applyIncomingFilters, applyOutgoingFilters, applyTimeout, clone, closeSocket, connect, createISOMsg, createMsg, getBytes, getChannel, getConfiguration, getCounters, getDynamicHeader, getDynamicPackager, getDynamicPackager, getDynamicPackager, getExceptionHandlers, getHeader, getHeaderLength, getHeaderLength, getHost, getIncomingFilters, getLogger, getMaxPacketLength, getMessage, getMessageLength, getMessageTrailer, getMessageTrailler, getName, getOriginalRealm, getOutgoingFilters, getPackager, getPort, getRealm, getServerSocket, getSocket, getSocketFactory, getSoLingerSeconds, getTimeout, isConnected, isExpectKeepAlive, isOverrideHeader, isRejected, isSoLingerOn, newSocket, newSocket, pack, postConnectHook, readHeader, receive, reconnect, removeFilter, removeFilter, removeIncomingFilter, removeOutgoingFilter, resetCounters, send, send, sendKeepAlive, sendMessage, sendMessageHeader, sendMessageLength, sendMessageTrailer, sendMessageTrailler, sendMessageTrailler, setHeader, setHeader, setHost, setHost, setIncomingFilters, setLocalAddress, setLogger, setMaxPacketLength, setName, setOutgoingFilters, setOverrideHeader, setPackager, setPort, setServerSocket, setSocketFactory, setSoLinger, setTimeout, setUsable, shouldIgnore, unpack
-
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jpos.core.handlers.exception.ExceptionHandlerAware
addHandler, addHandler, handle, removeHandler, removeHandler, removeHandlers
-
-
-
-
Constructor Detail
-
LogChannel
public LogChannel()
Public constructor (used by Class.forName("...").newInstance())
-
LogChannel
public LogChannel(java.lang.String host, int port, ISOPackager p)
Constructs client ISOChannel- Parameters:
host
- server TCP Addressport
- server port numberp
- an ISOPackager- See Also:
ISOPackager
-
LogChannel
public LogChannel(ISOPackager p) throws java.io.IOException
Construct server ISOChannel- Parameters:
p
- an ISOPackager- Throws:
java.io.IOException
- See Also:
ISOPackager
-
LogChannel
public LogChannel(ISOPackager p, java.net.ServerSocket serverSocket) throws java.io.IOException
constructs a server ISOChannel associated with a Server Socket- Parameters:
p
- an ISOPackagerserverSocket
- where to accept a connection- Throws:
java.io.IOException
- See Also:
ISOPackager
-
-
Method Detail
-
streamReceive
protected byte[] streamReceive() throws java.io.IOException
- Overrides:
streamReceive
in classBaseChannel
- Returns:
- a byte array with the received message
- Throws:
java.io.IOException
-
getHeaderLength
protected int getHeaderLength()
- Overrides:
getHeaderLength
in classBaseChannel
-
connect
protected void connect(java.net.Socket socket) throws java.io.IOException
Description copied from class:BaseChannel
setup I/O Streams from socket- Overrides:
connect
in classBaseChannel
- Parameters:
socket
- a Socket (client or server)- Throws:
java.io.IOException
- on error
-
disconnect
public void disconnect() throws java.io.IOException
Description copied from class:BaseChannel
disconnects the TCP/IP session. The instance is ready for a reconnection. There is no need to create a new ISOChannel- Specified by:
disconnect
in interfaceBaseChannelMBean
- Specified by:
disconnect
in interfaceISOChannel
- Overrides:
disconnect
in classBaseChannel
- Throws:
java.io.IOException
-
setConfiguration
public void setConfiguration(Configuration cfg) throws ConfigurationException
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)
- Specified by:
setConfiguration
in interfaceConfigurable
- Overrides:
setConfiguration
in classBaseChannel
- Parameters:
cfg
- Configuration- Throws:
ConfigurationException
-
-