Package org.epics.pvaccess.impl.remote
Class TransportRegistry
- java.lang.Object
-
- org.epics.pvaccess.impl.remote.TransportRegistry
-
public final class TransportRegistry extends Object
Class to cache PVA transports (connections to other hosts).- Version:
- $Id$
- Author:
- Matej Sekoranja
-
-
Constructor Summary
Constructors Constructor Description TransportRegistry()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear cache.Transport[]
get(String type, InetSocketAddress address)
Lookup for a transport for given address (all priorities).Transport
get(String type, InetSocketAddress address, short priority)
Lookup for a transport for given address.int
numberOfActiveTransports()
Get number of active (cached) transports.void
put(Transport transport)
Save/cache new transport into the registry.Transport
remove(Transport transport)
Remove transport from the registry.Transport[]
toArray()
Get array of all active (cached) transports.Transport[]
toArray(String type)
Get array of all active (cached) transports.
-
-
-
Method Detail
-
put
public void put(Transport transport)
Save/cache new transport into the registry.- Parameters:
transport
- transport to be registered.
-
get
public Transport get(String type, InetSocketAddress address, short priority)
Lookup for a transport for given address.- Parameters:
type
- protocol type.address
- address of the host computer.priority
- priority of the transport.- Returns:
- corresponding transport,
null
if none found.
-
get
public Transport[] get(String type, InetSocketAddress address)
Lookup for a transport for given address (all priorities).- Parameters:
type
- protocol type (e.g. tcp, udp, ssl, etc.).address
- address of the host computer.- Returns:
- array of corresponding transports,
null
if none found.
-
remove
public Transport remove(Transport transport)
Remove transport from the registry.- Parameters:
transport
- transport to remove.- Returns:
- removed transport,
null
if 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(String type)
Get array of all active (cached) transports.- Parameters:
type
- protocol type (e.g. tcp, udp, ssl, etc.).- Returns:
- array of all active (cached) transports.
-
toArray
public Transport[] toArray()
Get array of all active (cached) transports.- Returns:
- array of all active (cached) transports.
-
-