Interface DeploymentLinker<T>


public interface DeploymentLinker<T>
Creates "links" to objects between deployment and runtime, essentially exposing the same interface but on a different classloader.

This implies all communication must go through JDK classes, so the transfer involves Maps, Functions, ... Yes this is awful. No there's no better solution ATM. Ideally we'd automate this through bytecode generation, but feasibility is uncertain, and we'd need a volunteer who has time for that.

Implementations should live in the runtime module. To transfer link data between deployment and runtime, see DevConsoleManager.setGlobal(String, Object) and DevConsoleManager.getGlobal(String).

  • Method Details

    • createLinkData

      Map<String,?> createLinkData(T object)
      Parameters:
      object - An object implementing class T in either the current classloader.
      Returns:
      A classloader-independent map containing Functions, Suppliers, etc. giving access to the object's methods, which will be passed to createLink(Map) from the other classloader.
    • createLink

      T createLink(Map<String,?> linkData)
      Parameters:
      linkData - The result of calling createLinkData(Object).
      Returns:
      An object implementing class T in the current classloader and redirecting calls to the Functions, Suppliers, etc. from linkData, thereby linking to the implementation in its original classloader.