Top Inners Fields Constructors Methods
jnr.ffi.provider.jffi

public final Class NativeClosureFactory<T>

extends Object
Class Inheritance
Imports
com.kenai.jffi.CallContext, .Closure, .ClosureMagazine, .ClosureManager, jnr.ffi.Pointer, jnr.ffi.annotations.Delegate, jnr.ffi.mapper.SignatureTypeMapper, jnr.ffi.provider.FromNativeType, .ToNativeType, jnr.ffi.util.ref.FinalizableWeakReference, java.lang.reflect.Method, .Modifier, java.util.concurrent.ConcurrentHashMap, .ConcurrentLinkedQueue, .ConcurrentMap

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final CallContext
private final NativeClosureProxy.Factory
private final ConcurrentMap<Integer, NativeClosureFactory<T>.ClosureReference>
private ClosureMagazine
private final ConcurrentLinkedQueue<NativeClosurePointer>
private final Runtime

Constructor Summary

AccessConstructor and Description
protected
NativeClosureFactory(Runtime runtime, CallContext callContext, NativeClosureProxy.Factory closureProxyFactory)

Method Summary

Modifier and TypeMethod and Description
pack-priv NativeClosurePointer
private void
pack-priv NativeClosureFactory<T>.ClosureReference
pack-priv NativeClosurePointer
newClosure(Object callable, Integer key)

pack-priv static <T> NativeClosureFactory<T>
newClosureFactory(Runtime runtime, Class<T> closureClass, SignatureTypeMapper typeMapper, AsmClassLoader classLoader)

pack-priv NativeClosureFactory<T>.ClosureReference
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callContextback to summary
private final CallContext callContext
closureProxyFactoryback to summary
private final NativeClosureProxy.Factory closureProxyFactory
closuresback to summary
private final ConcurrentMap<Integer, NativeClosureFactory<T>.ClosureReference> closures
currentMagazineback to summary
private ClosureMagazine currentMagazine
freeQueueback to summary
private final ConcurrentLinkedQueue<NativeClosurePointer> freeQueue
runtimeback to summary
private final Runtime runtime

Constructor Detail

NativeClosureFactoryback to summary
protected NativeClosureFactory(Runtime runtime, CallContext callContext, NativeClosureProxy.Factory closureProxyFactory)

Method Detail

allocateClosurePointerback to summary
pack-priv NativeClosurePointer allocateClosurePointer()
expungeback to summary
private void expunge(NativeClosureFactory<T>.ClosureReference ref, Integer key)
getClosureReferenceback to summary
pack-priv NativeClosureFactory<T>.ClosureReference getClosureReference(Object callable)
newClosureback to summary
pack-priv NativeClosurePointer newClosure(Object callable, Integer key)
newClosureFactoryback to summary
pack-priv static <T> NativeClosureFactory<T> newClosureFactory(Runtime runtime, Class<T> closureClass, SignatureTypeMapper typeMapper, AsmClassLoader classLoader)
newClosureReferenceback to summary
pack-priv NativeClosureFactory<T>.ClosureReference newClosureReference(Object callable, Integer key)
recycleback to summary
private void recycle(NativeClosurePointer ptr)
jnr.ffi.provider.jffi back to summary

pack-priv final Class NativeClosureFactory.ClosureReference

extends FinalizableWeakReference<Object>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final NativeClosureFactory<T>
private final Integer
pack-priv volatile NativeClosureFactory<T>.ClosureReference
private final NativeClosurePointer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
finalizeReferent()

Implements jnr.ffi.util.ref.FinalizableReference.finalizeReferent.

Invoked on a background thread after the referent has been garbage collected unless security restrictions prevented starting a background thread, in which case this method is invoked when new references are created.
pack-priv Object
pack-priv Pointer

Field Detail

factoryback to summary
private final NativeClosureFactory<T> factory
keyback to summary
private final Integer key
nextback to summary
pack-priv volatile NativeClosureFactory<T>.ClosureReference next

Hides java.lang.ref.Reference.next.

pointerback to summary
private final NativeClosurePointer pointer

Constructor Detail

ClosureReferenceback to summary
private ClosureReference(Object referent, Integer key, NativeClosureFactory<T> factory, NativeClosurePointer pointer)

Method Detail

finalizeReferentback to summary
public void finalizeReferent()

Implements jnr.ffi.util.ref.FinalizableReference.finalizeReferent.

Doc from jnr.ffi.util.ref.FinalizableReference.finalizeReferent.

Invoked on a background thread after the referent has been garbage collected unless security restrictions prevented starting a background thread, in which case this method is invoked when new references are created.

getCallableback to summary
pack-priv Object getCallable()
getPointerback to summary
pack-priv Pointer getPointer()