Interface RPCRemote<M extends com.google.protobuf.Message>
- Type Parameters:
M- the data type of the data which is used for remote synchronization.
- All Superinterfaces:
org.openbase.jul.iface.Activatable,org.openbase.jul.pattern.provider.DataProvider<M>,org.openbase.jul.iface.Lockable,org.openbase.jul.iface.provider.PingProvider,org.openbase.jul.pattern.controller.Remote<M>,org.openbase.jul.iface.Shutdownable
- All Known Implementing Classes:
AbstractConfigurableRemote,AbstractIdentifiableRemote,AbstractRemoteClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openbase.jul.iface.Shutdownable
org.openbase.jul.iface.Shutdownable.ShutdownDaemon -
Method Summary
Modifier and TypeMethodDescriptiondefault <R> RcallMethod(String methodName, Class<R> returnClazz) Deprecated.please use async variant.default <R> RcallMethod(String methodName, Class<R> returnClazz, long timeout) Deprecated.please use async variant.default <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument) Deprecated.please use async variant.default <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument, long timeout) Deprecated.please use async variant.<R> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz) Method asynchronously calls the given method without any arguments on the main controller.<R,T> Future <org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz, T argument) Method asynchronously calls the given method on the main controller.org.openbase.type.communication.ScopeType.ScopegetScope()Method returns the scope of this remote connection.voidInitialize the remote on the given scope.voidinit(org.openbase.type.communication.ScopeType.Scope scope) Initialize the remote on the given scope.voidinit(org.openbase.type.communication.ScopeType.Scope scope, org.openbase.jul.communication.config.CommunicatorConfig communicatorConfig) Initialize the remote on the given scope.Methods inherited from interface org.openbase.jul.iface.Activatable
activate, deactivate, isActiveMethods inherited from interface org.openbase.jul.pattern.provider.DataProvider
addDataObserver, isDataAvailable, removeDataObserver, validateDataMethods inherited from interface org.openbase.jul.iface.Lockable
isLocked, lock, unlock, verifyMaintainabilityMethods inherited from interface org.openbase.jul.pattern.controller.Remote
activate, activate, addConnectionStateObserver, getConnectionState, getData, getDataClass, getDataFuture, getPing, isConnected, ping, removeConnectionStateObserver, requestData, waitForConnectionState, waitForData, waitForDataMethods inherited from interface org.openbase.jul.iface.Shutdownable
shutdown
-
Method Details
-
init
void init(org.openbase.type.communication.ScopeType.Scope scope) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on the given scope.- Parameters:
scope- the scope where the remote communicates- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
init
void init(org.openbase.type.communication.ScopeType.Scope scope, org.openbase.jul.communication.config.CommunicatorConfig communicatorConfig) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on the given scope.- Parameters:
scope- the scope where the remote communicatescommunicatorConfig- the rsb communicator config which should be used for the connection.- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
init
void init(String scope) throws org.openbase.jul.exception.InitializationException, InterruptedException Initialize the remote on the given scope.- Parameters:
scope- the scope where the remote communicates- Throws:
org.openbase.jul.exception.InitializationException- if the initialization failsInterruptedException- if the initialization is interrupted
-
getScope
org.openbase.type.communication.ScopeType.Scope getScope() throws org.openbase.jul.exception.NotAvailableExceptionMethod returns the scope of this remote connection.- Returns:
- the remote controller scope.
- Throws:
org.openbase.jul.exception.NotAvailableException
-
callMethod
@Deprecated default <R> R callMethod(String methodName, Class<R> returnClazz) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Deprecated.please use async variant.Method synchronously calls the given method without any arguments on the main controller.The method call will block until the call is successfully processed. Even if the main controller instance is currently not reachable, successively retry will be triggered. The only way to cancel the call is an externally interruption of the invoking thread.
- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
@Deprecated default <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument) throws org.openbase.jul.exception.CouldNotPerformException, InterruptedException Deprecated.please use async variant.Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed. Even if the main controller instance is currently not reachable, successively retry will be triggered. The only way to cancel the call is an externally interruption of the invoking thread.
- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
@Deprecated default <R> R callMethod(String methodName, Class<R> returnClazz, long timeout) throws org.openbase.jul.exception.CouldNotPerformException, org.openbase.jul.exception.TimeoutException, InterruptedException Deprecated.please use async variant.Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed or the given timeout is expired. Even if the main controller instance is currently not reachable, successively retry will be triggered.
- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.timeout- the RPC call timeout in milliseconds.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.org.openbase.jul.exception.TimeoutException- is thrown in case the given timeout is expired before the RPC was successfully processed.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethod
@Deprecated default <R,T> R callMethod(String methodName, Class<R> returnClazz, T argument, long timeout) throws org.openbase.jul.exception.CouldNotPerformException, org.openbase.jul.exception.TimeoutException, InterruptedException Deprecated.please use async variant.Method synchronously calls the given method on the main controller.The method call will block until the call is successfully processed or the given timeout is expired. Even if the main controller instance is currently not reachable, successively retry will be triggered.
- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.timeout- the RPC call timeout in milliseconds.- Returns:
- the return value of the remote method.
- Throws:
org.openbase.jul.exception.CouldNotPerformException- is thrown in case any error occurred during processing.org.openbase.jul.exception.TimeoutException- is thrown in case the given timeout is expired before the RPC was successfully processed.InterruptedException- is thrown in case the thread was externally interrupted.
-
callMethodAsync
<R> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz) Method asynchronously calls the given method without any arguments on the main controller.- Type Parameters:
R- the return type of the method declaration.- Parameters:
methodName- the method name.- Returns:
- a future instance which gives feedback about the asynchronously method call and when the result is available.
-
callMethodAsync
<R,T> Future<org.openbase.jul.communication.data.RPCResponse<R>> callMethodAsync(String methodName, Class<R> returnClazz, T argument) Method asynchronously calls the given method on the main controller.- Type Parameters:
R- the return type of the method declaration.T- the argument type of the method.- Parameters:
methodName- the method name.argument- the method argument.- Returns:
- a future instance which gives feedback about the asynchronously method call and when the result is available.
-