Package com.cosylab.epics.caj.impl
Class CATransportRegistry
- java.lang.Object
-
- com.cosylab.epics.caj.impl.CATransportRegistry
-
public class CATransportRegistry extends Object
Class to cache CA transports (connections to other hosts).- Version:
- $id$
- Author:
- Matej Sekoranja
-
-
Constructor Summary
Constructors Constructor Description CATransportRegistry()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear cache.Transport[]get(InetSocketAddress address)Lookup for a transport for given address (all priorities).Transportget(InetSocketAddress address, short priority)Lookup for a transport for given address.intnumberOfActiveTransports()Get number of active (cached) transports.voidput(InetSocketAddress address, Transport transport)Cache new (address, transport) pair.Transportremove(InetSocketAddress address, short priority)Remove (address, transport) pair from cache.Transport[]toArray()Get array of all active (cached) transports.
-
-
-
Method Detail
-
put
public void put(InetSocketAddress address, Transport transport)
Cache new (address, transport) pair.- Parameters:
address- address of the host computer.transport- tranport to the host computer.
-
get
public Transport get(InetSocketAddress address, short priority)
Lookup for a transport for given address.- Parameters:
address- address of the host computer.priority- priority of the transport.- Returns:
- curressponing transport,
nullif none found.
-
get
public Transport[] get(InetSocketAddress address)
Lookup for a transport for given address (all priorities).- Parameters:
address- address of the host computer.- Returns:
- array of curressponing transports,
nullif none found.
-
remove
public Transport remove(InetSocketAddress address, short priority)
Remove (address, transport) pair from cache.- Parameters:
address- address of the host computer.priority- priority of the transport to be removed.- Returns:
- removed transport,
nullif none found.
-
clear
public void clear()
Clear cache.
-
numberOfActiveTransports
public int numberOfActiveTransports()
Get number of active (cached) transports.- Returns:
- number of active (cached) transports.
-
toArray
public Transport[] toArray()
Get array of all active (cached) transports.- Returns:
- array of all active (cached) transports.
-
-