Classes | Public Member Functions | Private Attributes
org.ros.master.uri.SwitchableMasterUriProvider Class Reference
Inheritance diagram for org.ros.master.uri.SwitchableMasterUriProvider:
Inheritance graph
[legend]

List of all members.

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< ProviderRequestpending = Lists.newArrayList()
MasterUriProvider provider

Detailed Description

A proxying MasterUriProvider which can be switched between providers.

This class is thread-safe.

Author:
Keith M. Hughes

Definition at line 36 of file SwitchableMasterUriProvider.java.


Constructor & Destructor Documentation

Parameters:
providerthe initial provider to use

Definition at line 54 of file SwitchableMasterUriProvider.java.


Member Function Documentation

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.

Returns:
a master URI
Exceptions:
RosRuntimeExceptionthis 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.

Parameters:
timeoutthe amount of time to wait for a URI
unitthe time unit for the wait time
Returns:
a master URI or
 null 
if none could be obtained within the timeout

Implements org.ros.master.uri.MasterUriProvider.

Definition at line 81 of file SwitchableMasterUriProvider.java.

Switch between providers.

Parameters:
switcherthe new provider

Definition at line 111 of file SwitchableMasterUriProvider.java.


Member Data Documentation

Definition at line 38 of file SwitchableMasterUriProvider.java.

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.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:51