jPOS 1.6.7 API Documentation

org.jpos.iso.channel
Class ChannelPool

java.lang.Object
  extended by org.jpos.iso.channel.ChannelPool
All Implemented Interfaces:
java.lang.Cloneable, Configurable, ISOChannel, ISOSource, LogSource

public class ChannelPool
extends java.lang.Object
implements ISOChannel, LogSource, Configurable, java.lang.Cloneable


Field Summary
 
Fields inherited from interface org.jpos.iso.ISOChannel
CONNECT, RX, SIZEOF_CNT, TX
 
Constructor Summary
ChannelPool()
           
 
Method Summary
 void addChannel(ISOChannel channel)
           
 void addChannel(java.lang.String name)
           
 java.lang.Object clone()
          Expose channel clonning interface
 void connect()
          Connects ISOChannel
 void disconnect()
          disconnects ISOChannel
 ISOChannel getCurrent()
           
 Logger getLogger()
           
 java.lang.String getName()
           
 ISOPackager getPackager()
           
 java.lang.String getRealm()
           
 boolean isConnected()
           
 ISOMsg receive()
          Receives an ISOMsg
 void reconnect()
          Reconnect channel
 void removeChannel(ISOChannel channel)
           
 void removeChannel(java.lang.String name)
           
 void send(byte[] b)
          sends a byte[] over the TCP/IP session
 void send(ISOMsg m)
          sends an ISOMsg over the TCP/IP session
 void setConfiguration(Configuration cfg)
           
 void setLogger(Logger logger, java.lang.String realm)
           
 void setName(java.lang.String name)
          associates this ISOChannel with a name on NameRegistrar
 void setPackager(ISOPackager p)
          Associate a packager with this channel
 void setUsable(boolean b)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelPool

public ChannelPool()
Method Detail

setPackager

public void setPackager(ISOPackager p)
Description copied from interface: ISOChannel
Associate a packager with this channel

Specified by:
setPackager in interface ISOChannel
Parameters:
p - an ISOPackager

connect

public void connect()
             throws java.io.IOException
Description copied from interface: ISOChannel
Connects ISOChannel

Specified by:
connect in interface ISOChannel
Throws:
java.io.IOException

disconnect

public void disconnect()
                throws java.io.IOException
Description copied from interface: ISOChannel
disconnects ISOChannel

Specified by:
disconnect in interface ISOChannel
Throws:
java.io.IOException

reconnect

public void reconnect()
               throws java.io.IOException
Description copied from interface: ISOChannel
Reconnect channel

Specified by:
reconnect in interface ISOChannel
Throws:
java.io.IOException

isConnected

public boolean isConnected()
Specified by:
isConnected in interface ISOChannel
Specified by:
isConnected in interface ISOSource
Returns:
true if Channel is connected and usable

receive

public ISOMsg receive()
               throws java.io.IOException,
                      ISOException
Description copied from interface: ISOChannel
Receives an ISOMsg

Specified by:
receive in interface ISOChannel
Returns:
the Message received
Throws:
java.io.IOException
ISOException

send

public void send(ISOMsg m)
          throws java.io.IOException,
                 ISOException
Description copied from interface: ISOChannel
sends an ISOMsg over the TCP/IP session

Specified by:
send in interface ISOChannel
Specified by:
send in interface ISOSource
Parameters:
m - the Message to be sent
Throws:
java.io.IOException
ISOException

send

public void send(byte[] b)
          throws java.io.IOException,
                 ISOException
Description copied from interface: ISOChannel
sends a byte[] over the TCP/IP session

Specified by:
send in interface ISOChannel
Parameters:
b - the byte array to be sent
Throws:
java.io.IOException
ISOException

setUsable

public void setUsable(boolean b)
Specified by:
setUsable in interface ISOChannel
Parameters:
b - - usable state

setName

public void setName(java.lang.String name)
Description copied from interface: ISOChannel
associates this ISOChannel with a name on NameRegistrar

Specified by:
setName in interface ISOChannel
Parameters:
name - name to register
See Also:
NameRegistrar

getName

public java.lang.String getName()
Specified by:
getName in interface ISOChannel
Returns:
this ISOChannel's name ("" if no name was set)

getPackager

public ISOPackager getPackager()
Specified by:
getPackager in interface ISOChannel
Returns:
current packager

setLogger

public void setLogger(Logger logger,
                      java.lang.String realm)
Specified by:
setLogger in interface LogSource

getRealm

public java.lang.String getRealm()
Specified by:
getRealm in interface LogSource

getLogger

public Logger getLogger()
Specified by:
getLogger in interface LogSource

setConfiguration

public void setConfiguration(Configuration cfg)
                      throws ConfigurationException
Specified by:
setConfiguration in interface Configurable
Parameters:
cfg - Configuration object
Throws:
ConfigurationException

addChannel

public void addChannel(ISOChannel channel)

addChannel

public void addChannel(java.lang.String name)
                throws NameRegistrar.NotFoundException
Throws:
NameRegistrar.NotFoundException

removeChannel

public void removeChannel(ISOChannel channel)

removeChannel

public void removeChannel(java.lang.String name)
                   throws NameRegistrar.NotFoundException
Throws:
NameRegistrar.NotFoundException

size

public int size()

getCurrent

public ISOChannel getCurrent()
                      throws java.io.IOException
Throws:
java.io.IOException

clone

public java.lang.Object clone()
Description copied from interface: ISOChannel
Expose channel clonning interface

Specified by:
clone in interface ISOChannel
Overrides:
clone in class java.lang.Object

jPOS.org