EnclaveInvocationResult InvokeEnclaveMethod()

in sdk/host/src/main/java/org/apache/teaclave/javasdk/host/AbstractEnclave.java [170:183]


    EnclaveInvocationResult InvokeEnclaveMethod(EnclaveInvocationContext input) throws EnclaveMethodInvokingException {
        if (!getEnclaveContext().getEnclaveToken().tryAcquireToken()) {
            throw new EnclaveMethodInvokingException("enclave was destroyed.");
        }
        try {
            EnclaveInvocationResult resultWrapper;
            resultWrapper = (EnclaveInvocationResult) SerializationHelper.deserialize(invokeMethodNative(input));
            return resultWrapper;
        } catch (IOException | ClassNotFoundException e) {
            throw new EnclaveMethodInvokingException("EnclaveInvokeResultWrapper deserialization failed.", e);
        } finally {
            getEnclaveContext().getEnclaveToken().restoreToken();
        }
    }