nashorn/src/jdk.scripting.nashorn/share/classes/jdk/internal/dynalink/GuardedInvocationFilter.java
changeset 33333 0bad500ce4e0
parent 33330 35531ae624ef
equal deleted inserted replaced
33332:f180be6368d8 33333:0bad500ce4e0
    86 import jdk.internal.dynalink.linker.GuardedInvocation;
    86 import jdk.internal.dynalink.linker.GuardedInvocation;
    87 import jdk.internal.dynalink.linker.LinkRequest;
    87 import jdk.internal.dynalink.linker.LinkRequest;
    88 import jdk.internal.dynalink.linker.LinkerServices;
    88 import jdk.internal.dynalink.linker.LinkerServices;
    89 
    89 
    90 /**
    90 /**
    91  * Interface for objects that are used to transform one guarded invocation into another one. Typical usage is for
    91  * Interface for objects that are used to transform one guarded invocation into
    92  * implementing {@link DynamicLinkerFactory#setPrelinkFilter(GuardedInvocationFilter) pre-link filters}.
    92  * another one. Typical usage is for implementing
       
    93  * {@link DynamicLinkerFactory#setPrelinkFilter(GuardedInvocationFilter)
       
    94  * pre-link filters}.
    93  */
    95  */
    94 @FunctionalInterface
    96 @FunctionalInterface
    95 public interface GuardedInvocationFilter {
    97 public interface GuardedInvocationFilter {
    96     /**
    98     /**
    97      * Given a guarded invocation, return a potentially different guarded invocation.
    99      * Given a guarded invocation, return either the same or potentially
    98      * @param inv the original guarded invocation. Null is never passed.
   100      * different guarded invocation.
    99      * @param linkRequest the link request for which the invocation was generated (usually by some linker).
   101      * @param inv the original guarded invocation.
   100      * @param linkerServices the linker services that can be used during creation of a new invocation.
   102      * @param linkRequest the link request for which the invocation was
   101      * @return either the passed guarded invocation or a different one, with the difference usually determined based on
   103      * generated (usually by some linker).
   102      * information in the link request and the differing invocation created with the assistance of the linker services.
   104      * @param linkerServices the linker services that can be used during
   103      * Whether or not {@code null} is an accepted return value is dependent on the user of the filter.
   105      * creation of a new invocation.
       
   106      * @return either the passed guarded invocation or a different one, with
       
   107      * the difference usually determined based on information in the link
       
   108      * request and the differing invocation created with the assistance of the
       
   109      * linker services. Whether or not {@code null} is an accepted return value
       
   110      * is dependent on the user of the filter.
       
   111      * @throws NullPointerException is allowed if any of the passed arguments
       
   112      * is null.
   104      */
   113      */
   105     public GuardedInvocation filter(GuardedInvocation inv, LinkRequest linkRequest, LinkerServices linkerServices);
   114     public GuardedInvocation filter(GuardedInvocation inv, LinkRequest linkRequest, LinkerServices linkerServices);
   106 }
   115 }