< prev index next >

src/jdk.dynalink/share/classes/module-info.java

Print this page




   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /**
  27  * Dynalink



































  28  */
  29 module jdk.dynalink {
  30     requires java.logging;
  31 
  32     exports jdk.dynalink;
  33     exports jdk.dynalink.beans;
  34     exports jdk.dynalink.linker;
  35     exports jdk.dynalink.linker.support;
  36     exports jdk.dynalink.support;
  37 
  38     uses jdk.dynalink.linker.GuardingDynamicLinkerExporter;
  39 }
  40 


   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /**
  27  * <p>
  28  * Dynalink is a library for dynamic linking of high-level operations on objects.
  29  * These operations include "read a property",
  30  * "write a property", "invoke a function" and so on. Dynalink is primarily
  31  * useful for implementing programming languages where at least some expressions
  32  * have dynamic types (that is, types that can not be decided statically), and
  33  * the operations on dynamic types are expressed as
  34  * {@link java.lang.invoke.CallSite call sites}. These call sites will be
  35  * linked to appropriate target {@link java.lang.invoke.MethodHandle method handles}
  36  * at run time based on actual types of the values the expressions evaluated to.
  37  * These can change between invocations, necessitating relinking the call site
  38  * multiple times to accommodate new types; Dynalink handles all that and more.
  39  * <p>
  40  * Dynalink supports implementation of programming languages with object models
  41  * that differ (even radically) from the JVM's class-based model and have their
  42  * custom type conversions.
  43  * <p>
  44  * Dynalink is closely related to, and relies on, the {@link java.lang.invoke}
  45  * package.
  46  * <p>
  47  *
  48  * While {@link java.lang.invoke} provides a low level API for dynamic linking
  49  * of {@code invokedynamic} call sites, it does not provide a way to express
  50  * higher level operations on objects, nor methods that implement them. These
  51  * operations are the usual ones in object-oriented environments: property
  52  * access, access of elements of collections, invocation of methods and
  53  * constructors (potentially with multiple dispatch, e.g. link- and run-time
  54  * equivalents of Java overloaded method resolution). These are all functions
  55  * that are normally desired in a language on the JVM. If a language is
  56  * statically typed and its type system matches that of the JVM, it can
  57  * accomplish this with use of the usual invocation, field access, etc.
  58  * instructions (e.g. {@code invokevirtual}, {@code getfield}). However, if the
  59  * language is dynamic (hence, types of some expressions are not known until
  60  * evaluated at run time), or its object model or type system don't match
  61  * closely that of the JVM, then it should use {@code invokedynamic} call sites
  62  * instead and let Dynalink manage them.
  63  */
  64 module jdk.dynalink {
  65     requires java.logging;
  66 
  67     exports jdk.dynalink;
  68     exports jdk.dynalink.beans;
  69     exports jdk.dynalink.linker;
  70     exports jdk.dynalink.linker.support;
  71     exports jdk.dynalink.support;
  72 
  73     uses jdk.dynalink.linker.GuardingDynamicLinkerExporter;
  74 }
  75 
< prev index next >