emily's picture
From emily rss RSS  subscribe Subscribe

Java One 2005 Technical 



Communicate an overview of the technical content at Java One.
Articulate and generate ideas for the enterprise platform.

 

 
 
Tags:  Java  One 
Views:  3544
Downloads:  16
Published:  August 06, 2007
 
0
download

Share plick with friends Share
save to favorite
Report Abuse Report Abuse
 
Related Plicks
JAVA Training Syllabus Course

JAVA Training Syllabus Course

From: neilmodi
Views: 69 Comments: 0
Java programming language which was developed with an initiative to write once and run anywhere is virtually the base of every networked application. Java is one of the most popular programming languages today used for developing mobile applications (more)

 
Online Java Tutorials For Beginners (16)

Online Java Tutorials For Beginners (16)

From: James070709
Views: 33 Comments: 0

 
Hire Java Developers to Leverage Java Programming Needs

Hire Java Developers to Leverage Java Programming Needs

From: AliciaRodricks
Views: 406 Comments: 0
Hire Java Developer for Java Application Development, Java Application Programming, Customize Java Web Application. HWDI offer hire java developer for your java application development need for full-time, part-time contract hiring basis.
 
Java EE Tutorial

Java EE Tutorial

From: Billdigman
Views: 140 Comments: 0
http://wiki4.caucho.com/Java_EE_Tutorial_covering_JSP_2.2,_and_Servlets_3.0

This tutorial focuses on using Servlet's and JSP the right way. Servlet and JSP have evolved over the years, and now there (more)

 
The JAVA Training Workshop in Ahmedabad

The JAVA Training Workshop in Ahmedabad

From: neilmodi
Views: 36 Comments: 0
Java programming language which was developed with an initiative to write once and run anywhere is virtually the base of every networked application. Java is one of the most popular programming languages today used for developing mobile applications (more)

 
JAVA programming for JAVA Web Application Development

JAVA programming for JAVA Web Application Development

From: davidruff
Views: 349 Comments: 0
Our Java development services include Java web solutions, dynamic Java software development, dynamic Java web development services etc. We also develop on a number of Java development commercial and open source software frameworks. Get More Java Fra (more)

 
See all 
 
More from this user
NSDI - Poland

NSDI - Poland

From: emily
Views: 2780
Comments: 0

Welcome to the Minnesota SharePoint User Group

Welcome to the Minnesota SharePoint User Group

From: emily
Views: 6342
Comments: 0

Java One 2002 Overview

Java One 2002 Overview

From: emily
Views: 2931
Comments: 0

SQL Server 2005

SQL Server 2005

From: emily
Views: 3959
Comments: 1

CATPDG Quick Start Demo

CATPDG Quick Start Demo

From: emily
Views: 1807
Comments: 0

 
See all 
 
 
 URL:          AddThis Social Bookmark Button
Embed Thin Player: (fits in most blogs)
Embed Full Player :
 
 

Name

Email (will NOT be shown to other users)

 

 
 
Comments: (watch)
 
 
Notes:
 
Slide 1: Java One Technical Conference Report 2005
Slide 2: Goals • Communicate an overview of the technical content at Java One. • Articulate and generate ideas for the enterprise platform.
Slide 3: General Presentation Overview • • • • • • • • General Sessions/Keynote overview Java SE 6 Java EE 5 EJB 3.0 Concurrency Maven APT Agile Methods
Slide 4: Web-Specific Presentation Overview • • • • • • • • • Attend in Michigan July 25 Rich UIs with AJAX and JSF What's New in WebLogic 9 Hacking a Web Application Hibernate 3 JavaServer Faces and Shale Tapestry Scripting Framework Other talk overviews
Slide 5: General Presentation
Slide 6: General Session and Announcements • Start of “Participation Age” • Enterprise Service Bus: JBI implementation open source – get it from open-esb.java.net • Studio Creator EA 2 – Built on NetBeans – WYSIWYG JSR 168 Portlets, calendars, sortable tables, WS
Slide 7: Platform Roadmap • “Mustang” is Java SE 6, “Dolphin” Java SE 7 • See Mustang spec: JSR 270 • Summer 2006 for Mustang release. • Major new edition every 18 months
Slide 8: Themes for Java SE 6 • 1) Compatability, Stability, Quality • 2) Diagnosis, Monitor, Manage – JMX upgrade, jconsole upgrade, jvm instrumentation • 3) XML and Web Services – JAXWS 2, JAXB 2 – End of the “pure client”
Slide 9: More Themes for Java SE 6 • 4) Ease of Development – Simplify tasks (annotations and scripting languages) – JDBC 4.0 support, including DB XML – Javadoc update JSR 260 (big classes) • 5) Desktop Focus – Full Longhorn support with Avalon LNF – LCD Font rendering, system tray, boost for OpenGL/Direct X • 6) Compatability
Slide 10: JSE 6: Compiler API • JSR 199 Compiler API: Compiler c = new Compiler(); c.setOutputDir(“build/classes”); c.setSourceDir(“src”); c.compile(); c.run(“Main.class”)
Slide 11: JSE 6: JDBC 4, JAXB 2.0, WS • Just tell driver to get a connection, less code. • java.sql.SQLXML support • Instead of dealing with XML at anglebracket level: @XmlType public class SomeBean {} //this bean now matches an XML document • @WebService public class Hello
Slide 12: JSE 6: Other improvements • Scriptable Dtrace • javac -cp ‘…:jaxb/lib/*’ (don’t have to specify each JAR)
Slide 13: Themes for Java SE 7 “Dolphin” • • • • • direct literal XML support “friends” new JVM bytecode for dynamic languages More NIO (JSR 203) Different package/deploy architecture (not JARs, EARs, etc) • BeanShell Scripting language support (JSR 274)
Slide 14: Platform Roadmap for EE • • • • • POJO based programming model. Fewer deploy descriptors Extensive annotations Dependency injection Annotations will map Java to XML, Java to DB, and simplify EJBs
Slide 15: Major Features for Java EE 5 • WS support expanded – Support SOAP 1.2, Schema, WS-I (Basic profile, attachment profile) • Make WS easier (no clients, annotations). Ex: – @WebService public class Hello {} • EJB 3, JSP 2.1 (mostly EL), JavaServer Faces • New Persistence API – One model usable in JSE/Entities
Slide 16: Status of Java EE 5 • • • • All Specs available now Spec final draft Q305 Beta in Q405 Final Release Q106
Slide 17: Project Glassfish • an implementation of Java EE • Can be downloaded via CVS and built with Maven • See http://glashfish.dev.java.net
Slide 18: BEA Announcements • BEA will certify JavaServer Faces, Spring, Struts, and Beehive frameworks on their platform • WebLogic 9 will be out in August 05. • Workshop was retooled for Eclipse, and they’ll make direct IDE support for Tomcat and Geronimo available in it. • Abstraction of their server tool allows admin of Tomcat and Geronimo from BEA console
Slide 19: EJB 3 • • • • • No required Deployment Descriptor No home object No JNDI in client view Business interface is now a POJO Native O/R Mapping, simplified persistence • Compatibility with EJB 2.1 and 2.0 clients and beans
Slide 20: EJB 3 Stateless Session Bean and DataSource Example @Stateless public class PayrollBean implements IPayroll { @Resource DataSource empDB; public void doWork(int x) { Connection conn = empDB.getConnection(); //do work with conn } }
Slide 21: Dependency Injection @Resource works because of dependency injection at construction Dynamic look up (no JNDI in developer’s view)
Slide 22: Simplified Client View • Session beans have only business interface • No RemoteExceptions are visible to client • 100% POJO interface • Access can be local or remote
Slide 23: EJB 3 Client View Example @EJB ShoppingCart mycart; Collection cartItems = myCart.getItems();
Slide 24: Transactions in EJB 3 • CMT by default, BMT by annotation • Transaction attribute required by default • Transactions specified at class level, can be overridden at method level Example: @TransactionAttribute(MANDATORY) public void doWork(int I) {…}
Slide 25: Security in EJB 3 • Typically done at deploy time • Can override or specify at method level Example: @RolesAllowed(“HR-Admin”) public void doWork(Employee e) { …}
Slide 26: Simplified Life Cycle Implementation Container calls bean on life cycle events: @PostConstruct @PreDestroy @PrePassivate @PostActivate • This removes ejbCreate, ejbRemove, etc. • Can attach callback listener class to respond to life cycle events.
Slide 27: Persistence in EJB 3 • Goals include: – Persistence API that includes use outside container – Support pluggable third party persistence at runtime – Support O/R (Hibernate, TopLink, JDO) based – Complete query capabilities – Support light-weight domain modeling, with inheritance and polymorphism
Slide 28: Entity Beans in EJB 3 • • • • Entities are now simple POJOs No required interfaces No required callback interfaces Usable as regular objects in other tiers (can pass it around without needs for DTO) • Usable across multiple transactions, spanning multiple requests
Slide 29: Entity Manager • Like JDO Persistence Manager • Serves as factory for query objects • Developer controls mapping, which can be expressed in XML or annotations
Slide 30: Questions about EJB 3
Slide 31: App Server 9.0 and Java EE 5 SDK • • • • Focus: Ease of use (annotations) Integration with many IDEs. Self-managing and self-healing Open source as Project Glassfish (Sun is responsible for compatability)
Slide 32: Writing Web Services in EE 5 • @WebService on POJO (becomes wsdl:port-type element) • @WebMethod on method (becomes wsdl:operation element) • Non-annotated methods aren’t published to the service. Example: @WebService public class Hello { public String hi() { return “hello”; } }
Slide 33: Deploying Web Services in EE 5 • Use apt to drop in autodeploy directory (code generation) • run method at http://localhost:8090/HelloService?WSDL
Slide 34: Talks not Discussed Here • Designing a high-performance Call Detail Record application • Using JAAS to implement a BioMetric J2EE application authenticator • JavaServer Faces Ecosystem • MDBs and JCA • Pragmatic SOA (BPEL) • JMS Tips • NetBeans
Slide 35: Scott McNealy Keynote • Bridge the Digital Divide for healthcare and education • View it at http://java.sun.com/javaone/
Slide 36: Collections in JDK 5 • Generics, covariants, concurrency should be discussed in their own presentations • Can read about concurrency in Mustang at: http://gee.cs.oswego.edu/dl/concurrency-
Slide 37: Concurrency
Slide 38: Concurrency • • • • • New in Java 5: java.util.concurrent Thread Pools, Task Scheduling Concurrent Collections Atomic variables Locks, Conditions, Synchronizers
Slide 39: Why Concurrency? • wait(), notify(), and synchronize are hard to use, specified at a low level, can lead to poor performance • Lots of wheel reinventing
Slide 40: Goal of Concurrency • Do what Collections did for data structures • Allow development of thread-safe classes, such as servlets, built on concurrent building blocks (like ConcurrentHashMap) • Make some solved things easier for masses • Make very hard things solvable by experts
Slide 41: Task Scheduling (Executor) • Use anExecutor.execute(aRunnable) • Do NOT use new Thread(aRunnable).start()
Slide 42: Why Prefer Executor? • Executor framework allows for a variety of execution policies • Provides cancellation and shutdown support • Created via factory • Can customize shutdown hooks • Simpler interface • Code that submits a task doesn’t have to know in what thread the task will run
Slide 43: Executor Service • ExecutorService supports graceful and immediate shutdown • Has a lifecycle • Has many useful utility methods • Can get a single threaded executor • Bad Example: Webserver in a while() loop listens forever and starts a new thread for each request.
Slide 44: Threads • Threads are expensive to create, can require 500K of memory during creation • Your threads spend a lot of time contextswitching, even if you have 10 processors • Whenever you want to start a thread, don’t: use Executor
Slide 45: Using Executor Executor pool = Executor.newFixedThreadPool(7); …socket.accept(); … Runnable r = new Runnable() { //handle request } pool.execute();
Slide 46: Interface Callable • Functional analog of Runnable • public interface Callable<V> { V call() }
Slide 47: Future • Holds result of asynchronous call, normally a Callable. Can find out if this task is complete, cancelled, etc. • Implementing caches is tricky--often we’re just moving the bottleneck from computation to serialization most of the time.
Slide 48: ScheduledExecutorService • SES is a drop-in replacement for Timer • Supports pooling
Slide 49: Concurrent Collections • Pre Java 5 was thread-safe but not concurrent. • Every method was synchronized. This was okay because we weren’t on multi-core machines. • Azul has a 384-way box now--running Java on that would have been problematic. • Old collections required locking during
Slide 50: New: ConcurrentHashMap • Drop-in replacement for Hashtable • No iterator throws ConcurrentModificationException • Allows read/write overlaps. • It is therefore weakly concurrent
Slide 51: New: CopyOnWriteArrayList • Locking during iteration hurts scalability. • Changes made by other threads may or may not be noticed by reads
Slide 52: New: Queue • retrofit (non-thread safe) implemented by LinkedList
Slide 53: New: BlockingQueue • Extends Queue to provide two operations: • take(): wait for queue to be non-empty • put(): wait for queue to have room
Slide 54: Use of monitor synchronization is fine for most apps BUT: • Single wait-set per lock • No way to interrupt a thread waiting for a lock • No way to time out when waiting for a lock • Locking must be block-structured • Inconvenient to acquire a variable number of locks at once. • Advanced techniques not possible • Lock objects address these concerns
Slide 55: Lock Objects • Address synchronization monitor issues • Provide a high-level interface: – lock – tryLock (tells you if you got it) – unlock – newCondition (every object can’t provide conditions)
Slide 56: ReentrantLock • High-Performance, covers 99% of use cases • Re-entrant, mutual exclusion lock offers same semantics as synchronized but with extra features • Can interrupt a thread waiting to acquire a lock • Can specify a timeout while waiting • Can poll for lock availability
Slide 57: Re-entrant Lock Example Lock lock = new ReentrantLock(); … lock.lock(); try { //do work } catch …{ //resolve invariants and rethrow } finally { lock.unlock(); }
Slide 58: ReadWriteLock • Multiple reader, single writer exclusion lock • ReadWriteLock class defines a pair of locks: interface ReadWriteLock { Lock readLock(); Lock writeLock(); } • Use for frequent, long reads w/ few writes. • Various implementation policies
Slide 59: Condition Interface • Condition is an abstraction of wait/notify • Monitor-like operations for working with Locks • Can awaitUntil(Date deadline) or • awaitNanos(long nsToWait) • Advantages over wait/notify include multiple conditions per lock
Slide 60: Synchronizers • Utility classes • Low level
Slide 61: New Synchronizers: • Semaphor: Represents a permit manager • CountdownLatch: Gate with one or more padlocks -- allows 1 or more threads to wait for a set of threads to complete action • Exchanger: Allows two threads to rendezvous and exchange data, then go their separate ways.
Slide 62: Atomic Variables • • • • Support Compare-and-set Get, set, and arithmetic operations Abstraction of volatile variables Ten main classes (AtomicInteger and other wrappers) can be used instead of synchronizing access
Slide 63: New Concurrency in Java 6 • ConcurrentSkipLists • Deque interface for double-ended queues.
Slide 64: Maven • Goal: to make development and project comprehension easier • Started in 2003, used by many Apache projects • Java focused now, but expanding • Provides library abstraction over subversion, ClearCase, etc. • It is a dependency-management and documentation tool. Applies patterns to a build infrastructure.
Slide 65: How Maven Achieves Goals • Declarative build • Use repositories for dependency management • plugins • documentation system • reporting system
Slide 66: Maven Advantages • Low setup cost • Easy to embrace best practices • Easy tool integration
Slide 67: Nomenclature • • • • POM Artifacts SiteDoc Reporting
Slide 68: POM • fundamental unit of work • A client.jar, app.jar and common.jar represent 3 different POMs • Usually is a deployable unit • SuperPOM is implicit parent for defaults
Slide 69: Repository • • • • Where artifacts are stored ibiblio stores 8000 projects ‘Local’ is a cache on developer box ‘Remote’ is a source over HTTP, CVS/SVN, FTP
Slide 70: Maven 2.0 • Feature complete, in Alpha 3 now • Final version in August • Complete rewrite
Slide 71: Adding Dependencies in Maven • • • • Declaration will download it Dependencies are transitive POMs must be in repository Can make ‘dependency exclusions’
Slide 72: Maven Snapshots • Represents the last build • Automatically adds version, ts, build# • Updates daily, on demand, or at intervals
Slide 73: Project File • Unified project file is self-contained • No file-system references make it usable from repository • Allows Profiles (user ID, sourceforge login, etc) • Supports BeanShell for rapid prototyping
Slide 74: More Maven Info • Sun uses Maven for its projects now (Glassfish) • Maven Book ranked 3rd in book sales at JavaOne • Plugins for xDoclet, numerous other tools • Website at http://maven.apache.org
Slide 75: APT
Slide 76: APT • Annotation Processing Tool • Metadata you can associate with program elements • Doesn’t change your byte code, but could • Annotations can be read from Source, Reflection, or ByteCode
Slide 77: Annotating Interface Example public @interface JavaTalk { public boolean isAlumni() default false; }
Slide 78: Annotatable Structures • • • • • Enums Strings Primitives Class objects 1-dimension arrays
Slide 79: Why Annotations? • Support declarative programming style • Reduce boilerplate by generation • Ease maintenance by expressiveness
Slide 80: Meta-Annotations • java.lang.annotation.* • @Target: kinds of elements Annot can be used on • @Retention: source|class|runtime • @Documented: is in public API? • @Inherited: can a subclass inherit this Annot. From its superclass?
Slide 81: Annotations Used In • • • • JSR 181 (ES) JSR 220 (EJB 3) JSR 250 (Common Annotations) testng.org (Junit extension)
Slide 82: APT is Meta-Programming • Annotations are an instance of programming based on program’s structure • APT: Annotation Processing Tool • Processes .java source files through apt to get XML, HTML, .java, etc. • Proceesing is recursive
Slide 83: How apt Works • Keeps track of all annotations and tries to discover something in classpath that knows how to deal with it. • Can then create additional documents for build or runtime • Because a new source could be created that also has annotations in it, apt must be recursive • Feed JAR and class files through apt, just like source.
Slide 84: APT API
Slide 85: Using Sun’s APT API • com.sun.mirror (not community standard) • Two parts: – Language Modeling: com.sun.mirror.declaration – Type System: com.sun.mirror.type
Slide 86: Declarations in APT API • Declarations package represents structure of source code and its hierarchy • Declarations are program elements (Package, Enum, Field, Method, Constructor, AnnotationType, etc) • From a declaration you get – Doc comments – Source position – Names – Etc.
Slide 87: Type Hierarchy in APT API • Primitive, Void, Reference, Class, Enum, Interface, Array, etc. • From a Type you get: – Type arguments – Corresponding declaration – Supertypes – Etc.
Slide 88: Processor - Tool Interaction • Annotations processor • Annotations processor factory • Annotations processor environment – Access to programming model – File creation – Diagnostics
Slide 89: Roles in Writing a Processor • • • • • • Role 1: Writer of Annotations Role 2: Writer of Annotation Processor Role 2b: Packager of Processor into JAR Role 3: Client Role 3b: End user Use API: com.sun.mirror (not community standard) • Two parts: – Language Modeling:
Slide 90: Write Your Own Annotation Processor
Slide 91: Why Write Your Own Processor? • Add an operation to the type hierarchy • Let clients implement their own typespecific operations
Slide 92: Writing a Processor, pt1 • Use Visitor pattern • Define Visitor interface with method for each type to be visited: – visitFoo(Foo f) – visitBar(Bar b) • Include an accept() method with a visitor parameter in the type hierarchy – myClass.accept(myVisitor) • Client calls the accept() method
Slide 93: Writing a Processor, pt 2 public class MyFactory implements AnnotationProcessorFactory {} public class MyProcessor implements AnnotationProcessor {}
Slide 94: Run the Processor • Install your annotation processor JAR on classpath • run apt: %apt MySource.java
Slide 95: Future of APT • Will be reimplemented for Java 6 • Existing APIs will be open-sourced • See JSR 199: Programmatic Access for Tools • Read http://java.sun.com/j2se/1.5.0/docs/guide/ apt/index.html
Slide 96: Agile
Slide 97: Agile Methods • http://craiglarman.com • http://agilemodeling.com • http://davidhecksel.com • • • • • Agile Modeling Enterprise Unified Process Pragmatic Programmer Death March Balanced Agility and Discipline
Slide 98: Agile Ideas • Have a 10 minute stand up meeting every morning • Charge $1 if people are late to meeting • QA is constant throughout and is part of core team • Make your unit tests a release of their own. • If 3 weeks is too long, your task is too big
Slide 99: Presentation Available at: • M:\\somewhere
Slide 100: Discussion

   
Time on Slide Time on Plick
Slides per Visit Slide Views Views by Location