com.cosylab.epics.caj.impl
Class CATransportRegistry

java.lang.Object
  extended by 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
CATransportRegistry()
          Constructor.
 
Method Summary
 void clear()
          Clear cache.
 Transport[] get(InetSocketAddress address)
          Lookup for a transport for given address (all priorities).
 Transport get(InetSocketAddress address, short priority)
          Lookup for a transport for given address.
 int numberOfActiveTransports()
          Get number of active (cached) transports.
 void put(InetSocketAddress address, Transport transport)
          Cache new (address, transport) pair.
 Transport remove(InetSocketAddress address, short priority)
          Remove (address, transport) pair from cache.
 Transport[] toArray()
          Get array of all active (cached) transports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CATransportRegistry

public CATransportRegistry()
Constructor.

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, null if 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, null if 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, 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()
Get array of all active (cached) transports.

Returns:
array of all active (cached) transports.


Copyright © 2004-2013 Cosylab. All Rights Reserved.