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 Configurablecfg - Configuration objectConfigurationExceptionpublic void addISORequestListener(ISORequestListener l)
l - request listener to be addedISORequestListenerpublic void removeISORequestListener(ISORequestListener l)
l - a request listener to be removedISORequestListenerpublic void shutdown()
public java.net.ServerSocket createServerSocket(int port)
throws java.io.IOException
ISOServerSocketFactorycreateServerSocket in interface ISOServerSocketFactoryport - the port numberjava.io.IOException - should an I/O error occurprotected ISOServer.Session createSession(ServerChannel channel)
public void run()
run in interface java.lang.Runnablepublic void setName(java.lang.String name)
name - name to registerNameRegistrarpublic static ISOServer getServer(java.lang.String name) throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException;NameRegistrar.NotFoundExceptionNameRegistrarpublic 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.Observerpublic ISOServerSocketFactory getSocketFactory()
ISOClientSocketFactorypublic void setSocketFactory(ISOServerSocketFactory socketFactory)
socketFactory - the ISOClientSocketFactoryISOClientSocketFactorypublic int getPort()
getPort in interface ISOServerMBeanpublic void resetCounters()
resetCounters in interface ISOServerMBeanpublic int getConnectionCount()
getConnectionCount in interface ISOServerMBeanpublic int getJobCount()
getJobCount in interface ThreadPoolMBeanpublic int getPoolSize()
getPoolSize in interface ThreadPoolMBeanpublic int getMaxPoolSize()
getMaxPoolSize in interface ThreadPoolMBeanpublic int getIdleCount()
getIdleCount in interface ThreadPoolMBeanpublic int getPendingCount()
getPendingCount in interface ThreadPoolMBeanpublic int getActiveConnections()
public ISOChannel getLastConnectedISOChannel()
public ISOChannel getISOChannel(java.lang.String name)
public java.lang.String getISOChannelNames()
getISOChannelNames in interface ISOServerMBeanpublic java.lang.String getCountersAsString()
public int[] getCounters()
public int getTXCounter()
getTXCounter in interface ISOServerMBeanpublic int getRXCounter()
getRXCounter in interface ISOServerMBeanpublic int getConnections()
public long getLastTxnTimestampInMillis()
getLastTxnTimestampInMillis in interface ISOServerMBeanpublic long getIdleTimeInMillis()
getIdleTimeInMillis in interface ISOServerMBeanpublic java.lang.String getCountersAsString(java.lang.String isoChannelName)
getCountersAsString in interface ISOServerMBeanpublic 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)