JEP 125: Network Interface Aliases, Events, and Defaults

OwnerMichael McMahon
Created2011/09/23 20:00
Updated2014/07/10 20:49
TypeFeature
StatusCandidate
Componentcore-libs / java.net
ScopeSE
Discussionnet dash dev at openjdk dot java dot net
EffortM
DurationM
Priority4
Endorsed byBrian Goetz
Issue8046115
Relates to7094167: JDK8 embedded networking requirements

Summary

Extend the existing network-interface APIs to support interface aliases, up/down transition events, and default interface preferences.

Motivation

These enhancements will allow Java SE to work well in devices with multiple network interface types (e.g., both wifi and cellular) whose status varies over time depending upon the networks available.

Description

  1. Define aliasing support so that network interfaces can be referred to by well-known names such as "cellular" rather than hardware platform-specific OS device names.

  2. Provide the ability to listen for network interface up/down transitions.

  3. Provide an API to list one or more default network interfaces that will be used when sockets are created if the socket being created is not bound to a specific local address (and hence network interface). This needs to be done in such a way that socket creation performed by library code on behalf of the application will be affected as well. In other words, if an application is using, say, the JAX-RS client API, the socket(s) created by the JAX-RS implementation should be affected by this API. If a list of more than one interfaces is provided, it should be treated as an ordered preference list. Ideally it should be possible to provide this API in such a way as to allow different applications running within the same VM to have different default network interface settings.

Dependences

Solving this problem may depend on some higher level abstraction of an application being defined in Java SE 8. Otherwise, it would depend on some existing entity like class loaders.

Impact