< prev index next >

nashorn/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  * <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>


 200  * that implements the usual Java semantics for all of the above operations and
 201  * can link any Java object that no other language-specific linker has managed
 202  * to link. This way, all language runtimes have built-in interoperability with
 203  * ordinary Java objects. See {@link jdk.dynalink.beans.BeansLinker} for details
 204  * on how it links the various operations.
 205  * <h2>Cross-language interoperability</h2>
 206  * A {@code DynamicLinkerFactory} can be configured with a
 207  * {@link jdk.dynalink.DynamicLinkerFactory#setClassLoader(ClassLoader) class
 208  * loader}. It will try to instantiate all
 209  * {@link jdk.dynalink.linker.GuardingDynamicLinkerExporter} classes visible to
 210  * that class loader and compose the linkers they provide into the
 211  * {@code DynamicLinker} it creates. This allows for interoperability between
 212  * languages: if you have two language runtimes A and B deployed in your JVM and
 213  * they export their linkers through the above mechanism, language runtime A
 214  * will have a language-specific linker instance from B and vice versa inside
 215  * their {@code DynamicLinker} objects. This means that if an object from
 216  * language runtime B gets passed to code from language runtime A, the linker
 217  * from B will get a chance to link the call site in A when it encounters the
 218  * object from B.
 219  *


 220  * @moduleGraph
 221  * @since 9
 222  */
 223 module jdk.dynalink {
 224     requires java.logging;
 225 
 226     exports jdk.dynalink;
 227     exports jdk.dynalink.beans;
 228     exports jdk.dynalink.linker;
 229     exports jdk.dynalink.linker.support;
 230     exports jdk.dynalink.support;
 231 
 232     uses jdk.dynalink.linker.GuardingDynamicLinkerExporter;
 233 }
 234 


   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  * Defines the API for dynamic linking of high-level operations on objects.
  28  * <p>
  29  * Dynalink is a library for dynamic linking of high-level operations on objects.
  30  * These operations include "read a property",
  31  * "write a property", "invoke a function" and so on. Dynalink is primarily
  32  * useful for implementing programming languages where at least some expressions
  33  * have dynamic types (that is, types that can not be decided statically), and
  34  * the operations on dynamic types are expressed as
  35  * {@link java.lang.invoke.CallSite call sites}. These call sites will be
  36  * linked to appropriate target {@link java.lang.invoke.MethodHandle method handles}
  37  * at run time based on actual types of the values the expressions evaluated to.
  38  * These can change between invocations, necessitating relinking the call site
  39  * multiple times to accommodate new types; Dynalink handles all that and more.
  40  * <p>
  41  * Dynalink supports implementation of programming languages with object models
  42  * that differ (even radically) from the JVM's class-based model and have their
  43  * custom type conversions.
  44  * <p>
  45  * Dynalink is closely related to, and relies on, the {@link java.lang.invoke}
  46  * package.
  47  * <p>


 201  * that implements the usual Java semantics for all of the above operations and
 202  * can link any Java object that no other language-specific linker has managed
 203  * to link. This way, all language runtimes have built-in interoperability with
 204  * ordinary Java objects. See {@link jdk.dynalink.beans.BeansLinker} for details
 205  * on how it links the various operations.
 206  * <h2>Cross-language interoperability</h2>
 207  * A {@code DynamicLinkerFactory} can be configured with a
 208  * {@link jdk.dynalink.DynamicLinkerFactory#setClassLoader(ClassLoader) class
 209  * loader}. It will try to instantiate all
 210  * {@link jdk.dynalink.linker.GuardingDynamicLinkerExporter} classes visible to
 211  * that class loader and compose the linkers they provide into the
 212  * {@code DynamicLinker} it creates. This allows for interoperability between
 213  * languages: if you have two language runtimes A and B deployed in your JVM and
 214  * they export their linkers through the above mechanism, language runtime A
 215  * will have a language-specific linker instance from B and vice versa inside
 216  * their {@code DynamicLinker} objects. This means that if an object from
 217  * language runtime B gets passed to code from language runtime A, the linker
 218  * from B will get a chance to link the call site in A when it encounters the
 219  * object from B.
 220  *
 221  * @uses jdk.dynalink.linker.GuardingDynamicLinkerExporter
 222  *
 223  * @moduleGraph
 224  * @since 9
 225  */
 226 module jdk.dynalink {
 227     requires java.logging;
 228 
 229     exports jdk.dynalink;
 230     exports jdk.dynalink.beans;
 231     exports jdk.dynalink.linker;
 232     exports jdk.dynalink.linker.support;
 233     exports jdk.dynalink.support;
 234 
 235     uses jdk.dynalink.linker.GuardingDynamicLinkerExporter;
 236 }
 237 
< prev index next >