Classes | |
interface | MasterUriProviderSwitcher |
class | ProviderRequest |
Public Member Functions | |
URI | getMasterUri () throws RosRuntimeException |
URI | getMasterUri (long timeout, TimeUnit unit) |
SwitchableMasterUriProvider (MasterUriProvider provider) | |
void | switchProvider (MasterUriProviderSwitcher switcher) |
Private Attributes | |
final Object | mutex |
List< ProviderRequest > | pending = Lists.newArrayList() |
MasterUriProvider | provider |
A proxying MasterUriProvider which can be switched between providers.
This class is thread-safe.
Definition at line 36 of file SwitchableMasterUriProvider.java.
org.ros.master.uri.SwitchableMasterUriProvider.SwitchableMasterUriProvider | ( | MasterUriProvider | provider | ) | [inline] |
provider | the initial provider to use |
Definition at line 54 of file SwitchableMasterUriProvider.java.
URI org.ros.master.uri.SwitchableMasterUriProvider.getMasterUri | ( | ) | throws RosRuntimeException [inline] |
Get a master URI.
There is no guarantee that calling this class twice will provide the same URI.
This call may or may not block until a URI is available.
RosRuntimeException | this exception may or may not be thrown if there is no master URI available |
Implements org.ros.master.uri.MasterUriProvider.
Definition at line 60 of file SwitchableMasterUriProvider.java.
URI org.ros.master.uri.SwitchableMasterUriProvider.getMasterUri | ( | long | timeout, |
TimeUnit | unit | ||
) | [inline] |
Get a master URI within a given amount of time.
There is no guarantee that calling this class twice will provide the same URI.
This call may or may not block until a URI is available.
timeout | the amount of time to wait for a URI |
unit | the time unit for the wait time |
null
Implements org.ros.master.uri.MasterUriProvider.
Definition at line 81 of file SwitchableMasterUriProvider.java.
void org.ros.master.uri.SwitchableMasterUriProvider.switchProvider | ( | MasterUriProviderSwitcher | switcher | ) | [inline] |
Switch between providers.
switcher | the new provider |
Definition at line 111 of file SwitchableMasterUriProvider.java.
final Object org.ros.master.uri.SwitchableMasterUriProvider.mutex [private] |
Definition at line 38 of file SwitchableMasterUriProvider.java.
List<ProviderRequest> org.ros.master.uri.SwitchableMasterUriProvider.pending = Lists.newArrayList() [private] |
The list of all pending requests.
Definition at line 48 of file SwitchableMasterUriProvider.java.
The current provider in use.
Definition at line 43 of file SwitchableMasterUriProvider.java.