Upload
carlo
View
36
Download
0
Embed Size (px)
DESCRIPTION
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. - PowerPoint PPT Presentation
Citation preview
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
CLDC 8: New Features and Opportunities for the Small Java Core Libraries
Michael Lagally Principal Member of Technical StaffRoger Riggs, Consulting Member of Technical Staff
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
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.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
CLDC 8
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.
New Features and Opportunities for the Small Java Core
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
Program Agenda
Java ME Evolution Connected Limited Device Configuration (CLDC) Generic Connection Framework (GCF)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
The Next Generation: Java ME 8 Platform
• First step in Java ME Java SE alignment• Dedicated embedded application platform• Address increased range of use cases and markets
Themes
Key Features
•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
Target 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
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
Java ME 8 Focus
Platform Footprint
Device CPU/GPU/I-O ARM 7 Cortex M ARM9/11 MIPS32 - ARM Cortex A – PPC - Intel Atom
50KB-1MB
1MB-10MB
10MB-100MB Java MEJava SE
Java Card
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
Towards a Common Java
• 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
Key Principles
• 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
Ensure close alignment between ME/SE
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
Java ME 8 Platform Overview
Java VM
AdditionalAPIs(Examples)
Application Platform
Java ME CLDC 8 (JSR 360, aligned with Java SE 8)
Java ME Embedded Profile (MEEP 8, JSR 361)
AdditionalOptional APIs
On-Device I/O Access
Device I/O API
Vertical Specific APIsLocation
Messaging WirelessCommunication
Web Services
Protocols and Data Conversion
Sensors
SATSA
Security and Trust Services
AdditionalOptional JSRs
Security andManagement
Generic Connection Framework
GCF
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
Constraints of small embedded devices
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
Sample prototyping board
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
Small Embedded
Source: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/data_brief/DM00037955.pdf
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
Sample prototyping board
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
Small Embedded
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
Program Agenda
Java ME Evolution Connected Limited Device Configuration (CLDC) Generic Connection Framework (GCF)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
Java SE 8
CLDC 8: an Evolutionary update for CLDC
• Key Features• Synchronize with Java SE 8 Language Features into 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
CLDC 8
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
CLDC 8 architecture
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
ConfigurationsCLDC is scalable to small and very small devices
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
CLDC 8 Footprint Considerations
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
Optimizing Footprint Even Further
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
New Java Language Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
New Java Language Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20
New Java Language Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
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
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
Library Updates
New Collections– List – ArrayList, LinkedList– Map – HashMap, LinkedHashMap, WeakHashMap– Set – HashSet, LinkedHashSet– Queue – Deque, ArrayDeque– Iterable and Iterator, ListIterator
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
Focus on: Service Providers
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.
An extension mechanism for the Java platform
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24
Service Providers - Example
import com.XYZ.ServiceA;ServiceLoader<ServiceA> sl1=ServiceLoader.load(ServiceA.class);
An extension mechanism for the Java platform
ServiceB
ServiceBProvider1
ServiceBProvider2
com.XYZ.ServiceA
ServiceAProvider1
ServiceAProvider3
ServiceAProvider3
Resources:META-INF/services/com.XYZ.ServiceA:
META-INF/services/ServiceB:
ServiceAProvider1ServiceAProvider2ServiceAProvider3
ServiceBProvider1ServiceBProvider2
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
Updates to CLDC Virtual Machine
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26
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)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27
CLDC Summary
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28
Program Agenda
Java ME Evolution Connected Limited Device Configuration (CLDC) Generic Connection Framework (GCF)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29
Generic Connection Framework (GCF)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30
Generic Connection Framework (GCF)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36
New GCF Features
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37
New GCF Features Additional protocol parameters
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38
New GCF Features: 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
Selecting a Network Access Point
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39
New GCF Features: Access Point
AccessPoint aps[] = AccessPoint.getAccessPoints(true);AccessPoint ap = aps[0];// attach an event listener to the first access pointap.addListener(new AccessPointListener() {public void notifyEvent(AccessPoint accessPoint, int eventType) { if ((eventType == AccessPointListener.EVENT_TYPE_AVAILABLE)) System.out.println(“signalstrength = ”+ ap.getProperty(“signalstrength")); }
});
// select the first access point for communicationConnectionOption<String> id = new ConnectionOption<>("AccessPoint”, ap.getId());Connection c = Connector.open("http://www.oracle.com/index.html", id);
Example
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40
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 applicationsIntegrated with Java ME SDK and IDEs
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41
Java ME 8 - JCP
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
Activities and Schedule
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42
Summary
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
CLDC 8 New and Improved
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43
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]
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44
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.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45
Graphic Section Divider
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46