|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ros.master.uri.SwitchableMasterUriProvider
public class SwitchableMasterUriProvider
A proxying MasterUriProvider which can be switched between providers.
This class is thread-safe.
| Nested Class Summary | |
|---|---|
static interface |
SwitchableMasterUriProvider.MasterUriProviderSwitcher
Perform a switch between MasterUriProvider instances for the
SwitchableMasterUriProvider. |
| Constructor Summary | |
|---|---|
SwitchableMasterUriProvider(MasterUriProvider provider)
|
|
| Method Summary | |
|---|---|
java.net.URI |
getMasterUri()
Get a master URI. |
java.net.URI |
getMasterUri(long timeout,
java.util.concurrent.TimeUnit unit)
Get a master URI within a given amount of time. |
void |
switchProvider(SwitchableMasterUriProvider.MasterUriProviderSwitcher switcher)
Switch between providers. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwitchableMasterUriProvider(MasterUriProvider provider)
provider - the initial provider to use| Method Detail |
|---|
public java.net.URI getMasterUri()
throws RosRuntimeException
MasterUriProviderThere 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.
getMasterUri in interface MasterUriProviderRosRuntimeException - this exception may or may not be thrown if there is no master URI
available
public java.net.URI getMasterUri(long timeout,
java.util.concurrent.TimeUnit unit)
MasterUriProviderThere 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.
getMasterUri in interface MasterUriProvidertimeout - the amount of time to wait for a URIunit - the time unit for the wait time
null if none could be obtained within the
timeoutpublic void switchProvider(SwitchableMasterUriProvider.MasterUriProviderSwitcher switcher)
switcher - the new provider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||