Professional Documents
Culture Documents
Enterprise Javabeans (Ejb) 3.1 Technology: Agenda
Enterprise Javabeans (Ejb) 3.1 Technology: Agenda
Agenda
Introduction
Proposed Functionality
New features
Singletons Timer Service Features Asynchronous Session Bean Invocations JAX-RS Integration JAX-RS Integration
Focus on ease-of-use
Annotations Optional ejb-jar.xml Intelligent defaults Fewer classes needed
27/11/2009
Simplified Packaging
EJB 3.1 Lite API Portable JNDI Names Simple Component Testing
View Example
27/11/2009
local business interface Client does not call new()on bean class
View Example
27/11/2009
10
Simplified Packaging
Goal is to remove artificial packaging restriction
11
session beans Three main goals : Simplify intra-application Local Session lookups Simplify mapping of cross-application Remote session bean dependencies Improve portability of Remote Java clients
14
27/11/2009
15
16
17
27/11/2009
Remote Client
18
New Features
Singletons
19
Singleton
New component
Looks like a stateless / stateful No/local/remote interface
20
27/11/2009
Simple Singleton
Singleton Client
21
instance
22
metadata READ lock : allow any number of concurrent accesses to bean instance WRITE lock (default) : ensure single-threaded bean instance access Incoming invocations are blocked by container until the necessary lock can be acquired or until an optional timeout has been reached
23
27/11/2009
24
25
26
27/11/2009
instance concurrently
Bean developer is solely responsible for
maintaining integrity of instance state Can use synchronization primitives such as synchronized, volatile, etc.
27
28
29
27/11/2009
30
31
10
27/11/2009
Attribute Syntax
Single value : minute = 30 List : month = Jan, Jul, Dec Range : dayOfWeek = Mon-Fri Wild card : hour = * Increment : minute = */10
33
timezone=America/New_York)
34
application deployment
Logically equivalent to one invocation of TimerService.createCalendarTimer()
35
11
27/11/2009
36
Non-persistent Timers
37
enterprise bean applications Fire and Forget or async results via Future<V> Best effort delivery persistent delivery guarantees are not required by spec Available for Stateful, Stateless, Singleton bean
38
12
27/11/2009
39
Asynchronous Results
Based on java.util.concurrent.Future
40
41
13
27/11/2009
Asynchronous Results
42
Async Behavior
Transactions
43
44
14
27/11/2009
45
Thank you!
46
15