Your SlideShare is downloading. ×
  • Like
  • Save
Tech  Days 2010
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Tech Days 2010

  • 1,549 views
Published

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,549
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
22
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Tech Days 2010 from Oracle Luqman Shareef www.luqmanshareef.com [email_address] March 24-25 2010 Hyderabad
  • 2. The event
    • Ravichandra Kulur and band kick started the event, with flute, guitar, keyboard and drums
    Krishna Dhawan, Managing Director, Oracle India talked about the re-enforced commitment to Java.
  • 3.  
  • 4. Technology showcase: Be inspired
    • Demos on Day 1
      • Teleporting - a new feature in Virtual Box
        • A running Virtual Machine can be moved between different hosts across different architectures, different Operating Systems etc.
      • A cool drawing tool in JavaFX
    • Demos on Day 2
      • Java EE 6
      • JavaFx
        • For Desktop, for mobile and for TV
    04/05/10
  • 5. James Gosling, Father of Java gave an overview of the Java ecosystem. To run through his slides James was using an application that he developed using JavaFX
  • 6. From James presentation…
    • 15 million JDK downloads / week
    • 10 billion Java devices (more than number of humans on earth)
      • 5.5 billion smart cards
      • 2.6 billion mobile devices
      • 100 million Java TV devices
      • Gizmos
    • 6.5+ million Java developers
    • Most college grads have taken a Java course – Worldwide. “Learn once, work anywhere”
  • 7. What’s new in JDK 7
    • Modularity – JDK is getting bigger and bigger with the addition of new APIs. It is ought to be modularized.
      • Project Jigsaw : The goal of this Project is to design and implement a simple, low-level module system focused narrowly upon the goal of modularizing the JDK, and to apply that system to the JDK itself.
      • http://openjdk.java.net/projects/jigsaw/
    • Dynamic language support – The magic is in the virtual machine. Supports lots of scripting languages.
      • Ex: Scala, Ruby, Groovy, Pyhon, Javascript etc.
    • G1 (Garbage First) Garbage collector.
    • NIO2 (New IO
      • Improving performance of very large scale app services
    • Compressed pointers.
      • 32G == 4G
      • 32 G Address space gives same performance as 4G Space
  • 8. Java EE 6 (From Arun Gupta’s presentation)
  • 9. Java EE 6 Contd…
  • 10. Java EE 6 Contd…
  • 11. Goals for the Java EE 6 Platform
    • Flexible & Light-weight
    • Extensible
      • Embrace Open Source Frameworks
    • Easier to use, develop on
      • Continue on path set by Java EE 5
  • 12. What’s new in JEE 6? (Spec released in Dec 2009)
    • Includes
      • EJB 3.1, JPA 2.0, Servlets 3.0, JAX-RS 1.1, JSF 2.6, JAX-WS 2.2, Interceptors 1.1, etc.
    • Pluggability / Extensibility – Create a playing field for third-party applications.
    • Web profile – A fully functional, mid-size stack for modern web development.
    • Dependency Injection – Uses the annotation facility to achieve this.
    • GlassFish 3.0 is the reference implementation of JEE6.
  • 13. Java EE 6 Web Profile 1.0
    • Fully functional mid-sized profile
      • Actively discussed in the Java EE 6 Expert Group and outside it.
      • Technologies in web profile
    Servlets 3.0 JSP 2.2 EL 2.2 JSTL 1.2 EJB 3.1 Lite JTA 1.1 JPA 2.0 Bean Validation 1.0 Managed Beans 1.0 JSF 2.0 Common Annotations 1.1 Interceptors 1.1 Context & Dependency Injection 1.0
  • 14. Java EE 6 is Lightweight
    • Pruning
      • Make some technologies optional
    • Pruned today, means
      • Optional in the next release
      • Deleted in the subsequent releases
    • Technologies marked in Javadocs
      • JAX-RPC, EJB 2.x Entity Beans, JAXR, JSR 88
  • 15. Java EE 6 is Extensible
    • Embrace open source frameworks
      • Wicket, Lift, Spring, Struts, ...
    • Zero-configuration, drag-and-drop for web frameworks
      • Servlets, servlet filters, context listeners for a framework get discovered and registered automatically
    • Plug-in libraries using web fragments
  • 16. Glassfish V3
  • 17. Glassfish is
    • A community
      • Users, Partners, Testers, Developers, ...
      • Started in 2005 on java.net
    • An application Server
      • Open Source (CDDL & GPL v2)
      • Java EE Reference Implementation
  • 18. CLI-based Administration
    • “ asadmin” CLI utility
    • Administrative commands can be added with each container
    Available as : asadmin myCommand –s1 foo –s2 bar @Service(name=”myCommand”) public class ChangeRandomCtr implements AdminCommand { @Param String s1; @Param String s2; … }
  • 19. Glassfish REST Interface
    • REST interface to management and monitoring data
    • Configuration data, commands invocation, (start/stop instance, deploy, undeploy, ...), CRUD resources (JMS, JDBC, ...)
        • localhost:4848/management/domain
        • localhost:4848/monitoring/domain
    • GET, POST, DELETE methods
    • XML, JSON, HTML reps
  • 20. Oracle said ..
    • “ GlassFish joins WebLogic Server in the best Java EE application server offering in the industry”
    • “ GlassFish continues as the Java EE RI and as an open source project.”
    • “ Oracle plans to add GlassFish Enterprise Server to all WebLogic offerings.”
    • “ GlassFish also available as standalone offering.”
    http://blogs.sun.com/arungupta/entry/glassfish_strategy_by_oracle_sun
  • 21. Java FX
  • 22. What is JavaFX?
    • It is Scripting Language to create rich media and content
    • It is a declarative scripting language for GUI
    • It Runs on JVM
    • It utilizes Java class libraries
    • The JavaFX Platform
      • A rich client platform for crossscreen rich internet applications (RIA) and content
      • Contains 2D graphics, Animation, Text and Media.
      • Contains device specific elements for desktop, mobile and TV
    04/05/10 Compile javafxc script.fx Run javafx script
  • 23. JavaFX Platform 04/05/10
  • 24. Some JavaFX APIs
    • javafx.scene.geometry
      • Circle, Polygon, Arch, Eclipse, MoveTo, …
    • javafx.scene.paint
      • Color, Paint, …
    • javafx.animation
      • Interpolatable, Interpolator,
      • KeyFrame, Timeline …
    04/05/10 Example import javafx.scene.geometry.*; import javafx.scene.paint.*; Ellipse { centerX: 50 centerY: 50 radiusX: 50 radiusY: 25 fill: Color.BLACK }
  • 25. Performance Tuning Garbage Collection 04/05/10
  • 26. Garbage Collection
    • JVM Options
      • Standard options : Work in all platforms
      • -X options : May not work in some platforms
      • -XX options : May not work in some platforms & May need additional privileges to use
      • (There are more than 400 –XX options in Java 6 JRE)
    • Three different Garbage Collectors
      • Serial Collector
      • Parallel Collector
      • Concurrent Collector
    04/05/10
  • 27. Serial vs. Parallel Vs. Concurrent GC
    • Serial Collector
      • Uses single thread to perform GC.
      • Suited to most desktop applications
      • Can be enabled with the option -XX:+UseSerialGC
    • Parallel Collector
      • Also known as throughput collector
      • Performs minor collections in parallel
      • Suited for applications running on multiprocessor or multi-threaded hardware
      • Can be enabled with the option -XX:++UseParallelGC
    • Concurrent Collector
      • Performs most of its work concurrently (while the application is still running)
      • Keeps the Garbage Collection pauses short
      • Suited for applications for which response time is more important than overall throughput
      • Can be enabled with the option -XX:++UseConcMarkSweepGC
    04/05/10
  • 28. Memory pools for HotSpot JVM
    • A  memory pool  represents a memory area that the JVM manages.
    • Eden Space (heap)
      • Pool from which memory is initially allocated for most objects.
    • Survivor Space (heap)
      • Pool containing objects that have survived GC of eden space.
    • Tenured Generation (heap)
      • Pool containing objects that have existed for some time in survivor space.
    • Permanent Generation (non-heap)
      • Holds all the reflective data of the virtual machine itself, such as class and method objects. With JVMs that use class data sharing, this generation is divided into read-only and read-write areas.
    04/05/10
  • 29. HotSpot VM Heap Layout 04/05/10
  • 30. Garbage First (G1) GC
    • It is new GC that is being introduced in the Java HotSpot VM in JDK 7.
    • Experimental version of G1 has been released in Java SE 6 Update 14.
    • It is a replacement of CMS (Concurrent Mark Sweep) GC.
    • Features of G1
      • Server style GC
      • Parallel and Concurrent
      • Generational
      • Compacting (Not available in CMS)
      • Predictable (Not available in CMS)
    • Can be enabled with the following two parameters
      • -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC
    04/05/10
  • 31. Hints for GC tuning
    • GC Nirvana
      • Low GC overhead
      • Low GC pause times
      • Good space efficiency
    • Unfortunately, reality is you must choose any two out of the above three options.
    04/05/10
  • 32. JPA 2.0 04/05/10 http://blogs.sun.com/arungupta/entry/day_2_tech_days_2010
  • 33. JPA 2.0 (JSR 317)
    • Part of Java EE 6 and/or available standalone
    • More sophisticated mapping and modeling options added.
    • Expanded query language
    • Adds Criteria API, together with Metamodel API
    • Support for Validation
    • EclipseLink is reference implementation
    • Integrated in GlassFish
    04/05/10
  • 34. What is new in JPA 2.0?
    • Element collections
    • Embeddable classes
    • Persistently ordered lists
    • Improved Map support
    • More relationship mapping options
    • Criteria API
    • Metamodel API
    • Validation Support
    • Pessimistic Locking
    • Caching Configuration
    04/05/10
  • 35. Element Collection and Embeddable classes
    • Element collections
      • Collections of strings, integers, floats, decimals etc
      • Collections of embeddable classes
    • Embeddable classes
      • Nested embeddables; embeddables with relationships
    04/05/10 @Entity public class Person { @Id protected String ssn; protected String name; protected Date birthDate; . . . @ElementCollection protected Set<String> nickNames; } @Embeddable public class Address { String street; String city; . . . } @Entity public class RichPerson extends Person { . . . @ElementCollection protected Set<Address> vacationHomes; . . . }
  • 36. Java Persistence Query Language
    • String-based SQL-like query language
      • SELECT, FROM, WHERE, GROUP BY, ORDER BY,…
    • Queries written over Java domain model
      • Entities, state, relationships
      • Supports navigation using dot-notation
      • Mapped into SQL by the provider
    • Supports static and dynamic use
      • SELECT AVG (p.price)
      • FROM Order o JOIN o.products p
      • WHERE o.customer.address.zip = ‘94301’
    04/05/10
  • 37. Criteria API
    • Object-based API for building queries
    • Designed to mirror JPQL semantics
    • Strongly typed
      • Based on type-safe metamodel of persistent classes and relationships
      • Heavy use of Java generics
      • Supports object-based or string-based navigation
    • Query construction at development time or runtime
    04/05/10 EntityManager em = …; CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<ResultType> cquery = cb.createQuery(ResultType.class); Root<MyEntity> e = cquery.from(MyEntity.class); Join<MyEntity, RelatedEntity> j = e.join(…); … cquery.select(…) .where(…) .orderBy(…) .groupBy(…); TypedQuery<ResultType> tq = em.createQuery(cquery); List<ResultType> result = tq.getResultList();
  • 38. Servlet 3.0 04/05/10
  • 39. Servlet 3.0
    • Ease of Development
      • Through annotation
    • Dynamic registration of Servlets and Filters
      • During runtime
    • Pluggability (of 3rd-party frameworks/libs)
      • No more tweaking of web.xml is needed
    • Asynchronous Servlet
      • Support Comet applications
    • Security enhancements
    04/05/10
  • 40. Annotations 04/05/10 Web.xml is not needed any more
    • @WebServlet
    • @WebFilter
    • @WebListener
    • @WebInitParam
    @WebServlet(urlPatterns=&quot;/simpletest&quot;, name=&quot;MyServlet&quot;, asyncSupported=true) public class SimpleServlet extends HttpServlet{ public void doGet(HttpServletRequest req,HttpServletResponse res){ // Code here } }
  • 41. Dynamic Registration of Servlets/Filters 04/05/10 public class TestServletContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletConext = sce.getServletContext(); // Servlets/Filters can be added during runtime ServletRegistration.Dynamic dynamic = servletContext.addServlet( &quot;DynamicServlet&quot;, &quot;com.mycom.MyServlet&quot;); dynamic.addMapping(&quot;/dynamicServlet&quot;); dynamic.setAsyncSupported(true); ....
  • 42. Asynchronous Servlet
    • Async. Servlets are to avoid “thread starvation” in cases such as
      • Waiting for resources like JDBC connection)
      • Waiting for events
      • Waiting for responses like web service responses
    • Better scalability
    04/05/10
  • 43. Pluggability (of 3rd party Frameworks)
    • Possible to use 3rd-party frameworks and libraries without configuring in web.xml
    • Each framework defines its own web-fragment.xml
      • Declares its specific controller servlet
      • Declares listener and filters
    • Container then collects them all
    • Order of the frameworks/libs can be
    • specified in the web.xml
    • A self-contained framework is
    • provided as a jar file and placed
    • under WEB-INF/lib
      • web.xml (optional)
      • WEB-INF/lib/ someframework1.jar ->
        • META-INF/web-fragment.xml
      • WEB-INF/lib/ someframework2.jar ->
        • META-INF/web-fragment.xml
    04/05/10 < web-fragment > <servlet> <servlet-name>MyFramework</servlet-name> <servlet-class>com.MyFrameworkServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>MyFramework</servlet-name> <url-pattern>/MyFramework</url-pattern> </servlet-mapping> ... </ web-fragment >
  • 44. EJB 3.1 04/05/10
  • 45. EJB 3.1
    • Packaging in a war file
      • EJB components can be
      • packaged directly inside
      • a web application archive
      • (war file)
    • Optional Local Interfaces
      • One source file enough
      • for a bean
    04/05/10 @Stateless public class HelloWorldBean { // No interface public String sayHello() { return &quot;Hello World!&quot;; } }
  • 46. EJB 3.1 contd…
    • Singleton
      • A single instance per application
    • Asynchronous calls
    04/05/10 @Singleton public class MyCacheBean { private Map cache; public Map getCache() { … .. } public class MySampleBean { @Asynchronous public Future<Long> sendEmail(String id){ ... }
  • 47. EJB 3.1 contd…
    • Cron-based Timer Service
      • Cron-like syntax
        • second [0..59], minute[0..59], hour[0..23]...
        • dayOfMonth[1..31]
        • dayOfWeek[0..7] or [Sun, Mon..]
        • Etc.
    • Embeddable Container
      • API allows to
        • Initialize a container
        • Get container ctx
    04/05/10 @Stateless public class WakeUpBean { @Schedule(dayOfWeek=&quot;Mon-Fri&quot;, hour=&quot;9&quot;) void wakeUp() { ... }
  • 48. EJB Lite
    • Meets the needs of applications that require only a subset of the features provided by EJB technology.
    • Features included
      • Stateless, stateful, and singleton session beans
      • Local EJB interfaces or no interfaces
      • Interceptors
      • Container-managed and bean-managed transactions
      • Declarative and programmatic security
      • Embeddable API
    04/05/10
  • 49. Thank You 04/05/10 Visit www.luqmanshareef.com