public class ISOServer extends java.util.Observable implements LogSource, java.lang.Runnable, java.util.Observer, ISOServerMBean, Configurable, Loggeable, ISOServerSocketFactory
Modifier and Type | Class and Description |
---|---|
protected class |
ISOServer.Session |
Modifier and Type | Field and Description |
---|---|
protected Configuration |
cfg |
protected java.util.Collection |
clientIncomingFilters |
protected java.util.Collection |
clientOutgoingFilters |
protected ISOChannel |
clientSideChannel |
static int |
CONNECT |
static int |
DEFAULT_MAX_THREADS |
protected boolean |
ignoreISOExceptions |
static java.lang.String |
LAST |
protected long |
lastTxn |
protected java.util.Collection |
listeners |
protected Logger |
logger |
protected java.lang.String |
realm |
protected java.lang.String |
realmChannel |
protected java.util.List<ISOServerEventListener> |
serverListeners |
static int |
SIZEOF_CNT |
protected ISOServerSocketFactory |
socketFactory |
Constructor and Description |
---|
ISOServer(int port,
ServerChannel clientSide,
ThreadPool pool) |
Modifier and Type | Method and Description |
---|---|
void |
addISORequestListener(ISORequestListener l)
add an ISORequestListener
|
void |
addServerEventListener(ISOServerEventListener listener) |
java.net.ServerSocket |
createServerSocket(int port)
Create a server socket on the specified port (port 0 indicates
an anonymous port).
|
protected ISOServer.Session |
createSession(ServerChannel channel) |
void |
dump(java.io.PrintStream p,
java.lang.String indent) |
void |
fireEvent(java.util.EventObject event) |
int |
getActiveConnections() |
int |
getConnectionCount() |
int |
getConnections() |
int[] |
getCounters() |
java.lang.String |
getCountersAsString() |
java.lang.String |
getCountersAsString(java.lang.String isoChannelName) |
int |
getIdleCount() |
long |
getIdleTimeInMillis() |
ISOChannel |
getISOChannel(java.lang.String name) |
java.lang.String |
getISOChannelNames() |
int |
getJobCount() |
ISOChannel |
getLastConnectedISOChannel() |
long |
getLastTxnTimestampInMillis() |
Logger |
getLogger() |
int |
getMaxPoolSize() |
java.lang.String |
getName() |
int |
getPendingCount() |
int |
getPoolSize() |
int |
getPort() |
java.lang.String |
getRealm() |
int |
getRXCounter() |
static ISOServer |
getServer(java.lang.String name) |
ISOServerSocketFactory |
getSocketFactory()
Gets the ISOClientSocketFactory (may be null)
|
int |
getTXCounter() |
void |
removeISORequestListener(ISORequestListener l)
remove an ISORequestListener
|
void |
removeServerEventListener(ISOServerEventListener listener) |
void |
resetCounters() |
void |
run() |
void |
setConfiguration(Configuration cfg) |
void |
setLogger(Logger logger,
java.lang.String realm) |
void |
setName(java.lang.String name)
associates this ISOServer with a name using NameRegistrar
|
void |
setSocketFactory(ISOServerSocketFactory socketFactory)
Sets the specified Socket Factory to create sockets
|
void |
shutdown()
Shutdown this server
|
void |
update(java.util.Observable o,
java.lang.Object arg) |
protected ISOChannel clientSideChannel
protected java.util.Collection clientOutgoingFilters
protected java.util.Collection clientIncomingFilters
protected java.util.Collection listeners
public static final int DEFAULT_MAX_THREADS
public static final java.lang.String LAST
protected long lastTxn
protected Logger logger
protected java.lang.String realm
protected java.lang.String realmChannel
protected ISOServerSocketFactory socketFactory
public static final int CONNECT
public static final int SIZEOF_CNT
protected Configuration cfg
protected boolean ignoreISOExceptions
protected java.util.List<ISOServerEventListener> serverListeners
public ISOServer(int port, ServerChannel clientSide, ThreadPool pool)
port
- port to listenclientSide
- client side ISOChannel (where we accept connections)pool
- ThreadPool (created if null)public void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration
in interface Configurable
cfg
- Configuration objectConfigurationException
public void addISORequestListener(ISORequestListener l)
l
- request listener to be addedISORequestListener
public void removeISORequestListener(ISORequestListener l)
l
- a request listener to be removedISORequestListener
public void shutdown()
public java.net.ServerSocket createServerSocket(int port) throws java.io.IOException
ISOServerSocketFactory
createServerSocket
in interface ISOServerSocketFactory
port
- the port numberjava.io.IOException
- should an I/O error occurprotected ISOServer.Session createSession(ServerChannel channel)
public void run()
run
in interface java.lang.Runnable
public void setName(java.lang.String name)
name
- name to registerNameRegistrar
public static ISOServer getServer(java.lang.String name) throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException;
NameRegistrar.NotFoundException
NameRegistrar
public java.lang.String getName()
public void setLogger(Logger logger, java.lang.String realm)
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
public ISOServerSocketFactory getSocketFactory()
ISOClientSocketFactory
public void setSocketFactory(ISOServerSocketFactory socketFactory)
socketFactory
- the ISOClientSocketFactoryISOClientSocketFactory
public int getPort()
getPort
in interface ISOServerMBean
public void resetCounters()
resetCounters
in interface ISOServerMBean
public int getConnectionCount()
getConnectionCount
in interface ISOServerMBean
public int getJobCount()
getJobCount
in interface ThreadPoolMBean
public int getPoolSize()
getPoolSize
in interface ThreadPoolMBean
public int getMaxPoolSize()
getMaxPoolSize
in interface ThreadPoolMBean
public int getIdleCount()
getIdleCount
in interface ThreadPoolMBean
public int getPendingCount()
getPendingCount
in interface ThreadPoolMBean
public int getActiveConnections()
public ISOChannel getLastConnectedISOChannel()
public ISOChannel getISOChannel(java.lang.String name)
public java.lang.String getISOChannelNames()
getISOChannelNames
in interface ISOServerMBean
public java.lang.String getCountersAsString()
public int[] getCounters()
public int getTXCounter()
getTXCounter
in interface ISOServerMBean
public int getRXCounter()
getRXCounter
in interface ISOServerMBean
public int getConnections()
public long getLastTxnTimestampInMillis()
getLastTxnTimestampInMillis
in interface ISOServerMBean
public long getIdleTimeInMillis()
getIdleTimeInMillis
in interface ISOServerMBean
public java.lang.String getCountersAsString(java.lang.String isoChannelName)
getCountersAsString
in interface ISOServerMBean
public void dump(java.io.PrintStream p, java.lang.String indent)
public void addServerEventListener(ISOServerEventListener listener)
public void removeServerEventListener(ISOServerEventListener listener)
public void fireEvent(java.util.EventObject event)