Class ISOServer
java.lang.Object
java.util.Observable
org.jpos.iso.ISOServer
- All Implemented Interfaces:
Runnable, Observer, Configurable, ISOServerMBean, ISOServerSocketFactory, Loggeable, LogSource
public class ISOServer
extends Observable
implements LogSource, Runnable, Observer, ISOServerMBean, Configurable, Loggeable, ISOServerSocketFactory
Accept ServerChannel sessions and forwards them to ISORequestListeners
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Configurationprotected Collectionprotected Collectionprotected ISOChannelstatic final intprotected booleanstatic final Stringprotected longprotected List<ISORequestListener> protected Loggerprotected Stringprotected Stringprotected List<ISOServerEventListener> protected ISOServerSocketFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd an ISORequestListenervoidaddServerEventListener(ISOServerEventListener listener) createServerSocket(int port) Create a server socket on the specified port (port 0 indicates an anonymous port).protected ISOServer.SessioncreateSession(ServerChannel channel) voiddump(PrintStream p, String indent) voidfireEvent(EventObject event) intintintint[]getCountersAsString(String isoChannelName) longgetISOChannel(String name) longgetName()intgetPort()getRealm()intstatic ISOServerGets the ISOClientSocketFactory (may be null)intvoidremove an ISORequestListenervoidvoidvoidrun()voidvoidvoidassociates this ISOServer with a name using NameRegistrarvoidsetSocketFactory(ISOServerSocketFactory socketFactory) Sets the specified Socket Factory to create socketsvoidshutdown()Shutdown this servervoidupdate(Observable o, Object arg) Methods inherited from class Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Field Details
-
clientSideChannel
-
clientOutgoingFilters
-
clientIncomingFilters
-
listeners
-
DEFAULT_MAX_SESSIONS
- See Also:
-
LAST
-
lastTxn
-
logger
-
realm
-
realmChannel
-
socketFactory
-
cfg
-
ignoreISOExceptions
-
serverListeners
-
-
Constructor Details
-
ISOServer
- Parameters:
port- port to listenclientSide- client side ISOChannel, used as a "clonable template" to accept new connections
-
-
Method Details
-
setConfiguration
- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object- Throws:
ConfigurationException
-
addISORequestListener
add an ISORequestListener- Parameters:
l- request listener to be added- See Also:
-
removeISORequestListener
remove an ISORequestListener- Parameters:
l- a request listener to be removed- See Also:
-
shutdown
Shutdown this server -
createServerSocket
Description copied from interface:ISOServerSocketFactoryCreate a server socket on the specified port (port 0 indicates an anonymous port).- Specified by:
createServerSocketin interfaceISOServerSocketFactory- Parameters:
port- the port number- Returns:
- the server socket on the specified port
- Throws:
IOException- should an I/O error occur
-
createSession
-
run
-
setName
-
getServer
- Returns:
- ISOServer instance with given name.
- Throws:
NameRegistrar.NotFoundException- See Also:
-
getName
-
setLogger
-
getRealm
-
getLogger
-
update
-
getSocketFactory
Gets the ISOClientSocketFactory (may be null)- Since:
- 1.3.3
- See Also:
-
setSocketFactory
Sets the specified Socket Factory to create sockets- Parameters:
socketFactory- the ISOClientSocketFactory- Since:
- 1.3.3
- See Also:
-
getPort
- Specified by:
getPortin interfaceISOServerMBean
-
resetCounters
- Specified by:
resetCountersin interfaceISOServerMBean
-
getConnectionCount
- Specified by:
getConnectionCountin interfaceISOServerMBean- Returns:
- number of connections accepted by this server
-
getLastConnectedISOChannel
- Returns:
- most recently connected ISOChannel or null
-
getISOChannel
- Returns:
- ISOChannel under the given name
-
getISOChannelNames
- Specified by:
getISOChannelNamesin interfaceISOServerMBean
-
getCountersAsString
-
getCounters
-
getTXCounter
- Specified by:
getTXCounterin interfaceISOServerMBean
-
getRXCounter
- Specified by:
getRXCounterin interfaceISOServerMBean
-
getConnections
-
getLastTxnTimestampInMillis
- Specified by:
getLastTxnTimestampInMillisin interfaceISOServerMBean
-
getIdleTimeInMillis
- Specified by:
getIdleTimeInMillisin interfaceISOServerMBean
-
getCountersAsString
- Specified by:
getCountersAsStringin interfaceISOServerMBean
-
dump
-
addServerEventListener
-
removeServerEventListener
-
fireEvent
-
getActiveConnections
-