1 /*
2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
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  * Provides the <em>{@index jshell jshell tool}</em> tool for evaluating
28  * snippets of Java code, and defines a JDK-specific API for modeling and
29  * executing snippets.
30  * The JShell API supports Java Programming Language 'snippet' evaluating
31  * tools, such as Read-Eval-Print Loops (REPLs).
32  * Separate packages support building tools, configuring the execution of tools,
33  * and programmatically launching the existing Java shell tool.
34  * <p>
35  *     The {@link jdk.jshell} is the package for creating 'snippet' evaluating tools.
36  *     Generally, this is only package that would be needed for creating tools.
37  * </p>
38  * <p>
39  *     The {@link jdk.jshell.spi} package specifies a Service Provider Interface (SPI)
40  *     for defining execution engine implementations for tools based on the
41  *     {@link jdk.jshell} API. The {@link jdk.jshell.execution} package provides
42  *     standard implementations of {@link jdk.jshell.spi} interfaces and supporting code.  It
43  *     also serves as a library of functionality for defining new execution engine
44  *     implementations.
45  * </p>
46  * <p>
47  *     The {@link jdk.jshell.tool} package supports programmatically launching the
48  *     <em>jshell</em> tool.
49  * </p>
50  * <p>
51  *     The {@link jdk.jshell.execution} package contains implementations of the
52  *     interfaces in {@link jdk.jshell.spi}.  Otherwise, the four packages are
53  *     independent, operate at different levels, and do not share functionality or
54  *     definitions.
55  * </p>
56  *
57  * @toolGuide jshell
58  *
59  * @provides javax.tools.Tool
60  * @provides jdk.jshell.spi.ExecutionControlProvider
61  * @uses jdk.jshell.spi.ExecutionControlProvider
62  *
63  * @moduleGraph
64  * @since 9
65  */
66 module jdk.jshell {
67     requires java.logging;
68     requires jdk.compiler;
69     requires jdk.internal.ed;
70     requires jdk.internal.le;
71     requires jdk.internal.opt;
72 
73     requires transitive java.compiler;
74     requires transitive java.prefs;
75     requires transitive jdk.jdi;
76 
77     exports jdk.jshell;
78     exports jdk.jshell.execution;
79     exports jdk.jshell.spi;
80     exports jdk.jshell.tool;
81 
82     uses jdk.jshell.spi.ExecutionControlProvider;
83     uses jdk.internal.editor.spi.BuildInEditorProvider;
84 
85     provides javax.tools.Tool with
86         jdk.internal.jshell.tool.JShellToolProvider;
87     provides jdk.jshell.spi.ExecutionControlProvider with
88         jdk.jshell.execution.JdiExecutionControlProvider,
89         jdk.jshell.execution.LocalExecutionControlProvider,
90         jdk.jshell.execution.FailOverExecutionControlProvider;
91 }
92