460 likes | 602 Views
CLDC 8: New Features and Opportunities for the Small Java Core Libraries. Michael Lagally Principal Member of Technical Staff Roger Riggs, Consulting Member of Technical Staff.
E N D
CLDC 8: New Features and Opportunities for the Small Java Core Libraries Michael Lagally Principal Member of Technical Staff Roger Riggs, Consulting Member of Technical Staff
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
CLDC 8 New Features and Opportunities for the Small Java Core Abstract: • CLDC has been the Java platform for connected devices such as feature phones since 2000. It is a platform for devices with very limited memory and CPU power. • Oracle is leading an effort to update the CLDC platform with support for Java 8 language features and new library APIs. The platform defines a state-of-the-art runtime environment for small embedded devices and provides a set of carefully defined libraries that are most useful on resource-constrained devices. • CLDC 8 targets embedded devices such as wireless modules, smart meters, and healthcare monitoring and other M2M devices. The CLDC 8 configuration is standardized in the Java community process as JSR 360, with experts from the embedded and mobile industry in the expert group.
Program Agenda • Java ME Evolution • Connected Limited Device Configuration (CLDC) • Generic Connection Framework (GCF)
The Next Generation: Java ME 8 Platform • Themes • Key Features • Target Markets • Java ME CLDC 8: Updated VM + alignment with Java SE 8 • Java ME Embedded Profile 8: Embedded application platform • Value-add new and enhanced APIs and features for embedded • Improved configurability and optimized footprint for deployment • Target requirements starting at 128 KB RAM, 1 MB Flash/ROM • First step in Java ME Java SE alignment • Dedicated embedded application platform • Address increased range of use cases and markets • Small to mid-embedded covering wide range of use cases/markets • Intelligent edge devices, communication nodes, healthcare devices, smart sensors, smart meters, general IoT and M2M
Java ME 8 Focus Platform Footprint • Java SE Java ME 10MB-100MB 1MB-10MB Java Card 50KB-1MB DeviceCPU/ GPU/I-O ARM 7 Cortex M ARM9/11 MIPS32 - ARM Cortex A – PPC - Intel Atom
Towards a Common Java • Key Principles • CLDC is a strict subset of Java SE • CLDC code works on Java SE • Java ME vs. Java SE is a footprint/functionality tradeoff • Java ME & Java SE release cycles are in sync Ensure close alignment between ME/SE • Modern and flexible platform for delivering embedded software • Unified development experience & community across Java • Aligned Java language, core APIs, development, and tools • Enable 9+ Million Java developers to develop for Java Embedded • Benefits
Java ME 8 Platform Overview Protocols and Data Conversion AdditionalOptional APIs Security and Management Wireless Communication Messaging AdditionalAPIs (Examples) AdditionalOptional JSRs Sensors Web Services Vertical Specific APIs Location On-Device I/O Access Generic Connection Framework Application Platform Security and Trust Services Java ME Embedded Profile (MEEP 8, JSR 361) Device I/O API GCF SATSA Java VM Java ME CLDC 8 (JSR 360, aligned with Java SE 8)
Sample prototyping board Small Embedded STM32F4 Discovery Board (Very Low Cost, ca. 15 USD) • STM32F407VGT6 microcontroller • 32-bit ARM Cortex-M4F core • 1 MB Flash • 192 KB RAM • 3-axis accelerometer • Omni-directional digital microphone • Audio DAC with integrated class D speaker driver • Eight LEDs, two push buttons (user and reset) • USB OTG FS with micro-AB connector Source: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/data_brief/DM00037955.pdf
Sample prototyping board Small Embedded Raspberry Pi (Low Cost, ca. 25 USD) • Broadcom BCM2835 • 700 MHz ARM1176JZF-S core • 512 MB RAM • 2 USB ports • SD card slot • Onboard Network • Audio / Video output
Program Agenda • Java ME Evolution • Connected Limited Device Configuration (CLDC) • Generic Connection Framework (GCF)
CLDC 8: an Evolutionary update for CLDC • Key Features • Synchronize with Java SE 8 Language Featuresinto Java ME • Add developer friendly APIs to Java ME from Java SE • Virtual Machine Update to align with developer tools • Remain small and enable footprint optimizations • Specification Characteristics • CLDC 8 is an extended strict subset of Java SE 8 • Consolidated Generic Connection Framework • Backward binary compatibility Java SE 8 CLDC 8
Configurations CLDC is scalable to small and very small devices
CLDC 8 Footprint Considerations Optimizing Footprint Even Further • Stripping On Deployment • For fixed-function, minimal footprint deployments • Allows bundling application with the runtime and then stripping away unnecessary components • Result: Minimal, non-modifiable binary containing application and runtime
Library Updates • CLDC Library • Platform extensibility via Service Providers (ServiceLoader) • EventObject and EventListener • Subset of NIO Buffers • NIO Files and NIO Channels • Logging • StringBuilder and String Formatter • Comparable interface • Try with resources – Closeable and AutoCloseable
Library Updates • New Collections • List – ArrayList, LinkedList • Map – HashMap, LinkedHashMap, WeakHashMap • Set – HashSet, LinkedHashSet • Queue – Deque, ArrayDeque • Iterable and Iterator, ListIterator
Focus on: Service Providers An extension mechanism for the Java platform • A service is a well-known set of interfaces and abstract classes that is implemented by a (service) provider. • Providers can be installed to extend the Java platform. • Providers are located and instantiated on demand. • Providers are identified via a provider-configuration file in the META-INF/services resource directory.
Service Providers - Example An extension mechanism for the Java platform com.XYZ.ServiceA import com.XYZ.ServiceA; ServiceLoader<ServiceA> sl1= ServiceLoader.load(ServiceA.class); ServiceB Resources: META-INF/services/com.XYZ.ServiceA: META-INF/services/ServiceB: ServiceAProvider3 ServiceAProvider3 ServiceAProvider1 ServiceAProvider1 ServiceAProvider2ServiceAProvider3 ServiceBProvider2 ServiceBProvider1 ServiceBProvider1ServiceBProvider2
Unsupported Java SE 8 Features • No reflection • No serialization • No InvokeDynamic/Lambda expressions • No JNI and application native code • No User-defined class loaders • No runtime annotations • No thread groups and daemon threads • No concurrency utilities • Limited Math APIs (No BigDecimals) • Limited security APIs • Limited collection APIs (No sorted collection classes)
Program Agenda • Java ME Evolution • Connected Limited Device Configuration (CLDC) • Generic Connection Framework (GCF)
New GCF Features Additional protocol parameters
New GCF Features: Access Point Selecting a Network Access Point • The AccessPoint API enables: • Obtaining a list of available network access points • Querying the access technology (e.g. 3GPP, CDMA, Wi-Fi, Wired) • Getting Access-point technology-specific properties (e.g. 3GPP country code, network code) • Selection of an access point for a connection • Detection of connect/disconnect situations
New GCF Features: Access Point Example AccessPointaps[] = AccessPoint.getAccessPoints(true); AccessPointap = aps[0]; // attach an event listener to the first access point ap.addListener(newAccessPointListener() { public void notifyEvent(AccessPointaccessPoint, inteventType) { if ((eventType== AccessPointListener.EVENT_TYPE_AVAILABLE)) System.out.println(“signalstrength = ”+ ap.getProperty(“signalstrength")); } }); // select the first access point for communication ConnectionOption<String> id = new ConnectionOption<>("AccessPoint”, ap.getId()); Connection c = Connector.open("http://www.oracle.com/index.html", id);
Development Tools for CLDC 8 • Standard JDK 7 or 8 tools can be used for application development • Embedded-specific hints & warning messages • Provides developer with additional information to optimize code • Debug structures are optional • Debug features can be ignored/filtered out to save footprint • Future tools under consideration may include • Optimizing converter/compiler plugin for optimizing CLDC 8 applications • Integrated with Java ME SDK and IDEs
Java ME 8 - JCP Activities and Schedule • JSR 360: CLDC 8 • EG Kick-off: February 2013 • Early Draft: May 2013 • Public Review: September 2013 • Final Draft: December 2013 • JSR 361: Java ME Embedded Profile • On Parallel Schedule
Summary CLDC 8 New and Improved • Long anticipated updates to CLDC to align with SE 8 features • Created for resource constrained devices • Library updates • Collection API updates • NIO Buffers, NIO Files, NIO Channels, Logging • Service Loader • Consolidated GCF Connections • Plus Multicast connection, Connection options, IPV6 • Secure Server Socket and Secure Datagrams • Tools and support for embedded platforms
References and Related Sessions • CLDC8 – www.jcp.org/en/jsr/detail?id=360 • Java.net project – java.net/projects/jsr360 • Related sessions: • MEEP: A New Java Profile for the Embedded World [CON5330] • Oracle Java ME Embedded: Small Embedded with Big Opportunities [CON2796] • Java ME 8 Overview: A New Platform for Embedded Development for Small Devices [CON2267]
Safe Harbor Statement The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.