• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Java EE 6 workshop at Dallas Tech Fest 2011
 

Java EE 6 workshop at Dallas Tech Fest 2011

on

  • 4,739 views

Java EE 6 workshop at Dallas Tech Fest 2011

Java EE 6 workshop at Dallas Tech Fest 2011

Statistics

Views

Total Views
4,739
Views on SlideShare
2,410
Embed Views
2,329

Actions

Likes
0
Downloads
32
Comments
0

11 Embeds 2,329

http://blogs.oracle.com 2296
http://httpwebpages.com 16
http://www.hanrss.com 7
http://www.5z5.com 2
http://127.0.0.1:8775 2
http://translate.googleusercontent.com 1
http://feeds.feedburner.com 1
http://www.rssbee.net 1
http://oraclearea51.com 1
http://rscat.com 1
http://web1.conversationminer.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Java EE 6 workshop at Dallas Tech Fest 2011 Java EE 6 workshop at Dallas Tech Fest 2011 Presentation Transcript

    • Java EE 6 = Less Code + More PowerArun Gupta, Java EE & GlassFish Guyblogs.oracle.com/arungupta, @arungupta 1
    • The following is intended to outline our generalproduct direction. It is intended for informationpurposes only, and may not be incorporated intoany contract. It is not a commitment to deliver anymaterial, code, or functionality, and should not berelied upon in making purchasing decisions.The development, release, and timing of anyfeatures or functionality described for Oraclesproducts remains at the sole discretion of Oracle.
    • The Java EE 6 Platform Servlets 3.0 JPA 2.0 EJB 3.1 JDBC StAX Interceptors JSF 2.0 JAX-RS JNDI JavaMail 1.1 Bean EJB 3.1 Lite JAXB JMS JACC Validation1.0 JSP 2.2 CDI 1.0 JAX-WS JAXP SAAJ Managed JTA 1.1 JASPIC JAX-RPC ... Beans 1.0 Contributed by RedHat New Updated Web Profile 1.0
    • Light-weight● Java EE 6 Web Profile● Pruning ● Pruned today, means – Optional in the next release – Deleted in the subsequent releases ● Technologies marked in Javadocs – EJB 2.x Entity Beans, JAX-RPC, JAXR, JSR 88
    • ● EJB-in-WAR● No-interface EJB● Optional “web.xml”/”faces- config.xml”● Annotation-driven ● @Schedule ● @Path ● @Inject ● ...
    • <web-fragment> <filter> <filter-name>wicket.helloworld</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>...</param-value> </init-param> </filter> <filter-mapping> <filter-name>wicket.helloworld</filter-name> <url-pattern>/*</url-pattern> </filter-mapping></web-fragment>
    • From the real users ... Jigsaw puzzle, Modular, standard, less xml, easy, Developers can concentrate easy, have I said easy? on business logic, Java EE 6 is providing a standard for Standards compliance, vendor the infrastructure. independence, milliseconds and kilobyte deployment Faster development, less frameworks, less complexity, more greatHigher integrated specs, code shippedsimple and annotation driven,single-classloader WARs,next level of industrystandard Definite excuse to avoid Spring forever Simplified Java Not your fat grandfathers Development, Focus on enterprise Java anymore, building great products enterprise Java renaissance http://blogs.oracle.com/arungupta/tags/community+feedback
    • Compatible Java EE 6 ImplsToday: Web Profile OnlyAnnounced:
    • 3.1 Overview● Built on GlassFish 3● Modular and Extensible HK2 Kernel ● ~260+ modules ● OSGi/Java EE Hybrid Apps● Clustering and High Availability ● HTTP, EJB, IIOP, SSO, Metro● Containers start on demand● End-to-end extensibility
    • Sample App Overview CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • What will we do ?1. Generate JPA Entities from the database table2. Refactor generated entities for a more intuitive O/R mapping3. Create an EJB for querying the database4. Create a Servlet for testing the EJB and displaying values from the database table5. Enable CDI and make the EJB EL-injectable6. Display the values in JSF2/Facelets-based view7. Expose JPA entities as a RESTful resource by using JAX-RS
    • What will we use ?
    • Generate JPA EntitiesAnd customize them CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Java Persistence API 2● Improved O/R mapping● Type-safe Criteria API● Expanded and Richer JPQL● 2nd-level Cache● New locking modes ● PESSIMISTIC_READ – grab shared lock ● PESSIMISTIC_WRITE – grab exclusive lock ● PESSIMISTIC_FORCE_INCREMENT – update version● Standard configuration options ● javax.persistence.jdbc.[driver | url | user | password]
    • Create an EJBFor querying the database CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Create an EJB – Sample CodeFor querying the database@PersistenceContextEntityManager em;public List<Customer> getCustomers() {return (List<Customer>)em.createNamedQuery("Customer.findAll").getResultList();}
    • EJB 3.1● Simplified Packaging● No interface view – one source file per bean● Embeddable API● @Singleton ● Initialization in @PostContruct● Simplified Cron-like syntax for Timer● Asynchronous Session Bean● Portable Global JNDI Name
    • Create a ServletFor testing EJB and display values from the database CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Create a Servlet – Sample CodeFor testing EJB and display values from the database@EJB CustomerSessionBean ejb;out.println(ejb.getCustomers());http://localhost:8080/JavaEE6SampleApp/TestServlet
    • Servlets 3.0● @WebServlet, @WebListener, @WebFilter, …● Asynchronous Servlets ● @WebServlet(asyncSupported=true)● Plugin libraries using web fragments● Dynamic registration of Servlets● WEB-INF/lib/[*.jar]/META-INF/resources accessible in the root● Programmatic authentication login/logout● Default Error Page● ...
    • Enable CDIMake the EJB EL-injectable CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Enable CDI – Sample CodeMake the EJB EL-injectable@javax.inject.Named
    • Contexts & Dependency Injection● Standards-based Dependency Injection● Type-safe – Buids on @Inject API● Context/Scope management● Strong Typing, Loose Coupling● Includes ELResolver @Inject @LoggedIn User userRequest What ?Injection Which one ? (Qualifier) (Type)
    • CDI● Qualifiers● Events● Stereotypes● Interceptors● Decorators● Alternatives● ...
    • Display the valuesIn JSF2/Facelets-based view CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Display the values – Sample CodeIn JSF2/Facelets-based viewhttp://localhost:8080/JavaEE6SampleApp/faces/index.xhtml<h1>Java EE 6 Sample App</h1><center>Powered by GlassFish!</center><h:dataTable value="#{customerSessionBean.customers}" var="c"><h:column>#{c.name}</h:column><h:column>#{c.customerId}</h:column></h:dataTable>
    • Java Server Faces 2.0● Facelets as “templating language” for the page ● Custom components much easier to develop● Integrated Ajax● “faces-config.xml” optional in common cases● Default navigation rules● Much more … ● Runs on Servlet 2.5+ ● Bookmarkable URLs ● Conditional navigation ● ...
    • RESTful resourceUsing JAX-RS CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • RESTful resource – Sample CodeUsing JAX-RS@Path("/customers")@GET@Path("/customer/{id}")@Produces("application/xml")public Customer getCustomer(@PathParam("id")Integer id) {return(Customer)em.createNamedQuery("Customer.findByCustomerId").setParameter("customerId", id).getSingleResult();}http://localhost:8080/JavaEE6SampleApp/resources/customers/customer/1@Produces({"application/xml", "application/json"})
    • JAX-RS 1.1● Java API for building RESTful Web Services● POJO based● Annotation-driven● Server-side API● HTTP-centric
    • Sample App Review CLI JPA Servlet EJB Database CDI JAX-RS JSF
    • Java EE for the Cloud : JSR 342● More easily operate on private/public clouds ● Multi-tenancy ● Elasticity ● Service Provisioning● Tighter requirements for resource/state management● Better isolation between applications● Potential standard APIs for NRDBMS, Caching, other● Common management and monitoring interfaces● Better packaging● Evolution, not revolution
    • Java EE 7 : Technology Refresh● Ease-of-development: JMS 2.0● Latest web standards ● New JSRs: Web Sockets, Java JSON API ● HTTP Client API (JAX-RS 2.0)● Possible JSRs inclusion ● Concurrency Utilities for Java EE (JSR 236) ● JCache (JSR 107)
    • Java EE 7 – When ?● Late 2012● Date-driven release ● Anything not ready will be deferred to Java EE 8● Participate ● Expert Groups forming ● Public discussion lists ● JCP membership free for individuals
    • Transparency Checklisthttp://jcp.org/en/resources/transparency NEW● EG members names● EG business reported on a publicly readable alias● Schedule is public, current and updated regularly● Public can read/write to a wiki● Discussion board on jcp.org● Public read-only issue tracker
    • ● Find out whats new with Java technology● See new tools and techniques● Learn how to create solutions● Network with peers● Meet with experts● Influence the future of the Java platform● 400+ sessions/BoFs/HOLs● ... oracle.com/javaone
    • References● oracle.com/javaee● glassfish.org● oracle.com/goto/glassfish● blogs.oracle.com/theaquarium● youtube.com/GlassFishVideos● Follow @glassfish
    • Java EE 6 = Less Code + More PowerArun Gupta, Java EE & GlassFish Guyblogs.oracle.com/arungupta, @arungupta 39