Top Fields Constructors Methods
org.freedesktop.dbus

public Class RemoteInvocationHandler

extends Object
implements InvocationHandler
Class Inheritance
All Implemented Interfaces
java.lang.reflect.InvocationHandler
Imports
org.freedesktop.dbus.annotations.DBusBoundProperty, .MethodNoReply, org.freedesktop.dbus.connections.AbstractConnection, org.freedesktop.dbus.errors.NoReply, org.freedesktop.dbus.exceptions.DBusException, .DBusExecutionException, .NotConnected, org.freedesktop.dbus.interfaces.CallbackHandler, .DBusInterface, org.freedesktop.dbus.messages.Error, .Message, .MethodCall, org.freedesktop.dbus.messages.constants.Flags, org.freedesktop.dbus.propertyref.PropRefRemoteHandler, org.freedesktop.dbus.utils.DBusNamingUtil, .LoggingHelper, org.slf4j.Logger, .LoggerFactory, java.lang.reflect.*, java.util.Arrays

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
pack-priv AbstractConnection
private static final Logger
pack-priv RemoteObject

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Object
public static Object
convertRV(Object[] _rp, Type[] _types, Method _m, AbstractConnection _conn)

public static Object
executeRemoteMethod(final RemoteObject _ro, final Method _m, final AbstractConnection _conn, final int _syncmethod, final CallbackHandler<?> _callback, Object... _args)

public static Object

Returns:

Object, maybe null
executeRemoteMethod
(final RemoteObject
remote object
_ro
,
final Method
method to call
_m
,
String[]
array of custom signatures which will be used for variants
_customSignatures
,
final Type[]
array of types
_types
,
final AbstractConnection
connection
_conn
,
final int
true if the method is executed synchronously
_syncmethod
,
final CallbackHandler<?>
callback used when async method call
_callback
,
Object...
arguments to pass to method
_args
)

Executes a remote method.

public static Object
executeRemoteMethod(final RemoteObject _ro, final Method _m, final Type[] _types, final AbstractConnection _conn, final int _syncmethod, final CallbackHandler<?> _callback, Object... _args)

public RemoteObject
public Object
invoke(Object
the proxy instance that the method was invoked on
_proxy
,
Method
the Method instance corresponding to the interface method invoked on the proxy instance. The declaring class of the Method object will be the interface that the method was declared in, which may be a superinterface of the proxy interface that the proxy class inherits the method through.
_method
,
Object[]
an array of objects containing the values of the arguments passed in the method invocation on the proxy instance, or null if interface method takes no arguments. Arguments of primitive types are wrapped in instances of the appropriate primitive wrapper class, such as java.lang.Integer or java.lang.Boolean.
_args
)

Implements java.lang.reflect.InvocationHandler.invoke.

Processes a method invocation on a proxy instance and returns the result.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CALL_TYPE_ASYNCback to summary
public static final int CALL_TYPE_ASYNC
CALL_TYPE_CALLBACKback to summary
public static final int CALL_TYPE_CALLBACK
CALL_TYPE_SYNCback to summary
public static final int CALL_TYPE_SYNC
connback to summary
pack-priv AbstractConnection conn
LOGGERback to summary
private static final Logger LOGGER
remoteback to summary
pack-priv RemoteObject remote

Constructor Detail

RemoteInvocationHandlerback to summary
public RemoteInvocationHandler(AbstractConnection _conn, RemoteObject _remote)

Method Detail

convertRVback to summary
public static Object convertRV(Object[] _rp, Method _m, AbstractConnection _conn) throws DBusException
convertRVback to summary
public static Object convertRV(Object[] _rp, Type[] _types, Method _m, AbstractConnection _conn) throws DBusException
executeRemoteMethodback to summary
public static Object executeRemoteMethod(final RemoteObject _ro, final Method _m, final AbstractConnection _conn, final int _syncmethod, final CallbackHandler<?> _callback, Object... _args) throws DBusException
executeRemoteMethodback to summary
public static Object executeRemoteMethod(final RemoteObject _ro, final Method _m, String[] _customSignatures, final Type[] _types, final AbstractConnection _conn, final int _syncmethod, final CallbackHandler<?> _callback, Object... _args) throws DBusException

Executes a remote method.

Parameters
_ro:RemoteObject

remote object

_m:Method

method to call

_customSignatures:String[]

array of custom signatures which will be used for variants

_types:Type[]

array of types

_conn:AbstractConnection

connection

_syncmethod:int

true if the method is executed synchronously

_callback:CallbackHandler<?>

callback used when async method call

_args:Object[]

arguments to pass to method

Returns:Object

Object, maybe null

Exceptions
DBusException:
when call fails
executeRemoteMethodback to summary
public static Object executeRemoteMethod(final RemoteObject _ro, final Method _m, final Type[] _types, final AbstractConnection _conn, final int _syncmethod, final CallbackHandler<?> _callback, Object... _args) throws DBusException
getRemoteback to summary
public RemoteObject getRemote()
invokeback to summary
public Object invoke(Object _proxy, Method _method, Object[] _args) throws Throwable

Implements java.lang.reflect.InvocationHandler.invoke.

Doc from java.lang.reflect.InvocationHandler.invoke.

Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.

Parameters
_proxy:Object

the proxy instance that the method was invoked on

_method:Method

the Method instance corresponding to the interface method invoked on the proxy instance. The declaring class of the Method object will be the interface that the method was declared in, which may be a superinterface of the proxy interface that the proxy class inherits the method through.

_args:Object[]

an array of objects containing the values of the arguments passed in the method invocation on the proxy instance, or null if interface method takes no arguments. Arguments of primitive types are wrapped in instances of the appropriate primitive wrapper class, such as java.lang.Integer or java.lang.Boolean.

Returns:Object

the value to return from the method invocation on the proxy instance. If the declared return type of the interface method is a primitive type, then the value returned by this method must be an instance of the corresponding primitive wrapper class; otherwise, it must be a type assignable to the declared return type. If the value returned by this method is null and the interface method's return type is primitive, then a NullPointerException will be thrown by the method invocation on the proxy instance. If the value returned by this method is otherwise not compatible with the interface method's declared return type as described above, a ClassCastException will be thrown by the method invocation on the proxy instance.

Annotations
@Override
Exceptions
Throwable:
the exception to throw from the method invocation on the proxy instance. The exception's type must be assignable either to any of the exception types declared in the throws clause of the interface method or to the unchecked exception types java.lang.RuntimeException or java.lang.Error. If a checked exception is thrown by this method that is not assignable to any of the exception types declared in the throws clause of the interface method, then an UndeclaredThrowableException containing the exception that was thrown by this method will be thrown by the method invocation on the proxy instance.