71
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1

Introduction to Java Micro Edition (ME) 8

Embed Size (px)

DESCRIPTION

An introduction to Java ME 8, a modern, flexible, and robust software platform for intelligent devices and the Internet of Things.

Citation preview

Page 1: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1

Page 2: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 2

Graphic Section Divider

Page 3: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 3

Java Micro Edition (ME) 8 Introduction Terrence Barr Senior Technologist & Product Manager Oracle Sep, 2013

Page 4: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 4

Safe Harbor Statement

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.

Page 5: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 5

Java ME 8: The Platform for the Internet of Things

Page 6: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 6

Agenda

§  The Rise of the Internet of Things: Drivers behind Java ME 8 §  Java ME 8: Background and Overview §  Java ME Connected Limited Device Configuration (CLDC) 8 §  Java ME Embedded Profile (MEEP) 8 §  Device I/O API (DIO) §  Conclusion and Call to Action

Note: Java ME 8 is still under development and information presented here is subject to change.

Page 7: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 7

The Rise of the Internet of Things: Drivers behind Java ME 8

Page 8: Introduction to Java Micro Edition (ME) 8

x86 Architecture/ Windows OS

Standards Based Hardware & Software Proprietary Hardware

& Software

1960 - 1985 Host Era

2006 - 2025 Internet of Things

1985-2006 PC Era

The 3rd IT Revolution

Page 9: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 9

Challenges the Embedded Industry is facing

•  Multitude and variety of devices

•  Security, privacy, reliablity •  Remoteness, no human

control

•  Provisioning, management and monitoring

•  Data flow and analytics •  Interoperability and

standards

Explosion of Devices: What’s keeping You awake at night?

•  Long device lifecycle •  Connectivity, cost,

infrastructure, bandwidth •  Device cost, power

requirements

•  Developer productivity •  Development cost, skill

sets, re-use •  Time-to-market

Page 10: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 10

Drivers behind Java ME 8

Requirement Description

Modern embedded software platform

•  Robust, secure, cross-platform software execution environment •  Modular software system and remote operation extends product

value and reduced cost/risk •  Leverage feature-rich platform and focus on your value-add

Efficient software development and deployment model

•  Address the challenges of traditional embedded development •  Accelerate time-to-market •  Enable software portability and economies of scale •  Leverage large ecosystem of expertise and partners

Increased market reach •  Platform “right-sizing” allows to address wide range of use cases and target markets with a single software model, from low-footprint devices to more powerful systems

Open, based on standards, interoperable

•  Avoid vendor lock-in •  Participate in and benefit from technology innovation •  Integratable with many industry standards

Meeting the Challenges of the Internet of Things

Page 11: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 11

Java ME 8: Background and Overview

Page 12: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 12

Unifying the Java Ecosystem for Embedded

•  Java ME 8 is the “little sibling” of Java SE 8 •  Portability of applications and libraries across the Java Platform •  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

Enabling Java Developers to be Embedded Developers

Page 13: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 13

Java ME 8: Key Themes and Features

•  Major step in Java ME Java SE alignment •  Dedicated and optimized embedded application platform •  Enable 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

•  Target devices as low as 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, other IoT/M2M solutions

Page 14: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 14

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 ME Java SE

Java Card

Page 15: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 15

Java ME 8 Platform Overview

Java VM

Additional APIs (Examples)

Java ME Connected Limited Device Configuration (CLDC) 8 (JSR 360)

Additional Optional APIs

On-Device I/O Access

Vertical Specific APIs Location

Messaging Wireless Communication

Web Services

Protocols and Data Conversion

Sensors Additional Optional JSRs

Security and Management

Applications Applications Applications Applications

Application Platform

Java ME Embedded Profile (MEEP) 8 (JSR 361)

On-Device I/O Access

Device I/O API SATSA

Security and Trust Services

Generic Connection Framework

GCF 8

Page 16: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 16

Java ME 8: A Service-Enabled Platform

Extend lifetime, flexibility, and value –  Create cross-platform, modular software applications –  In-field s/w upgrades while maintaining system integrity –  Reduce device certification and testing overhead

Hardware Platform OS + Core Services

Java ME 8 Platform

Traditional Platform Java System

Component Cloud

(Network/Enterprise)

OS + Core Services Hardware Platform

Native Application

Loadable Applications and Services

Limited flexibility, high cost –  H/W-S/W interdependencies –  Upgrade complexity –  Impact on security/integrity

Bringing software modularity to resource-constrained systems

Page 17: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 17

Embedded Application(s) Embedded Application(s)

Virtual Machine

Optional JSR System Controller

Communication Management

Device Management

Tooling Agent

Software Provisioning

Identity Management

Messaging Monitoring & Logging

Data Store & Sync

Web Server Other Services/ Protocols Graphics/UI

Optional JSR

Embedded Application(s)

Java ME 8: Oracle Product Strategy An extensible, customizable application platform

Oracle Java ME Embedded Product

Building Blocks (Oracle or partners): Services and/or Libraries

Oracle or 3rd Party JSRs

3rd Party Enhancement

3rd Party Enhancement

3rd Party Enhancements

• Local Peripherals • IoT Network • Enterprise

Note: Preliminary - Not all components shown are currently available

Local or Network Interfaces

Page 18: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 18

General IoT and Machine-to-Machine (M2M) solutions

Smart Meters & Smart Sensors

Medical: eHealth & TeleHealth

Wireless Modules, Gateways

Industrial Control, Telemetry

Java ME 8 Example Use Cases Enabling products and services across different market segments

Page 19: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 19

Tools – Developing Efficiently

NetBeans + device emulation

•  Java ME SDK –  Tools and emulation for rapid development

of embedded Java ME applications

• NetBeans & Eclipse Plug-ins –  Integration with Java ME SDK –  Full-featured, integrated development

environment for embedded

• Unified Development Experience –  Same development model across Java

ME, Java SE, and Java EE

Java ME SDK and IDEs

Free Tools

Page 20: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 20

Java ME Connected Limited Device Configuration (CLDC) 8 And Generic Connection Framework (GCF) 8

Page 21: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 21

Java SE 8

• Description -  CLDC 8 is an long-anticipated, evolutionary update for CLDC 1.1.1 to bring

the VM, Java language and core API libraries in alignment with Java SE 8

•  Key Features -  Synchronize Java SE 8 language features into Java ME -  CLDC 8 is an extended strict subset of Java SE 8 -  Introduce developer-friendly Java SE APIs -  Includes updated Generic Connection Framework (GCF) 8 -  Virtual Machine update to align with Java SE developer tools -  Remain small and enable footprint optimizations -  Backward binary compatible

CLDC 8 High-Level Overview

CLDC 8

Bringing The World of Java SE to Java ME

Page 22: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 22

CLDC 8 architecture

CLDC 8 NIO files

NIO channels

Logging

Compact Configuration

NIO buffers java.lang java.io java.security java.util

GCF 8 Multicast Secure

Datagram Modem

Connection HTTP HTTPS Socket Server Socket Datagram

Java VM

Page 23: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 23

Configurations

The “CLDC Configuration” is the complete set of CLDC APIs

Provides maximum

functionality for applications

Typical CLDC platform footprint is 1-2 MB ROM

The CLDC Compact Configuration defines a subset for very small target platforms

Omits Logging, NIO Files, and NIO Channels

Tailored for very constrained

devices (512 K ROM)

CLDC is scalable to small and very small devices

Page 24: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 24

Optimizing Footprint Even Further

§ “Stripping On Deployment” –  For fixed-function, minimal footprint deployments –  Allows bundling application with CLDC 8 runtime and then stripping

away unnecessary components –  Result: Minimal, non-modifiable binary containing application and

runtime

Page 25: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 25

New Java Language Features

• private void setInterval(int interval) { assert interval > 0 && interval <= 1000 : "Invalid value?”;

} Assertions

•  Added support for AbstractCollection, AbstractList, AbstractSet, Collection, Collections, Enumeration, Iterator, List, ListIterator Generics

• void processList(Vector<String> list) { for (String item : list) { ...

}

Enhanced for Loop

• Hashtable<Integer, String> data = new Hashtable<>(); void add(int id, String value) {

data.put(id, value); }

Autoboxing

Page 26: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 26

New Java Language Features

• enum Season {WINTER, SPRING, SUMMER, FALL}; private Season season; void setSeason(Season newSeason) { season = newSeason;

Enumerations

• void warning(String format, String... parameters) { for(String p : parameters) { process(p); } }

Varargs

• import static data.Constants.RATIO; ... double r = Math.cos(RATIO * theta);

Static imports

• SuppressWarnings, Deprecated, Override  @Deprecated public void clear(); • (JLS 7 section 9.6.3.2 @Retention - SOURCE retentions policy only.)  

Annotations

Page 27: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 27

New Java Language Features

• switch (arg) { case "-data": ... case "-out": ...

Strings in switches

• long mask = 0xfff0_ff08_4fff_0fffl; byte flags = 0b01001111;

Binary integral literals and underscores in numeric literals

• catch (IOException | InterruptedException ex) { logger.log(ex); throw ex;

Multi-catch and more precise rethrow

• Hashtable<String, String> map = new Hashtable<>();

Improved Type Inference for Gen. Instance Creation (diamond)

• try (DataInputStream is = new DataInputStream(...)){ return is.readDouble(); }

Try-with-resources statement

Page 28: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 28

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

Page 29: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 29

Library Updates

§ New Collections –  List – ArrayList, LinkedList –  Map – HashMap, LinkedHashMap, WeakHashMap –  Set – HashSet, LinkedHashSet –  Queue – Deque, ArrayDeque –  Iterable and Iterator, ListIterator

Page 30: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 30

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

Page 31: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 31

Service Providers - Example

import  com.XYZ.ServiceA;  ServiceLoader<ServiceA>  sl1=    ServiceLoader.load(ServiceA.class);    

An extension mechanism for the Java platform

ServiceB

ServiceB Provider1

ServiceB Provider2

com.XYZ.ServiceA

ServiceA Provider1

ServiceA Provider3

ServiceA Provider3

Resources: META-INF/services/com.XYZ.ServiceA:

META-INF/services/ServiceB:

ServiceAProvider1 ServiceAProvider2 ServiceAProvider3 ServiceBProvider1 ServiceBProvider2

Page 32: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 32

Updates to CLDC Virtual Machine

• Target devices are not able to support InvokeDynamic • No support for reflection or retention of runtime annotations

CLDC 8 supports the Java VM Specification for SE 7 with some limitations

• For classfile versions 51 and 52 • without a preverifier

Verification by Type Checking

• For classfile versions 48 and older

Legacy Verification (Preverifier)

Page 33: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 33

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)

Page 34: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 34

CLDC Summary

Language Alignment with SE 8

VM Alignment with SE 8

Library Alignment with SE 8

Compact Configuration for very small devices

GCF 8 to provides flexible networking

Developer leverage to tools, APIs and knowledge

Page 35: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 35

Generic Connection Framework (GCF)

• Consistent IPv6 support • Generic ConnectionOption mechanism to parameterize connections •  Permissions apply per protocol •  Extended failure information via exceptions from java.net

Consolidates GCF specification from CLDC, MIDP, CDC, and JSR 197

•  File support via StreamConnection •  IP Multicast •  Latest version of security protocols via TLS 1.2 •  Secure datagram connection via DTLS 1.2 • Modem connection enhances CommConnection with control of hardware handshake

New and enhanced protocols

Page 36: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 36

Generic Connection Framework (GCF)

CLDC

DatagramConnection ContentConnection

InputConnection OutputConnection StreamConnection

CLDC 8

SecureServerConnection SecureDatagramConnection

ModemConnection UDPMulticastConnection

CommConnection HttpConnection HttpsConnection

SecureConnection ServerSocketConnection

SocketConnection UDPDatagramConnection

Page 37: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 37

New GCF Features

•  GCF consistently supports IPv6 addresses •  The value of the host field on Connector.open must be

a symbolic hostname, an IPv4 address or an IPv6 address surrounded by square brackets ('[', ']’).

•  datagram://[2001:db8::7]:4567 •  multicast://[FF0X::101]:4444

IPv6

Page 38: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 38

New GCF Features

•  GCF includes support for UDP Multicast •  1 to n communication of UDP datagrams •  Multicast is important for distributed services:

Used for service announcement and discovery, media streaming •  Dynamic Discovery for configuration and rendezvous (mDNS,

Bonjour) •  The new protocol class UDPMulticastConnection enables

•  Client and server scenarios •  Joining multicast groups •  Creating a multicast server socket

UDP Multicast

Page 39: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 39

New GCF Features

•  SecureConnection and SecureServerConnection support TLS 1.2

•  SecureServerConnection provides the server-side of a TLS connection

•  Both can be parameterized to: •  Select a set of cipher suites •  Select a minimum protocol version •  Request client authentication

TLS protocol enhancements

Page 40: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 40

New GCF Features

•  SecureDatagramConnection provides client-side support for DTLS

•  It can be parameterized to: •  Select a set of cipher suites •  Select a minimum protocol version •  Request client authentication

DTLS protocol support for TLS over UDP

Page 41: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 41

New GCF Features

•  Utility functions for name lookup, reverse name lookup and for testing the reachability of a host (ping):

• getCanonicalHostName(String host) • isReachable(String host, int ttl, int timeout) • getByName(String host)

NetworkUtilities

Page 42: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 42

New GCF Features

•  Purpose: monitor and control the signal lines of a serial interface

•  Getter and setter for the line mode (input/output) •  Getter and setter for the line state •  Listener for changes to the state of an input line

Modem Connection

Page 43: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 43

New GCF Features

•  Type-safe mechanism for protocol-specific additional parameters •  Useful for selecting access points, proxy settings, proprietary protocol

extensions •  Multiple connection options can be used with varargs

ConnectionOptions

• ConnectionOption <String> keep = new ConnectionOption<> ("KeepAlive", "KEEP_ALIVE");

ConnectionOption <Integer> port = new ConnectionOption<>("ProxyPort", 80); Connection c = Connector.open(“my.server.com”, keep, port)

Example

Additional protocol parameters

Page 44: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 44

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

Page 45: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 45

New GCF Features: Access Point

AccessPoint  aps[]  =  AccessPoint.getAccessPoints(true);  AccessPoint  ap  =  aps[0];  //  attach  an  event  listener  to  the  first  access  point  ap.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  communication  ConnectionOption<String>  id  =  new  ConnectionOption<>("AccessPoint”,  ap.getId());  Connection  c  =  Connector.open("http://www.oracle.com/index.html",  id);  

Example

Page 46: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 46

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

Page 47: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 47

Java ME Embedded Profile (MEEP) 8

Page 48: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 48

MEEP 8 High-Level Overview

§ Description –  MEEP is an evolution of JSR 228 (IMP-NG), defining a modernized Java

application platform with features and enhancements targeted at the small- and mid-range embedded market

§ Key Features –  Builds on CLDC 8 –  Robust and flexible multi-tasking application model –  “Services-enabled” application platform supports modular software

design, deployment, and management –  Enhanced and flexible security model –  Improved configurability and optimized footprint for deployment

The Evolution of Java ME for Embedded

Page 49: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 49

MEEP 8 Key Features and Benefits A Modern Services-Enabled Software Platform for Embedded

Feature Benefit

Built on CLDC 8 Leverages CLDC 8 language features, APIs, and permissions model to align with Java SE 8

API Optionality and “Profile Sets”

Enables “right-sizing” of platform to optimize footprint and reduce hardware requirements for specific target device

Software Provisioning and Management

Supports remote deployment, management, and monitoring of software components

Support for Software Modularization

Enables modular software development and deployment, reducing development effort, complexity, and footprint

Support for advanced connectivity

Supports a wide range of connectivity options, both wired and wireless, including advanced support for cellular

Enhanced security model Enables implementation of use case-specific security policies for authentication and authorization

Page 50: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 50

MEEP 8 Target Devices and Footprint

§ MEEP 8 is designed for “Right-Sizing” –  Well-defined optionality and modularity allows matching software features

to deployment target footprint –  “Stripping on Deployment” allows further reduction for very small fixed-

function targets –  Greatly expands the range of addressable use cases and devices

§ Target Device Categories –  Minimal Single-Function Device: Smallest possible footprint –  Standard Multi-Function Device: Expands with functional requirements –  Full Multi-Function Device: Full functionality, footprint not a concern

Adressing New Market Opportunities

Page 51: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 51

MEEP 8: Right-Sizing The Platform

MEEP 8 Full Profile Set

MEEP 8 Minimal Profile Set • Mandatory core APIs, application model,

application packaging Target Devices/Use Cases •  Very small devices (low cost/power/size) •  Single-function use cases (e.g. smart

sensor)

Minimum: •  128 kB RAM •  1 MB Flash Recommended: •  256 kB RAM •  2 MB Flash

MEEP 8 Standard Profile Set •  Adds support for software services platform

(multi-tasking, application mgmt, shared libs, events, enhanced security model, etc)

• Optional Packages as per use case Target Devices/Use Cases • Mid-range MCU/low-end embedded systems • Wide range of use cases (e.g. wireless

module, industrial control system, remote monitoring device, smart network note, etc)

Minimum: •  512 kB RAM •  2 MB Flash Recommended: •  1 MB RAM •  3 MB Flash

MEEP 8 Full Profile Set •  All ME 8 functionality and Optional Packages Target Devices/Use Cases • High-end MCU or mid-range embedded

systems • Use cases requiring full software functionality,

footprint not a concern

Minimum: •  2 MB RAM •  4 MB Flash

CLDC 8

Optional Package

Optional Package

Optional Package

Application(s)

MEEP 8 Standard Profile Set

MEEP 8 Minimal Profile Set

Note: IMP-NG Compatible Profile Set Not Shown. Recommended: 1 MB RAM, 2 MB Flash

Optional JRSs

Optional APIs

Note: All footprint numbers approximate and subject to change

Page 52: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 52

Application or Service

MEEP 8

MEEP 8 Architecture

CLDC  8  

javax. microedition.

midlet

New in MEEP 8 Updated in MEEP 8

javax. microedition.

io (optional)

javax. microedition.

event (optional)

javax. microedition.

key (optional)

javax. microedition.

lui (optional)

javax. microedition.

media (optional)

javax. microedition.

power (optional)

javax. microedition.

rms (optional)

javax. microedition.

swm (optional)

javax. microedition.

cellular (optional)

Application or Service Application or Service

Page 53: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 53

Package Description javax.microedition.midlet The Application and the environment in which the application runs.

javax.microedition.swm [OPTIONAL] Provides extended software management features to MEEP.

javax.microedition.cellular [OPTIONAL] Provides classes to obtain information about cellular networks the device is registered on.

javax.microedition.event [OPTIONAL] Events for system state changes and application to application communication.

javax.microedition.power [OPTIONAL] Power management.

javax.microedition.io [OPTIONAL] Networking support based on the Generic Connection Framework Specification.

javax.microedition.lui [OPTIONAL] Set of features to implement Line-oriented User Interface.

javax.microedition.key [OPTIONAL] Support of embedded device key input.

javax.microedition.media [OPTIONAL] Features for Audio support on embedded Devices.

javax.microedition.rms [OPTIONAL] Mechanism for applications to persistently store data and later retrieve it

MEEP 8 API Packages

Page 54: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 54

MEEP 8 Application Platform A modern platform to build flexible, modular, and managable software

Component/concept Description

Software provisioning Provision of applications and libraries, and management of dependencies

Software management Control lifecycle of software components

Application concurrency (MVM) Concurrent execution of multiple apps, in isolation

Inter-application communication (IMC) Exchange data between applications (synchronous)

Events Send/receive events across system (asynchronous)

Service Provider/Consumer pattern Enable shared services and service consumers

Shared Libraries (LIBlets) Share common code across applications

Page 55: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 55

MEEP 8 Application Provisioning & Management

Installation Mgmt install/update/remove & resolve dependencies

Lifecycle Mgmt start/stop/terminate &

prioritize

Provisioning download, authenticate,

verify

Security Policy Provider security policy &

permissions Storage

App-1 App

Mgmt Agent

Application Management System (AMS)

Authentication Provider authenticate App-2

Java Runtime

Uses API

2. Download

3. Authenticate (2)

4. Install

6. Access

7. Provide

8. Control

9. Secure 5. Store

Application Package

Deployment Infrastructure •  Identity •  Provisioning •  Security Policy •  Management

1. Implement protocol App Management Agent: •  Privileged application •  Implements deployment-

specific protocol •  Manages local

applications via AMS API

3. Authenticate (1)

Client Device

Page 56: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 56

Shareable Software Components

§  A shareable software component that one or more applications MAY use at runtime

§  Save static footprint size by enabling multiple application suites to share the same common code without packaging them redundantly

§  Reduced download times for applications that declare dependencies on shared components

§  Each shared library exposes a set of classes and resources to applications for their use just as if those classes and resources were originally packaged within the application JAR

§  Different implementations of the same API can be can be accessed via the Service Provider/Consumer pattern

Shared Libraries (LIBlets)

Page 57: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 57

Service Provider/Consumer Pattern

§ Service is a well known set of interfaces/abstract classes; Service Provider is an implementation of the service

§ Enables consumers to use services by one or more providers § Features of the Application Platform Framework

–  Ability of apps, shared libraries, or runtime to declare it provides a service (provider) –  Ability of apps or shared libraries declare a dependency on a service (consumer) –  Ability of the AMS to bind a consumer to a provider, and rebind on updates –  Service provider executed in context of consumer (client application)

§ Benefits –  Modular software design, increased reuse, easier updating, reduced

testing, reduced footprint

Based on Java SE ServiceLoader API

Page 58: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 58

MID

let S

uite

1

MID

let S

uite

2

How does it work?

Simple example, Service Provider and Consumer are two different apps

MIDlet 2

LIBlet 2 MIDlet 1

Page 59: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 59

How does it work? (cont)

Simple example, Service Provider and Consumer are two different apps

MID

let S

uite

1

MID

let S

uite

2

MIDlet 2

LIBlet 2 MIDlet 1

LIBlet2.jar/META-INF/services/com.example.CodecSet

LIBlet2.jar/META-INF/MANIFEST MIDletSuite1.jad

LIBlet-Services: com.example.CodecSet …

MIDlet-Dependency-1: service; required; com.example.CodecSet …

com.example.impl.StandardCodecs # Standard codecs

Page 60: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 60

How does it work? (cont)

Simple example, Service Provider and Consumer are two different apps

MID

let S

uite

1

MID

let S

uite

2

class StandardCodecs

class MIDlet1

MIDlet 2

LIBlet 2 MIDlet 1

public class StadardCodecs implements CodecSet { public StadardCodecs() { … } public Encoder getEncoder(String encodingName) { return new EncoderImpl(…); } }

private static ServiceLoader<CodecSet> codecSetLoader = ServiceLoader.load(CodecSet.class); public static Encoder getEncoder(String encodingName) { for (CodecSet cp : codecSetLoader) { Encoder enc = cp.getEncoder(encodingName); if (enc != null) return enc; } return null; }

Interface CodecSet public interface CodecSet { public Encoder getEncoder(String encodingName); public Decoder getDecoder(String encodingName); }

Page 61: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 61

MEEP 8 Enhanced Security Model

§ “Clients” and Software Components –  Clients are entities with particular security privileges (similar to users or

application vendors). Specialized clients are possible (e.g. “root client”). –  Software components are associated with clients and inherit their

privileges –  Authentication of clients and software components can be use case-

specific (e.g. specialized authentication scheme)

§ Security Privileges –  Priviledges are based on clients and expressed as fine-grain permissions –  Authorization (granting of permissions) can be use case-specific (e.g.

networked authorization services)

Flexibility to Support Specialized Security Scenarios

Page 62: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 62

Device I/O API (DIO)

Page 63: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 63

Device I/O API Overview

Java VM

Application Layer

Application Environment

CLDC

Example 1 Real-Time Clock Peripheral

Implementation (High Level Driver)

Example 2 Simple GPIO Pin-

based sensor reader (low level application)

On-Device I/O Access Device I/O API

•  Generic API to access devices in a platform-neutral manner

•  ‘Late binding’ allows addition of new peripheral types without changing API

•  Enables downstream support of use case-specific peripherals (non-real time)

•  No native application code

•  Also planned for availability on Java SE

Access Peripheral I/O Hardware directly from Java applications

Page 64: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 64

Device I/O API Features in ME 8

Peripheral Type Description Peripheral abstraction interface All access to peripherals via PeripheralManager (late binding)

General Purpose Input/Output (GPIO) Access to buttons, switches, LEDs, etc.

Inter-Integrated Circuit Bus (I2C) Access to I2C slaves (sensors, RTC, DAC/ADC, NVRAM, …)

Serial Peripheral Interface Bus (SPI) Access to SPI slaves (audio devices, LCD screens, EEPROM/Flash, …)

Analog/Digital conversion Access to ADC and DAC channels

Universal Asynchronous Receiver/Transmitter (UART)

Access to UART serial communication and control

Memory-Mapped Input/Output Access to devices with memory-mapped registers and memory blocks

AT Command Interface Access to modems and devices supporting AT commands

Watchdog Watchdog functionality to ensure reliable operation

Pulse counter Access to pulse counter functionality

Pulse Width Modulation (PWM) Access to pulse width modulation output

Page 65: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 65

Conclusion Call to Action

Page 66: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 66

Conclusion

Aspect Benefit

Modern Embedded Software Platform

•  Java SE alignment enables unified ecosystem for Java Embedded expertise, reuse, and resources

•  Modular software system and enhanced manageability accelerates time-to-market and extends product value at reduced cost/risk

•  Enhanced and more flexible security model allows deployment-specific security infrastructure

Increased Market Reach •  Platform “right-sizing” allows to address wide range of use cases and target markets with a single software model, from low-footprint devices to more powerful systems

Open, based on standards, interoperable

•  Avoid vendor lock-in •  Participate in and benefit from technology innovation •  Integratable with many industry standards

Java ME 8: The Platform for the Internet of Things

Page 67: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 67

Call To Action

•  Java ME Embedded 8 Early Access Download it and try it out today! -  oracle.com/technetwork/java/embedded/overview/javame/index.html

•  Learn more about Java ME 8 –  CLDC 8: jcp.org/en/jsr/detail?id=360 –  MEEP 8: jcp.org/en/jsr/detail?id=361

•  Follow me to keep abreast of Java Embedded -  terrencebarr.wordpress.com -  @terrencebarr

Page 68: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 68

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.

Page 69: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 69

Java Micro Edition (ME) 8 Introduction Terrence Barr Senior Technologist & Product Manager Oracle Sep, 2013

Page 70: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 70

Graphic Section Divider

Page 71: Introduction to Java Micro Edition (ME) 8

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 71