---
title: "NFIBackendSignatureLibrary"
description: "Library that specifies the protocol between the Truffle NFI and its backend implementations."
kind: "abstract class"
id: "com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureLibrary"
module: "truffle-nfi"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/truffle-nfi/com/oracle/truffle/nfi/backend/spi/NFIBackendSignatureLibrary.html"
---

# ◆ NFIBackendSignatureLibrary

[truffle-nfi](../../../../../../index.md) › [com.oracle.truffle.nfi.backend.spi](index.md) · Every page: [llms.txt](../../../../../../llms.txt)

Abstract class in [`com.oracle.truffle.nfi.backend.spi`](index.md).

```java
public abstract class NFIBackendSignatureLibrary extends Library
```

Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > [`Node`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html) > [`Library`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/library/Library.html) > `NFIBackendSignatureLibrary`

Library that specifies the protocol between the Truffle NFI and its backend implementations.

## Constructors

### NFIBackendSignatureLibrary()
<a id="&lt;init&gt;()"></a>`public NFIBackendSignatureLibrary()`. Declared by the compiler. Creates a new NFIBackendSignatureLibrary instance. Cite: `com/oracle/truffle/nfi/backend/spi/NFIBackendSignatureLibrary.html#<init>()`

## Methods

### call(Object, Object, Object...)
<a id="call(java.lang.Object,java.lang.Object,java.lang.Object...)"></a>`public abstract Object call(Object signature, Object functionPointer, Object... args) throws ArityException, UnsupportedTypeException, UnsupportedMessageException`. Call a native function with this signature. Cite: `com/oracle/truffle/nfi/backend/spi/NFIBackendSignatureLibrary.html#call(java.lang.Object,java.lang.Object,java.lang.Object...)`

### createClosure(Object, Object)
<a id="createClosure(java.lang.Object,java.lang.Object)"></a>`public abstract Object createClosure(Object signature, Object executable)`. Create a function pointer closure that calls back into an executable object. This message must return something that's compatible with `NativeSimpleType.POINTER`. The returned pointer should be a function pointer. Calling that function pointer sends the [`InteropLibrary.execute`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/interop/InteropLibrary.html#execute%28java.lang.Object,java.lang.Object...%29) message to the executable object. The returned object should not be executable. NFI backends can assume that the execute message of the executable object will never throw. Exceptions are instead stored as "pending" and rethrown at the next managed frame. Before an upcall, backends must save and clear any earlier pending exception using `NFIState.savePendingException()`. They must restore it using `NFIState.restorePendingException(Throwable)` in a `finally` block after the upcall. This scope must include argument and return conversion so nested native calls see a clean exception state and successful upcalls still return their results to native code. An earlier pending exception takes precedence over an exception from the new upcall. Cite: `com/oracle/truffle/nfi/backend/spi/NFIBackendSignatureLibrary.html#createClosure(java.lang.Object,java.lang.Object)`

## Inherited members

- From class [`Library`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/library/Library.html): [`accepts`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/library/Library.html#accepts%28java.lang.Object%29)
- From class [`Node`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html): [`accept`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#accept%28com.oracle.truffle.api.nodes.NodeVisitor%29), [`adoptChildren`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#adoptChildren%28%29), [`atomic`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#atomic%28java.lang.Runnable%29), [`atomic`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#atomic%28java.util.concurrent.Callable%29), [`copy`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#copy%28%29), [`deepCopy`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#deepCopy%28%29), [`getChildren`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getChildren%28%29), [`getCost`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getCost%28%29), [`getDebugProperties`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getDebugProperties%28%29), [`getDescription`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getDescription%28%29), [`getEncapsulatingSourceSection`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getEncapsulatingSourceSection%28%29), [`getLock`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getLock%28%29), [`getParent`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getParent%28%29), [`getRootNode`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getRootNode%28%29), [`getSourceSection`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#getSourceSection%28%29), [`insert`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#insert%28T%29), [`insert`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#insert%28T[]%29), [`isAdoptable`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#isAdoptable%28%29), [`isSafelyReplaceableBy`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#isSafelyReplaceableBy%28com.oracle.truffle.api.nodes.Node%29), [`notifyInserted`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#notifyInserted%28com.oracle.truffle.api.nodes.Node%29), [`onReplace`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#onReplace%28com.oracle.truffle.api.nodes.Node,java.lang.CharSequence%29), [`replace`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#replace%28T%29), [`replace`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#replace%28T,java.lang.CharSequence%29), [`reportPolymorphicSpecialize`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#reportPolymorphicSpecialize%28%29), [`reportReplace`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#reportReplace%28com.oracle.truffle.api.nodes.Node,com.oracle.truffle.api.nodes.Node,java.lang.CharSequence%29), [`toString`](https://graalvm.elide.help/25.6.0-elide.4/api/truffle-api/com/oracle/truffle/api/nodes/Node.html#toString%28%29)
- From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`clone`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#clone%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`finalize`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#finalize%28%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)
