Package jnr.ffi.provider
Class NativeInvocationHandler
- java.lang.Object
-
- jnr.ffi.provider.NativeInvocationHandler
-
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
public class NativeInvocationHandler extends java.lang.Object implements java.lang.reflect.InvocationHandler
InvocationHandler used to map invocations on a java interface to the correct native function.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.reflect.Method,Invoker>
fastLookupTable
private java.util.Map<java.lang.reflect.Method,Invoker>
invokerMap
-
Constructor Summary
Constructors Constructor Description NativeInvocationHandler(java.util.Map<java.lang.reflect.Method,Invoker> invokers)
Creates a new InvocationHandler instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
invoke(java.lang.Object self, java.lang.reflect.Method method, java.lang.Object[] argArray)
private Invoker
lookupAndCacheInvoker(java.lang.reflect.Method method)
-
-
-
Constructor Detail
-
NativeInvocationHandler
public NativeInvocationHandler(java.util.Map<java.lang.reflect.Method,Invoker> invokers)
Creates a new InvocationHandler instance.- Parameters:
invokers
- A map of method invokers
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object self, java.lang.reflect.Method method, java.lang.Object[] argArray) throws java.lang.Throwable
- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
-
lookupAndCacheInvoker
private Invoker lookupAndCacheInvoker(java.lang.reflect.Method method)
-
-