public class ChannelPool extends java.lang.Object implements ISOChannel, LogSource, Configurable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected Logger |
logger |
protected java.lang.String |
realm |
CONNECT, RX, SIZEOF_CNT, TX
Constructor and Description |
---|
ChannelPool() |
Modifier and Type | Method and Description |
---|---|
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() |
protected Logger logger
protected java.lang.String realm
public void setPackager(ISOPackager p)
ISOChannel
setPackager
in interface ISOChannel
p
- an ISOPackagerpublic void connect() throws java.io.IOException
ISOChannel
connect
in interface ISOChannel
java.io.IOException
public void disconnect() throws java.io.IOException
ISOChannel
disconnect
in interface ISOChannel
java.io.IOException
public void reconnect() throws java.io.IOException
ISOChannel
reconnect
in interface ISOChannel
java.io.IOException
public boolean isConnected()
isConnected
in interface ISOChannel
isConnected
in interface ISOSource
public ISOMsg receive() throws java.io.IOException, ISOException
ISOChannel
receive
in interface ISOChannel
java.io.IOException
ISOException
public void send(ISOMsg m) throws java.io.IOException, ISOException
ISOChannel
send
in interface ISOChannel
send
in interface ISOSource
m
- the Message to be sentjava.io.IOException
ISOException
public void send(byte[] b) throws java.io.IOException, ISOException
ISOChannel
send
in interface ISOChannel
b
- the byte array to be sentjava.io.IOException
ISOException
public void setUsable(boolean b)
setUsable
in interface ISOChannel
b
- - usable statepublic void setName(java.lang.String name)
ISOChannel
setName
in interface ISOChannel
name
- name to registerNameRegistrar
public java.lang.String getName()
getName
in interface ISOChannel
public ISOPackager getPackager()
getPackager
in interface ISOChannel
public void setLogger(Logger logger, java.lang.String realm)
public void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration
in interface Configurable
cfg
- Configuration objectConfigurationException
public void addChannel(ISOChannel channel)
public void addChannel(java.lang.String name) throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException
public void removeChannel(ISOChannel channel)
public void removeChannel(java.lang.String name) throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException
public int size()
public ISOChannel getCurrent() throws java.io.IOException
java.io.IOException
public java.lang.Object clone()
ISOChannel
clone
in interface ISOChannel
clone
in class java.lang.Object