overview and update pete raymond. » purpose of this presentation » background » jsr requirements...

35
JSR 350 State Management Overview and update Pete Raymond

Upload: philip-charles

Post on 14-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

JSR 350 State Management

Overview and updatePete Raymond

Page 2: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Overview» Purpose of this presentation» Background » JSR Requirements» Key concepts» Relationship to other standards/approaches» Example API» Demo» Timeline» Q & A

Page 3: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Purpose» Raise awareness of JSR-350 State Management» Seek feedback on concepts and usage

Page 4: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Background» Standard formed through JCP (2.8 2.9)» Oracle lead (Mitch Upton), participation from

Red Hat, IBM and independents» Expert group activated April 2012 » Some existing proprietary solutions in

WebLogic, Tomcat and JBoss

Page 5: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Requirements» “…develop an API that applications and JavaEE

containers can use to offload the responsibility of state management into third party providers with different quality of service characteristics” (JSR)

» Standardize existing APIs

Page 6: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Use Cases» Mobile - cross platform state handling» Integration - Transfer of state between

platforms» Capability based provider querying» Transient data e.g. session state» Non relational data e.g. JSON, XML, JavaScript

Page 7: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Why State Management Standard and not…» This slide needs more» JPA

˃ Relational˃ Persistent

» Proprietary APIs˃ Reuse˃ Ease of use

» NoSQL ˃ ?

Page 8: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Design Goals» Store and retrieve state independent of

mechanism» Modular and consistent implementation » Capability based matching of client and

provider» Support innovation and the cloud» Easy to use interfaces – user, provider, platform

Page 9: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

API to Multiple Providers

JEE Client

State Management API

JSE Client

Built-inProvider

3rd partyProvider

CustomProvider

Page 10: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Key Concepts» State (State Container)» State Connection Factory» State Connection» State Container» State Map» Capability

Page 11: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State» Unit of data » Uniquely identified within a scope» Persistent for a business period» Used by web apps, web services, JSF, CDI» Currently implemented via in memory, file,

database, cluster

Page 12: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State Connection Factory» Create one or more State Connections based on

required capabilities» Associated to single provider» Typed e.g. Java class (…probably)

Page 13: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State Connection» Connection to state management services

provided by some provider» Expose capabilities» Contains configuration» Controls the transaction – either local or

distributed using JTA» Use directly or to get a StateMap

Page 14: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State Container» Container for a user-defined state value that

allows a State Management provider to present and track system-level details about the value

» An instance of State contains a single user-specified value

Page 15: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State Map» Exposes only entries with a given key and value type in

StateConnection» Convenience interface - clients deal directly with user-

specified key and value types, no need to see containing structures such as Key and StateContainer

» Contains:˃ globally unique key˃ value of a user-defined type˃ tracking information

» Key˃ User defined + GUID

» Values ˃ Java type (e.g. Person class)˃ Streams?˃ XML?

Page 16: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Capability - QoS» Behaviour offered by a provider

˃ Durability˃ Transactions˃ Isolation and concurrency control

» Supported by configuration» Described by a unique name

Page 17: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

State Classes

State Connection

State Map

State Connection

Factory

State Management

Registry

0..*

0..*

1

1

1 0..*

State Container

1

0..*

0..*

1

Page 18: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Getting a ConnectionState ConnectionState Connection

FactoryClient

Application

State Management

Registry

Find State Connection Factory

Get State Connection

Create State Connection

Create

Page 19: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Using a StateContainerKeyDog

Client Application

StateConnection

new (“fido”, “Sheperd”)

createKey(fido.getUniqueName(), String.class, Dog.class)

put(fidoKey, fido)

fidoKey

StateContainer fidoState

get(fidoKey)

fido copy

State Container

create

create

Store

Retrieve

Page 20: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Using a StateMapDog

Client Application

StateConnection

new (“fido”, “Sheperd”)

getStateMap(String.class, Dog.class)

put(fidoKey, fido)

StateMap dogMap

get(fidoKey)

fido copy

State Map

create Store

Retrieve

Page 21: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Standards View 350 347 (107)

Client

State Management API (350)

Data Grid API (347)

Page 22: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Standards View 347 350

Client

State Management API (350)

Data Grid API (347)

Page 23: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Standards View 350 & 347Client

State Management API (350)

Data Grid API (347)

State Management API (350)

Page 24: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Roles » Provider

˃ Implement the specification˃ Innovate with new capabilities

» Administrator / Developer˃ Configure the state connection factory˃ Make a State Connection available

» Developer˃ Use State Connection and State to accelerate development

Page 25: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Positioning JSR-350» Comparing state persistence:

˃ Relational / SQL˃ Object ˃ NoSQL

» Target products˃ Application Server˃ Android

Page 26: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Example - StateConnection

Page 27: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Example - StateContainer

Page 28: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Example – get/put StateContainer

Page 29: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Get a StateMap

Page 30: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

put/get a Dog/Person

Page 31: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Demo

Page 32: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Design Debates» Typing

˃ Strong versus weak

» Is StateMap necessary / desirable?

Page 33: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Next steps» Expected milestones» How to provide feedback

Page 34: Overview and update Pete Raymond. » Purpose of this presentation » Background » JSR Requirements » Key concepts » Relationship to other standards/approaches

Q & A