Seam Glassfish Perspective

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites

    Seam Glassfish Perspective - Presentation Transcript

    1. SEAM A GLASSFISH PERSPECTIVE DAN ALLEN JBOSS, A DIVISION OF RED HAT
    2. SEAM BRINGS JAVA EE TOGETHER JSF EJB 3
    3. SEAM'S MISSION “To provide a fully integrated development platform for building rich Internet applications based upon the Java EE environment.” - Gavin King http://in.relation.to/Bloggers/Seam3
    4. WHAT SEAM PROVIDES “Glue” – Contextual component model – Dependency injection framework – Enhanced EL Simplify Java EE trouble spots Manage Java Persistence correctly Modules to integrate third-party libraries Rapid development environment – Project generator, CRUD framework, hot deploy
    5. SEAM TODAY JavaServer Faces (JSF) Java Authentication and Authorization Service (JAAS) Facelets Hibernate search Java Persistence API (JPA) Drools Enterprise JavaBeans 3 (EJB 3) JavaScript / Ajax Java Transaction API (JTA) Quartz JAX-RS (RESTeasy) Wicket jBPM GWT JavaMail Spring framework iText (PDF) JBoss Cache JExcelApi (Excel) ...and more YARFRAW (RSS)
    6. SEAM EJB COMPONENT EJB Local Reference in web.xml <ejb-local-ref> <ejb-ref-name>vehiclesee/VehicleTradeBean/local</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>org.example.vehicles.action.VehicleTrade</local> </ejb-local-ref> EJB Local Interface and Seam SFSB component @Local @Stateful public interface VehicleTrade { @Name(\"vehicleTrade\") void trade(); public class VehicleTradeBean void remove(); implements VehicleTrade { } public void trade() { ... } @Remove public void remove() {} } How does Seam make the connection?
    7. RESOLVING AN EJB IN SEAM A shared concern First option: @JndiName Second option: Resolve JNDI from pattern – #{ejbName} ● Value of name attribute on @Stateful/@Stateless ● Unqualified class name of component ● Value of <ejb-name> in ejb-jar.xml or web.xml – Plug into Seam's jndiPattern SFSB reference stored in Seam context – Default is conversation context
    8. INVOKING AN EJB FROM JSF It's not a crime! <h:form> @Stateful ... @Name(\"vehicleTrade\") public class VehicleTradeBean <h:commandButton value=\"Trade\" implements VehicleTrade action=\"#{vehicleTrade.trade}\"/> { </h:form> public void trade() { ... } @Remove public void remove() {} } CLIENT SERVER
    9. JAVA PERSISTENCE
    10. PERSISTENCE MANAGER JPA EntityManager or Hibernate Session Manages object representations of database records Key services – First-level cache – Transparent database reads/writes Aligns well with use case – Seam terms this a “conversation”
    11. CONVERSATION = UNIT OF WORK The task at hand Often involves more than one request Requires state management
    12. EXTENDING THE PERSISTENCE CONTEXT Not expensive or dangerous! – “Just a HashMap” Challenging to do in Java EE – No good place to store it – Complex propagation rules We turn over this task to Seam
    13. TWO STYLES OF MANAGEMENT Seam (bi)jection Standard Java EE injection @In @PersistenceContext EntityManager entityManager; EntityManager entityManager;
    14. EXTENDING THE TRANSACTION Simulate a long transaction – Transcends many database/system transactions Manual flushing of persistence context – You control when write occurs – Rollback without involving database – Persistence context can be read-only – Only Hibernate provides this extension Need to replace JPA provider in GlassFish – Seam provides access to Hibernate extensions – Seam works agreeably with any JPA provider
    15. APPLICATION TRANSACTION Conversation (flushMode = MANUAL) Request Response Request Response ... Transaction Transaction load flush
    16. EMBEDDED JAVA EE TESTING SeamTest – Based on TestNG Test application “as is” – Full JSF life cycle – JTA, EJB 3, EL Currently uses Embedded JBoss – Has baggage Look forward to EJB 3.1
    17. SEAM A GLASSFISH PERSPECTIVE DAN ALLEN JBOSS, A DIVISION OF RED HAT

    + pelegripelegri, 2 years ago

    custom

    1375 views, 3 favs, 1 embeds more stats

    Seam a GlassFish Perspective by Dan Allen

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1375
      • 1374 on SlideShare
      • 1 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 70
    Most viewed embeds
    • 1 views on http://www.luizavila.com.br

    more

    All embeds
    • 1 views on http://www.luizavila.com.br

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories