Module jdk.dynalink

Class AbstractRelinkableCallSite

    • Method Detail

      • initialize

        public void initialize​(MethodHandle relinkAndInvoke)
        Description copied from interface: RelinkableCallSite
        Invoked by dynamic linker to initialize the relinkable call site by setting a relink-and-invoke method handle. The call site implementation is supposed to set this method handle as its target using CallSite.setTarget(MethodHandle). Relink-and-invoke is the initial method handle set by DynamicLinker.link(RelinkableCallSite) that will cause the call site to be relinked to an appropriate target on its first invocation based on its arguments, and that linked target will then be invoked (hence the name). This linking protocol effectively delays linking until the call site is invoked with actual arguments and thus ensures that linkers can make nuanced linking decisions based on those arguments and not just on the static method type of the call site.
        Specified by:
        initialize in interface RelinkableCallSite
        Parameters:
        relinkAndInvoke - a relink-and-invoke method handle supplied by Dynalink.