[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-net-dev
Subject:    Re: New candidate JEP: 408: Simple Web Server
From:       Alex Buckley <alex.buckley () oracle ! com>
Date:       2021-03-30 17:10:49
Message-ID: 815f10e2-9bf0-d7aa-eeee-5209dd8ee882 () oracle ! com
[Download RAW message or body]

Further to Julia's comments:

All of the com.sun namespace is JDK-specific -- it's not part of the 
Java SE Platform API.

Around 90% of the com.sun namespace is internal to the JDK -- not 
intended for use outside the JDK. An example is the 
com.sun.security.ntlm package in the java.base module.

Around 10% of the com.sun namespace is supported for use outside the 
JDK. Examples of supported com.sun APIs include:

- The Compiler Tree API (four com.sun packages exported by the 
jdk.compiler module)
- The HTTP Server API (two com.sun packages exported by the 
jdk.httpserver module)
- The SCTP API (the com.sun.nio.sctp package exported by the jdk.sctp 
module)
- JDK-specific extensions to the NIO API (the com.sun.nio.file package 
exported by the jdk.unsupported module)

You can view a list of the internal com.sun packages and the supported 
com.sun packages at 
https://cr.openjdk.java.net/~mr/jigsaw/jdk8-packages-strongly-encapsulated

To aid migration, all of the com.sun packages were open for reflection 
_by default_ in JDK 9 through 15. Things were tightened up in JDK 16, 
and from JDK 17 you will need to use `--add-opens` if your application 
or library code wants to reflect over a com.sun package. You will still 
be able to program directly against the _supported_ com.sun packages, 
such as the HTTP Server API.

Finally, a related point:  The sun.misc package has been exported and 
available for reflection since JDK 9. It was neither removed nor 
strongly encapsulated in JDK 9. It was available in JDK 9, and continues 
to be available in JDK 17.

Alex

On 3/29/2021 10:51 PM, Krzysztof K. wrote:
> Hi,
> Is there a plan to change the package name?
> I always thought that com.sun.* package was for old internal code and I
> assume I'm not the only one.
> 
> Regards,
> Krzysztof Krason
> 
> On Mon, Mar 29, 2021 at 9:16 PM <mark.reinhold@oracle.com> wrote:
> 
>> https://openjdk.java.net/jeps/408
>>
>>    Summary: Provide a command-line tool to start a minimal web server
>>    that serves static files in the current directory. This low-threshold
>>    utility will be useful for prototyping, ad-hoc coding, and testing
>>    purposes, particularly in educational contexts.
>>
>> - Mark
>>
> 
> 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic