JSR 350 State Management

advertisement
Overview and update
JSR Expert Group
»
»
»
»
»
»
»
»
Background
Why a JSR for State Management
Key concepts
Relationship to other standards
Example API
Demo
Timeline
Q&A
JSR-350 is an API for finding and using
state management services to save and
retrieve data independent of the
storage method.
» 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
» “…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
» Support a wider variety of data representations
(JSON, XML, name value)
» Expand storage mechanisms (NoSQL, Graph DB,
In Memory)
» Cloud - loose coupling of apps to state
management facilities
» 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
» Independent storage mechanism – not specific to
DBMS, file, etc.
» Access service by capability instead of low level
configuration
» Manage state with strongly or weakly-typed
approach
» Pluggable marshalling of types
» JPA
˃ Strongly typed
˃ Assumes relational storage
» JDBC
˃ SQL access but must manage ORM, integrity, transactions
˃ Deep technical knowledge
» EJB
˃ Complex
» Java I/O
˃ Complex, low level
» 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
JEE Client
JSE Client
State Management API
Built-in
Provider
3rd party
Provider
Custom
Provider
»
»
»
»
»
»
State (State Container)
State Connection Factory
State Connection
State Container
State Map
Capability
»
»
»
»
»
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
» 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 userspecified value
» Create one or more State Connections based on
required capabilities
» Associated to single provider
» Typed e.g. Java class (…probably)
» 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
» Exposes only entries with a given key and value type in
StateConnection
» Convenience interface - clients deal directly with userspecified 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?
» Behaviour offered by a provider
˃ Durability
˃ Transactions
˃ Isolation and concurrency control
» Supported by configuration
» Described by a unique name
State
Management
Registry
1
0..*
State
Connection
Factory
1
0..*
State
Connection
1
0..*
1
State
Container
0..*
0..*
State Map
1
Client
Application
State
Management
Registry
State Connection
Factory
State Connection
Find State Connection Factory
Create
Get State Connection
Create State Connection
Client
Application
Dog
State
Connection
Key
State
Container
new (“fido”, “Sheperd”)
createKey(fido.getUniqueName(), String.class, Dog.class)
fidoKey
create
Store
put(fidoKey, fido)
create
StateContainer fidoState
get(fidoKey)
fido copy
Retrieve
Client
Application
Dog
State
Connection
State Map
new (“fido”, “Sheperd”)
getStateMap(String.class, Dog.class)
create
Store
StateMap dogMap
put(fidoKey, fido)
get(fidoKey)
fido copy
Retrieve
Client
State Management API (350)
Data Grid API (347)
Client
Data Grid API (347)
State Management API (350)
Client
State Management API (350)
Data Grid API (347)
State Management API (350)
» 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
» Typing
˃ Strong versus weak
» Is StateMap necessary / desirable?
» Expected milestones
» How to provide feedback
»
»
»
Java State Management Wiki http://java.net/projects/java-state-managemen
JavaOne presentation http://java.net/downloads/java-state-managemen/2011-J1Java-State-Management-v2.ppt
The spec http://www.jcp.org/en/jsr/detail?id=350
Download