Package com.cosylab.epics.caj
Class CAJContext
- java.lang.Object
-
- gov.aps.jca.Context
-
- com.cosylab.epics.caj.CAJContext
-
- All Implemented Interfaces:
CAJConstants,CAContext,LoggerProvider,Configurable
public class CAJContext extends Context implements CAContext, CAJConstants, Configurable
Implementation of CAJ JCAContext.- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Field Summary
Fields Modifier and Type Field Description protected StringaddressListA space-separated list of broadcast address for process variable name resolution.protected booleanautoAddressListDefine whether or not the network interfaces should be discovered at runtime.protected MapbeaconHandlersBeacon handler map.protected floatbeaconPeriodPeriod in second between two beacon signals.protected floatbeaconSlowdownFactor by which beacon period needs to grow to consider it a slow, delayed beacon which suggests a restored network segment.protected floatbeaconSpeedupFactor by which beacon period needs to shrink to consider it a 'fast' beacon which suggests a CA server restart/reboot.protected BroadcastTransportbroadcastTransportBroadcast transport needed for channel searches.protected CachedByteBufferAllocatorcachedBufferAllocatorCached byte buffer allocator.static StringCAJ_SINGLE_THREADED_MODELString value of the JVM property key to turn on single threaded model.protected IntHashMapchannelsByCIDMap of channels (keys are CIDs).protected MapchannelsByNameMap of channels (keys are names).protected floatconnectionTimeoutIf the context doesn't see a beacon from a server that it is connected to for connectionTimeout seconds then a state-of-health message is sent to the server over TCP/IP.protected CAConnectorconnectorCA connector (creates CA virtual circuit).protected ArrayListcontextExceptionListenersList of context exception listeners.protected ArrayListcontextMessageListenersList of context message listeners.protected longechoTimeoutTimeout for the state-of-health message (defaults to the CA default of 5 sec).protected EventDispatchereventDispatcherEvent dispatcher.protected LeaderFollowersThreadPoolleaderFollowersThreadPoolLeader/followers thread pool.protected LoggerloggerContext logger.protected intmaxArrayBytesLength in bytes of the maximum array size that may pass through CA.protected floatmaxSearchIntervalMaximum interval in seconds between CA search broadcasts.protected floatminSearchIntervalMinimum interval in seconds between CA search broadcasts.ArrayList<CAJNameClient>nameClientsprotected StringnameServersListprotected IntHashMappendingResponseRequestsMap of pending response requests (keys are IOID).protected ReactorreactorReactor.protected booleanregistrationConfirmedRegistration confirmation status.protected intrepeaterPortPort number for the repeater to listen to.protected intserverPortPort number for the server to listen to.protected TimertimerTimer.protected CATransportRegistrytransportRegistryCA transport (virtual circuit) registry.static VersionVERSIONVersion.-
Fields inherited from interface com.cosylab.epics.caj.CAJConstants
CAJ_DEBUG, CAJ_STRIP_HOSTNAME
-
-
Constructor Summary
Constructors Constructor Description CAJContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContextExceptionListener(ContextExceptionListener l)Add a ContextExceptionListener to this context.voidaddContextMessageListener(ContextMessageListener l)Add a ContextMessageListener to this context.voidattachCurrentThread()Attach the calling thread to the list of threads allowed to access this context and all its channels.voidbeaconAnomalyNotify()Called each time beacon anomaly is detected.protected voidcheckState()Check context state and tries to establish necessary state.voidconfigure(Configuration configuration)Pass theConfigurationto theConfigurableclass.ChannelcreateChannel(String name, ConnectionListener l, short priority)Create a new Channel using this context to access a process variable with a ConnectionListener to receive ConnectionEvent from the newly created Channel.voiddecrementPendingRequests(int usedSequenceNumberIO)Decrement pending requests counter.voiddestroy()Clear all ressources attached to this ContextvoiddestroyChannel(CAJChannel channel, boolean force)Destroy channel.voidflushIO()Flush outstanding IO request to the servers.StringgetAddressList()Get search address list.CABeaconHandlergetBeaconHandler(InetSocketAddress responseFrom)Get (and if necessary create) beacon handler.floatgetBeaconPeriod()Get beacon period (in seconds).floatgetBeaconSlowdown()Get beacon slowdown.floatgetBeaconSpeedup()Get beacon speedup.intgetBroadcastPort()Get broadcast port.BroadcastTransportgetBroadcastTransport()Broadcast transport.CachedByteBufferAllocatorgetCachedBufferAllocator()Get cached byte allocator.CAJChannelgetChannel(int channelID)Searches for a channel with given channel ID.CAJChannelgetChannel(String name, short priority, boolean acquire)Searches for a channel with given channel name.Channel[]getChannels()Get all channels of this context.ChannelSearchManagergetChannelSearchManager()Get channel search manager.floatgetConnectionTimeout()Get connection timeout (in seconds).ContextExceptionListener[]getContextExceptionListeners()ContextMessageListener[]getContextMessageListeners()longgetEchoTimeout()Get echo timeout (in milliseconds).EventDispatchergetEventDispatcher()Get event dispatcher.intgetLastReceivedSequenceNumber(int seqNo)Set last UDP recived sequence number.LeaderFollowersThreadPoolgetLeaderFollowersThreadPool()Get LF thread pool.LoggergetLogger()Get logger.intgetMaxArrayBytes()Get max size of payload.floatgetMaxSearchInterval()Get max.floatgetMinSearchInterval()Get min.ReactorgetReactor()Get context reactor.intgetRepeaterPort()Get repeater port.ResponseRequestgetResponseRequest(int ioid)Searches for a response request with given channel IOID.intgetServerPort()Get server port.TimergetTimer()Get timer.CATransportgetTransport(TransportClient client, InetSocketAddress serverAddress, short minorRevision, short priority)Get, or create if necessary, transport of given server address.CATransportRegistrygetTransportRegistry()Get CA transport (virtual circuit) registry.StringgetUserName()Get user name (used to report to the server).VersiongetVersion()Get context version.intincrementPendingRequests()Increment pending requests counter.voidinitialize()protected voidinitializeLogger()Initialize context logger.voidinvalidateLastReceivedSequence()Invalidate last (UDP) received sequence.booleanisAutoAddressList()Get auto search-list flag.booleanisDestroyed()Get destruction status.booleanisDoNotShareChannels()booleanisInitialized()Get initialization status.booleanisRegistrationConfirmed()Get repeater registration status.protected voidloadConfiguration()Load configuration.voidmodifyUserName(String userName)Modifies client username and notifies connected servers about it.voidnotifyException(ContextExceptionEvent event)Notifies context listeners about exception.voidpendEvent(double timeout)Process all pending events.voidpendIO(double timeout)Process all pending IO operations.voidpoll()Flush the send buffer and process any outstanding CA background activity.voidprintInfo(PrintStream out)Prints detailed information about the Context to the specified output stream.intregisterResponseRequest(ResponseRequest request)Register response request.voidremoveContextExceptionListener(ContextExceptionListener l)Removes a ContextExceptionListener from this context.voidremoveContextMessageListener(ContextMessageListener l)Removes a ContextMessageListener from this context.voidrepeaterConfirm(InetSocketAddress responseFrom)Repeater registration confirmation.voidsearchResponse(int cid, int sid, short type, int count, short minorRevision, InetSocketAddress serverAddress)Search response from server (channel found).voidsetDoNotShareChannels(boolean doNotShareChannels)voidsetLastReceivedSequenceNumber(int seqNo)Set last UDP recived sequence number.booleantestIO()Tests if all synchronous (ie not specifying listeners) get and channel creation requests are completed.ResponseRequestunregisterResponseRequest(ResponseRequest request)Unregister response request.-
Methods inherited from class gov.aps.jca.Context
createChannel, createChannel, createChannel, dispose, printInfo
-
-
-
-
Field Detail
-
VERSION
public static final Version VERSION
Version.
-
CAJ_SINGLE_THREADED_MODEL
public static final String CAJ_SINGLE_THREADED_MODEL
String value of the JVM property key to turn on single threaded model.- See Also:
- Constant Field Values
-
logger
protected Logger logger
Context logger.
-
addressList
protected String addressList
A space-separated list of broadcast address for process variable name resolution. Each address must be of the form: ip.number:port or host.name:port
-
autoAddressList
protected boolean autoAddressList
Define whether or not the network interfaces should be discovered at runtime.
-
nameServersList
protected String nameServersList
-
connectionTimeout
protected float connectionTimeout
If the context doesn't see a beacon from a server that it is connected to for connectionTimeout seconds then a state-of-health message is sent to the server over TCP/IP. If this state-of-health message isn't promptly replied to then the context will assume that the server is no longer present on the network and disconnect.
-
beaconPeriod
protected float beaconPeriod
Period in second between two beacon signals.
-
beaconSpeedup
protected float beaconSpeedup
Factor by which beacon period needs to shrink to consider it a 'fast' beacon which suggests a CA server restart/reboot.
-
beaconSlowdown
protected float beaconSlowdown
Factor by which beacon period needs to grow to consider it a slow, delayed beacon which suggests a restored network segment.
-
echoTimeout
protected long echoTimeout
Timeout for the state-of-health message (defaults to the CA default of 5 sec).
-
repeaterPort
protected int repeaterPort
Port number for the repeater to listen to.
-
serverPort
protected int serverPort
Port number for the server to listen to.
-
maxArrayBytes
protected int maxArrayBytes
Length in bytes of the maximum array size that may pass through CA.
-
minSearchInterval
protected float minSearchInterval
Minimum interval in seconds between CA search broadcasts. Default is 0.1 seconds
-
maxSearchInterval
protected float maxSearchInterval
Maximum interval in seconds between CA search broadcasts. Default is 5 minutes.
-
contextMessageListeners
protected ArrayList contextMessageListeners
List of context message listeners.
-
contextExceptionListeners
protected ArrayList contextExceptionListeners
List of context exception listeners.
-
eventDispatcher
protected EventDispatcher eventDispatcher
Event dispatcher.
-
timer
protected Timer timer
Timer.
-
reactor
protected Reactor reactor
Reactor.
-
leaderFollowersThreadPool
protected LeaderFollowersThreadPool leaderFollowersThreadPool
Leader/followers thread pool.
-
registrationConfirmed
protected boolean registrationConfirmed
Registration confirmation status.
-
broadcastTransport
protected BroadcastTransport broadcastTransport
Broadcast transport needed for channel searches.
-
connector
protected CAConnector connector
CA connector (creates CA virtual circuit).
-
nameClients
public ArrayList<CAJNameClient> nameClients
-
transportRegistry
protected CATransportRegistry transportRegistry
CA transport (virtual circuit) registry. This registry contains all active transports - connections to CA servers.
-
cachedBufferAllocator
protected CachedByteBufferAllocator cachedBufferAllocator
Cached byte buffer allocator. Used by transports which as send buffers.
-
channelsByCID
protected IntHashMap channelsByCID
Map of channels (keys are CIDs).
-
channelsByName
protected Map channelsByName
Map of channels (keys are names).
-
pendingResponseRequests
protected IntHashMap pendingResponseRequests
Map of pending response requests (keys are IOID).
-
beaconHandlers
protected Map beaconHandlers
Beacon handler map.
-
-
Method Detail
-
getVersion
public Version getVersion()
Get context version.- Specified by:
getVersionin classContext- Returns:
- version of the context implementation.
- See Also:
Context.getVersion()
-
isDoNotShareChannels
public boolean isDoNotShareChannels()
-
setDoNotShareChannels
public void setDoNotShareChannels(boolean doNotShareChannels)
-
initializeLogger
protected void initializeLogger()
Initialize context logger.
-
loadConfiguration
protected void loadConfiguration()
Load configuration.
-
configure
public void configure(Configuration configuration) throws ConfigurationException
Description copied from interface:ConfigurablePass theConfigurationto theConfigurableclass. This method must always be called after the constructor and before any other method.- Specified by:
configurein interfaceConfigurable- Parameters:
configuration- the class configurations.- Throws:
ConfigurationException- if an error occurs- See Also:
Configurable.configure(gov.aps.jca.configuration.Configuration)
-
getContextMessageListeners
public ContextMessageListener[] getContextMessageListeners() throws IllegalStateException
- Specified by:
getContextMessageListenersin classContext- Returns:
- an array containing all ContextMessageListeners attached to this context.
- Throws:
IllegalStateException- if the context has been destroyed.- See Also:
Context.getContextMessageListeners()
-
addContextMessageListener
public void addContextMessageListener(ContextMessageListener l) throws CAException, IllegalStateException
Description copied from class:ContextAdd a ContextMessageListener to this context.- Specified by:
addContextMessageListenerin classContext- Parameters:
l- the listener to add- Throws:
IllegalStateException- if the context has been destroyed.CAException- See Also:
Context.addContextMessageListener(gov.aps.jca.event.ContextMessageListener)
-
removeContextMessageListener
public void removeContextMessageListener(ContextMessageListener l) throws CAException, IllegalStateException
Description copied from class:ContextRemoves a ContextMessageListener from this context.- Specified by:
removeContextMessageListenerin classContext- Parameters:
l- the listener to remove- Throws:
IllegalStateException- if the context has been destroyed.CAException- See Also:
Context.removeContextMessageListener(gov.aps.jca.event.ContextMessageListener)
-
getContextExceptionListeners
public ContextExceptionListener[] getContextExceptionListeners() throws IllegalStateException
- Specified by:
getContextExceptionListenersin classContext- Returns:
- an array containing all ContextExceptionListeners attached to this context.
- Throws:
IllegalStateException- if the context has been destroyed.- See Also:
Context.getContextExceptionListeners()
-
addContextExceptionListener
public void addContextExceptionListener(ContextExceptionListener l) throws CAException, IllegalStateException
Description copied from class:ContextAdd a ContextExceptionListener to this context.- Specified by:
addContextExceptionListenerin classContext- Parameters:
l- the listener to add- Throws:
IllegalStateException- if the context has been destroyed.CAException- See Also:
Context.addContextExceptionListener(gov.aps.jca.event.ContextExceptionListener)
-
removeContextExceptionListener
public void removeContextExceptionListener(ContextExceptionListener l) throws CAException, IllegalStateException
Description copied from class:ContextRemoves a ContextExceptionListener from this context.- Specified by:
removeContextExceptionListenerin classContext- Parameters:
l- the listener to remove- Throws:
IllegalStateException- if the context has been destroyed.CAException- See Also:
Context.removeContextExceptionListener(gov.aps.jca.event.ContextExceptionListener)
-
notifyException
public void notifyException(ContextExceptionEvent event)
Notifies context listeners about exception.- Parameters:
event- context exception event to be fired.
-
checkState
protected void checkState() throws CAException, IllegalStateExceptionCheck context state and tries to establish necessary state.- Throws:
CAException- JCA ExceptionIllegalStateException- IllegalStateException
-
initialize
public void initialize() throws CAException- Overrides:
initializein classContext- Throws:
CAException- See Also:
Context.initialize()
-
destroy
public void destroy() throws CAException, IllegalStateExceptionDescription copied from class:ContextClear all ressources attached to this Context- Specified by:
destroyin classContext- Throws:
IllegalStateException- if the context has been destroyed.CAException- See Also:
Context.destroy()
-
createChannel
public Channel createChannel(String name, ConnectionListener l, short priority) throws CAException, IllegalStateException
Description copied from class:ContextCreate a new Channel using this context to access a process variable with a ConnectionListener to receive ConnectionEvent from the newly created Channel.- Specified by:
createChannelin classContext- Parameters:
name- the process variable to connect to.l- the ConnectionListener.priority- channel process priority- Returns:
- the new Channel.
- Throws:
CAException- is thrown if a Channel Access error occured while creating the channel.IllegalStateException- if the context has been destroyed.- See Also:
Context.createChannel(java.lang.String, gov.aps.jca.event.ConnectionListener, short)
-
destroyChannel
public void destroyChannel(CAJChannel channel, boolean force) throws CAException, IllegalStateException
Destroy channel.- Parameters:
channel- CAJChannelforce- force destruction regardless of reference count- Throws:
CAException- force destruction regardless of reference countIllegalStateException- Signals that a method has been invoked at an illegal or inappropriate time
-
getChannel
public CAJChannel getChannel(int channelID)
Searches for a channel with given channel ID.- Parameters:
channelID- CID.- Returns:
- channel with given CID,
nullif non-existant.
-
getChannel
public CAJChannel getChannel(String name, short priority, boolean acquire)
Searches for a channel with given channel name.- Parameters:
name- channel name.priority- channel priority.acquire- whether to acquire ownership (increment ref. counting)- Returns:
- channel with given name,
nullif non-existant.
-
getChannels
public Channel[] getChannels()
Description copied from class:ContextGet all channels of this context.- Specified by:
getChannelsin classContext- Returns:
- array of channels of this context.
- See Also:
Context.getChannels()
-
pendIO
public void pendIO(double timeout) throws TimeoutException, CAException, IllegalStateExceptionDescription copied from class:ContextProcess all pending IO operations.- Specified by:
pendIOin classContext- Parameters:
timeout- the timeout limit.- Throws:
TimeoutException- if all the IO couldn't be processed.CAException- if a Channel Exception error occured while processing IOs.IllegalStateException- if the context has been destroyed.- See Also:
Context.pendIO(double)
-
testIO
public boolean testIO() throws CAException, IllegalStateExceptionDescription copied from class:ContextTests if all synchronous (ie not specifying listeners) get and channel creation requests are completed. It will only test request and channel created after the last pendIO() call.- Specified by:
testIOin classContext- Returns:
- true if all pending IO request have been processed. False otherwise.
- Throws:
CAException- if a Channel Access error occured while testing IOsIllegalStateException- if the context has been destroyed.- See Also:
Context.testIO()
-
pendEvent
public void pendEvent(double timeout) throws CAException, IllegalStateExceptionDescription copied from class:ContextProcess all pending events.- Specified by:
pendEventin classContext- Parameters:
timeout- the time during which the Context will process events.- Throws:
CAException- if a Channel Access error occured while pending eventsIllegalStateException- if the context has been destroyed.- See Also:
Context.pendEvent(double)
-
poll
public void poll() throws CAException, IllegalStateExceptionDescription copied from class:ContextFlush the send buffer and process any outstanding CA background activity.- Specified by:
pollin classContext- Throws:
CAException- if a Channel Access error occured while testing IOsIllegalStateException- if the context has been destroyed.- See Also:
Context.poll()
-
flushIO
public void flushIO() throws CAException, IllegalStateExceptionDescription copied from class:ContextFlush outstanding IO request to the servers.- Specified by:
flushIOin classContext- Throws:
CAException- if a Channel Access error occured while flushing IOsIllegalStateException- if the context has been destroyed.- See Also:
Context.flushIO()
-
attachCurrentThread
public void attachCurrentThread() throws CAException, IllegalStateExceptionDescription copied from class:ContextAttach the calling thread to the list of threads allowed to access this context and all its channels.- Specified by:
attachCurrentThreadin classContext- Throws:
IllegalStateException- if the context has been destroyed. or if the context doesn't support multiple threads.CAException- See Also:
Context.attachCurrentThread()
-
printInfo
public void printInfo(PrintStream out) throws IllegalStateException
Description copied from class:ContextPrints detailed information about the Context to the specified output stream.- Overrides:
printInfoin classContext- Parameters:
out- the output stream.- Throws:
IllegalStateException- if the context has been destroyed.- See Also:
Context.printInfo(java.io.PrintStream)
-
isInitialized
public boolean isInitialized()
Get initialization status.- Returns:
- initialization status.
-
isDestroyed
public boolean isDestroyed()
Get destruction status.- Returns:
- destruction status.
-
getAddressList
public String getAddressList()
Get search address list.- Returns:
- get search address list.
-
isAutoAddressList
public boolean isAutoAddressList()
Get auto search-list flag.- Returns:
- auto search-list flag.
-
getBeaconPeriod
public float getBeaconPeriod()
Get beacon period (in seconds).- Returns:
- beacon period (in seconds).
-
getBeaconSpeedup
public float getBeaconSpeedup()
Get beacon speedup. Factor by which beacon period needs to shrink to consider it a 'fast' beacon which suggests a CA server restart/reboot.- Returns:
- beacon speedup factor
-
getBeaconSlowdown
public float getBeaconSlowdown()
Get beacon slowdown. Factor by which beacon period needs to grow to consider it a slow, delayed beacon which suggests a restored network segment.- Returns:
- beacon speedup factor
-
getEchoTimeout
public long getEchoTimeout()
Get echo timeout (in milliseconds).- Returns:
- echo timeout (in milliseconds).
-
getConnectionTimeout
public float getConnectionTimeout()
Get connection timeout (in seconds).- Returns:
- connection timeout (in seconds).
-
getLogger
public Logger getLogger()
Get logger.- Specified by:
getLoggerin interfaceLoggerProvider- Returns:
- logger.
-
getMaxArrayBytes
public int getMaxArrayBytes()
Get max size of payload.- Returns:
- max size of payload.
-
getRepeaterPort
public int getRepeaterPort()
Get repeater port.- Returns:
- repeater port.
-
getServerPort
public int getServerPort()
Get server port.- Specified by:
getServerPortin interfaceCAContext- Returns:
- server port.
-
getBroadcastPort
public int getBroadcastPort()
Get broadcast port.- Specified by:
getBroadcastPortin interfaceCAContext- Returns:
- broadcast port.
-
getMinSearchInterval
public float getMinSearchInterval()
Get min. search interval- Returns:
- min. search interval in seconds
-
getMaxSearchInterval
public float getMaxSearchInterval()
Get max. search interval- Returns:
- max. search interval
-
getEventDispatcher
public final EventDispatcher getEventDispatcher()
Get event dispatcher.- Returns:
- event dispatcher.
-
getReactor
public Reactor getReactor()
Get context reactor.- Specified by:
getReactorin interfaceCAContext- Returns:
- context reactor.
-
getBroadcastTransport
public BroadcastTransport getBroadcastTransport()
Broadcast transport.- Specified by:
getBroadcastTransportin interfaceCAContext- Returns:
- broadcast transport.
-
getTransportRegistry
public CATransportRegistry getTransportRegistry()
Get CA transport (virtual circuit) registry.- Specified by:
getTransportRegistryin interfaceCAContext- Returns:
- CA transport (virtual circuit) registry.
-
getTimer
public Timer getTimer()
Get timer.
-
getChannelSearchManager
public ChannelSearchManager getChannelSearchManager()
Get channel search manager.- Returns:
- channel search manager.
-
getCachedBufferAllocator
public CachedByteBufferAllocator getCachedBufferAllocator()
Get cached byte allocator.- Specified by:
getCachedBufferAllocatorin interfaceCAContext- Returns:
- cached byte allocator.
-
getLeaderFollowersThreadPool
public LeaderFollowersThreadPool getLeaderFollowersThreadPool()
Get LF thread pool.- Specified by:
getLeaderFollowersThreadPoolin interfaceCAContext- Returns:
- LF thread pool, can be
nullif disabled.
-
isRegistrationConfirmed
public boolean isRegistrationConfirmed()
Get repeater registration status.- Returns:
- repeater registration status.
-
repeaterConfirm
public void repeaterConfirm(InetSocketAddress responseFrom)
Repeater registration confirmation.- Parameters:
responseFrom- response from address.
-
beaconAnomalyNotify
public void beaconAnomalyNotify()
Called each time beacon anomaly is detected.
-
searchResponse
public void searchResponse(int cid, int sid, short type, int count, short minorRevision, InetSocketAddress serverAddress)Search response from server (channel found).- Parameters:
cid- client channel ID.sid- server channel ID.type- channel type code.count- channel element count.minorRevision- server minor CA revision.serverAddress- server address.
-
getTransport
public CATransport getTransport(TransportClient client, InetSocketAddress serverAddress, short minorRevision, short priority)
Get, or create if necessary, transport of given server address.- Parameters:
client- requesting connection (transport).serverAddress- required transport addressminorRevision- transport revision to be usedpriority- process priority.- Returns:
- transport for given address
-
getResponseRequest
public ResponseRequest getResponseRequest(int ioid)
Searches for a response request with given channel IOID.- Parameters:
ioid- I/O ID.- Returns:
- request response with given I/O ID.
-
registerResponseRequest
public int registerResponseRequest(ResponseRequest request)
Register response request.- Parameters:
request- request to register.- Returns:
- request ID (IOID).
-
unregisterResponseRequest
public ResponseRequest unregisterResponseRequest(ResponseRequest request)
Unregister response request.- Parameters:
request- ResponseRequest- Returns:
- removed object, can be
null
-
incrementPendingRequests
public int incrementPendingRequests()
Increment pending requests counter.- Returns:
- IO sequence number (pendIO sequence number).
-
decrementPendingRequests
public void decrementPendingRequests(int usedSequenceNumberIO)
Decrement pending requests counter.- Parameters:
usedSequenceNumberIO- IO sequence number returned by incrementPendingRequests
-
setLastReceivedSequenceNumber
public final void setLastReceivedSequenceNumber(int seqNo)
Set last UDP recived sequence number.- Parameters:
seqNo- last UDP recived sequence number.
-
getLastReceivedSequenceNumber
public final int getLastReceivedSequenceNumber(int seqNo)
Set last UDP recived sequence number.- Parameters:
seqNo- last UDP recived sequence number.- Returns:
- last received sequence number
-
invalidateLastReceivedSequence
public final void invalidateLastReceivedSequence()
Description copied from interface:CAContextInvalidate last (UDP) received sequence.- Specified by:
invalidateLastReceivedSequencein interfaceCAContext- See Also:
CAContext.invalidateLastReceivedSequence()
-
getBeaconHandler
public CABeaconHandler getBeaconHandler(InetSocketAddress responseFrom)
Get (and if necessary create) beacon handler.- Parameters:
responseFrom- remote source address of received beacon.- Returns:
- beacon handler for particular server.
-
modifyUserName
public void modifyUserName(String userName)
Modifies client username and notifies connected servers about it.- Parameters:
userName- username
-
getUserName
public String getUserName()
Description copied from interface:CAContextGet user name (used to report to the server).- Specified by:
getUserNamein interfaceCAContext- Returns:
- String username
-
-