Errai-CDI Integration
  Heiko Braun <hbraun@redhat.com>
              Apr 2010
Topics

•   Use cases
•   CDI Concepts
•   Bootstrap process
•   Invocation Handling
•   Status & Roadmap


              ...
Use cases

•   Initially

    •   Declaring a CDI component as Service

    •   Exposing a CDI component as RPC endpoint

...
Declaring Services
                               GWT Client

•   Most low level use cases

•   Similar to MessageDriven
 ...
Exposing RPC endpoints
                             GWT Client


•   Exposes a typed
    interface

•   Similar to EJB Ses...
Working with CDI events
•   Bi-directional event   GWT Client

    exchange

•   Discriminate on:
    - Event Type
    - Q...
CDI Concepts
•   Portable Extensions

    •   Integration point when container bootstraps

    •   Create beans, annotatio...
Bootstrap process

•   Two phases: CDI -> Errai Bootstrap
    •   Ordering important
    •   CDI Service discovery first
• ...
Service discovery

•   Provide injection points
    for Errai Components

•   Discover Errai
    annotations during CDI
  ...
Invocation Handling

•   Encapsulated in
    invocation proxy
•   Lookup bean
    reference
    (instance)
•   Context & S...
Invocation proxies
Bean invocation (RPC)




                        11
Event dispatcher
CDI Observer




               12
Event client boilerplate
 GWT Client




              13
Status

•   Project:
    http://anonsvn.jboss.org/repos/errai/projects/
    weld-integration/trunk
•   Basic use cases cov...
Roadmap
•   More work on Bean scopes:
    •   Session-, Request-, ConversationScoped
•   Integration with EJB3
    •   Sta...
Upcoming SlideShare
Loading in …5
×

Errai CDI Integration

1,933 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,933
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
28
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Errai CDI Integration

  1. 1. Errai-CDI Integration Heiko Braun <hbraun@redhat.com> Apr 2010
  2. 2. Topics • Use cases • CDI Concepts • Bootstrap process • Invocation Handling • Status & Roadmap 2
  3. 3. Use cases • Initially • Declaring a CDI component as Service • Exposing a CDI component as RPC endpoint • Integrating with the CDI event subsystem 3
  4. 4. Declaring Services GWT Client • Most low level use cases • Similar to MessageDriven Bean • Service implementation CDI Component fully managed by CDI container 4
  5. 5. Exposing RPC endpoints GWT Client • Exposes a typed interface • Similar to EJB Session beans CDI Component Remote interface 5
  6. 6. Working with CDI events • Bi-directional event GWT Client exchange • Discriminate on: - Event Type - Qualifier Annotations • Exposes high level CDI Component CDI client API 6
  7. 7. CDI Concepts • Portable Extensions • Integration point when container bootstraps • Create beans, annotation processing, meta data modifications • Scope & Lifecycle • ApplicationScoped, RequestScoped, ConversationScoped • Bean context & reference • Lookup and instance (reference) creation 7
  8. 8. Bootstrap process • Two phases: CDI -> Errai Bootstrap • Ordering important • CDI Service discovery first • Services instances are maintained by CDI 8
  9. 9. Service discovery • Provide injection points for Errai Components • Discover Errai annotations during CDI bootstrap • Provide service proxies 9
  10. 10. Invocation Handling • Encapsulated in invocation proxy • Lookup bean reference (instance) • Context & Scope managed by CDI 10
  11. 11. Invocation proxies Bean invocation (RPC) 11
  12. 12. Event dispatcher CDI Observer 12
  13. 13. Event client boilerplate GWT Client 13
  14. 14. Status • Project: http://anonsvn.jboss.org/repos/errai/projects/ weld-integration/trunk • Basic use cases covered • Incorporate feedback from the CDI team • Clarification on Errai RPC API 14
  15. 15. Roadmap • More work on Bean scopes: • Session-, Request-, ConversationScoped • Integration with EJB3 • Stateless, Stateful session beans • Transactions, Security, etc: • Context propagation 15

×