• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
JBoss seam 2 part
 

JBoss seam 2 part

on

  • 1,986 views

 

Statistics

Views

Total Views
1,986
Views on SlideShare
1,983
Embed Views
3

Actions

Likes
0
Downloads
10
Comments
0

2 Embeds 3

http://www.linkedin.com 2
http://paper.li 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    JBoss seam 2 part JBoss seam 2 part Presentation Transcript

    • Conversation and ORM
      • Introduction to conversation
      • Nested conversations
      • Page flow and back button
      • Persistence context
      • JPA ”delegate”
      • Exception handling
      • Q&A
    • Conversations
      • Keep objects for linked pages or actions
      • Transparently propogates the state of objects
      • No issues with concurrent states
      • Back button support
      • Full management by API
    • Conversation's lifecycle
      • Temporary conversation is exists
      • Restore at the end of restore view phase of JSF (cid=xxx - request parameter)
      • @Begin starts a long-running conversation
      • @End finishes a long-running conversation
      • Store at the end of render phase of JSF
      • Destroy the contents of a temporary conversation
      • Any faces requests will propogate the conversation context
    • Simple example
        @Name(”invoiceAction”) @AutoCreate @Scope(CONVERSATION) public class InvoiceAction implements Serializable {
          private Invoice currentInvoice; @Begin public void start(Long invoiceId) { currentInvoice = em.find(Invoice.class, invoiceId) } @End(beforeRedirect = true) public String update() { em.merge(currentInvoice); return ”success”; } }
    • How to start conversation
      • @Begin, @Begin(nested=true), @Begin(join=true)
      • <begin-conversation/> in pages.xml
      • <s:link propogation=”?”/>, <s:button propogation=”?”/>
      • <s:conversationPropogation/> for <h:commandLink/>, <h:commandButton/>
      • Conversation.instance().begin()
    • How to finish conversation
      • @End
      • <end-conversation/> in pages.xml
      • <s:link propogation=”end”/>, <s:button propogation=”end”/>
      • <s:conversationPropogation type=”end”/>
      • Conversation.instance().end()
    • Nested conversation
      • Conversation stack
      • No affects for outjected values with same name
      • Injection by conversation stack
      • Parent conversation finishes all nested conversations
    • Page flow
        <page view-id=&quot;/numberGuess.jsp&quot; no-conversation-view-id=”/main.jsp” login-required=”true” scheme=”http”> <restrict>#{s:hasRole('admin')}</restrict> <navigation> <rule if-outcome=&quot;guess&quot;> <begin-conversation/> <redirect view-id=&quot;/numberGuess.jsp&quot;/> </rule> <rule if-outcome=&quot;win&quot;> <end-conversation before-redirect=”true”/> <redirect view-id=&quot;/win.jsp&quot;/> </rule> <rule if=&quot;#{seamComponent.check}&quot;> <redirect view-id=&quot;/lose.jsp&quot;/> </rule> </navigation> </page>
    • Back button
      • <page name=&quot;checkout&quot;
      • view-id=&quot;/checkout.xhtml&quot;
      • back=&quot;enabled&quot;/>
      • Nested conversations
    • Extended persistence context
      • Pattern ”open session in view” is obsolete
      • Increase scope of persistence context to conversation scope
      • Optimized for EJB containers
      • @PersistenceContext
      • @In
      • private EntityManager entityManager;
    • JPA ”delegate”
      • (Session) entityManager.getDelegate()
      • <factory name=&quot;session&quot;
      • scope=&quot;STATELESS&quot;
      • auto-create=&quot;true&quot;
      • value=&quot;#{entityManager.delegate}&quot;/>
      • @In
      • private Session session;
    • Managing exceptions
      • @ApplicationException(rollback=true, message=”some text”)
      • PersistenceException