Invocation context from .NET DLL in Java

Calling any method on Runtime Context creates new instance of Invocation Context.

// use activate only once in your app

// create called runtime context
RuntimeContext calledRuntime = Javonet.inMemory().netcore();

// construct an invocation context - this invocationContext in non-materialized
InvocationContext invocationContext = calledRuntime.getType("System.Math").invokeStaticMethod("Abs", -50);

// execute invocation context - this will materialize the invocationContext
InvocationContext response = invocationContext.execute();

Navigation through the methods on different variations of Invocation Context allows to construct the chain of invocations. Those chains of invocation represent the non-materialized expression of interaction with libraries, types, and any programming entities in target technology.

In order to materialize expression, a call to called technology needs to be invoked with Execute method