Professional Documents
Culture Documents
WLS 12c IS - Oracle - Java
WLS 12c IS - Oracle - Java
1. Oracle Corporation (“Oracle”) is pleased to allow its business partner (“Partner”) to download and copy the information,
documents, and the online training courses (collectively, “Materials") found on this Site. The use of the Materials is
restricted to the non-commercial, internal training of the Partner’s employees only. The Materials may not be used for
training, promotion, or sales to customers or other partners or third parties.
2. All the Materials are trademarks of Oracle and are proprietary information of Oracle. Partner or other third party at no time
has any right to resell, redistribute or create derivative works from the Materials.
3. Oracle disclaims any warranties or representations as to the accuracy or completeness of any Materials. Materials are
provided "as is" without warranty of any kind, either express or implied, including without limitation warranties of
merchantability, fitness for a particular purpose, and non-infringement.
4. Under no circumstances shall Oracle or the Oracle Authorized Boot Camp Training Partner be liable for any loss,
damage, liability or expense incurred or suffered which is claimed to have resulted from use of this Site of Materials. As a
condition of use of the Materials, Partner agrees to indemnify Oracle from and against any and all actions, claims, losses,
damages, liabilities and expenses (including reasonable attorneys' fees) arising out of Partner’s use of the Materials.
5. Reference materials including but not limited to those identified in the Boot Camp manifest can not be redistributed in any
format without Oracle written consent.
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
<Insert Picture Here>
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java Scorecard 2011: Technology
Result
JDK 7
Java SE
JRockit released gratis under same license as JDK
Java EE GlassFish 3.1.1
Java EE 7 specification development underway
Java FX 2.0
Java FX
Java FX 2.0 for Mac OS X Developer Preview
Oracle Java Wireless Client 3.0
Java ME/ Oracle Java Embedded Client 1.0
Embedded Java SE for Embedded 7
Java ME SDK 3.0.5 and LWUIT 1.5
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java Scorecard 2011: Technology
Result
JDK 7 for Mac OS X
Java SE JDK 7
JRockit released gratis under same license as JDK
Java EE GlassFish 3.1.1
Java EE 7 specification development underway
Java FX 2.0
Java FX
Java FX 2.0 for Mac OS X Developer Preview
Oracle Java Wireless Client 3.0
Java ME/ Oracle Java Embedded Client 1.0
Embedded Java SE for Embedded 7
Java ME SDK 3.0.5 and LWUIT 1.5
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java Scorecard 2011: Oracle Leadership
Result
Successfully integrated Java development teams
Ongoing
Launched global JavaOne: Brazil, China, Russia, India
Investment
Reinvigorated flagship JavaOne 2011
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
JDK Roadmap
JDK 7u6
• OS X JRE port
NetBeans 7 (for end-users) NetBeans.next
• Java SE 7 JDK 7u2 • Improved OS • Java SE 8 support
support JDK 7 • JRE 7 on java.com Last public integration, • JavaFX 3.0 support
• more • JavaFX 2.0 co-install JDK 6 update auto-update • more
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
JAVA SE 7
Java SE 7 Release Contents
• Java Language
• Project Coin (JSR-334)
• Class Libraries
• NIO2 (JSR-203)
• Fork-Join framework, ParallelArray (JSR-166y)
• Java Virtual Machine
• The DaVinci Machine project (JSR-292)
• InvokeDynamic bytecode
• Miscellaneous things
• JSR-336: Java SE 7 Release Contents
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Discriminating Strings Today
int monthNameToDays(String s, int year) {
if("April".equals(s) || "June".equals(s) ||
"September".equals(s) ||"November".equals(s))
return 30;
if("January".equals(s) || "March".equals(s) ||
"May".equals(s) || "July".equals(s) ||
"August".equals(s) || "December".equals(s))
return 31;
if("February".equals(s))
...
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Strings in Switch Statements
int monthNameToDays(String s, int year) {
switch(s) {
case "April": case "June":
case "September": case "November":
return 30;
OR
OR
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
JDBC 4.1
• Try-with-resources statement to automatically close resources of
type Connection, ResultSet, and Statement
• try (Statement stmt = con.createStatement()) { // ... }
• RowSet 1.1 introduces RowSetFactory and RowSetProvider
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java 8
Java SE Vision – Beyond JDK 8
• Multi-language JVM
Interoperability • Improved Java/Native integration
• Multi-tenancy support
Cloud • Resource management
• Self-tuning JVM
Ease of Use • Language enhancements
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE
Java EE
Scalable and maintainable enterprise apps
Container vs. Developer
Life-cycle, resource injection, security, ...
Portable code
Portable skills
Vendor independence
Industry standard
large developer community,
books, training, best practices, consultants, ...
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Introduction to Java EE
What is Java EE?
Designed to help developers create large-scale, multi-tiered,
scalable, reliable, and secure network applications
Source: Oracle Introduction to J2EE
Client Tier
• Handles user requests and communicates with the
business tier
• e.g. Web browser, Java or other application
Web Tier
• Handles the interaction between clients and the
business tier
• EE technologies include Servlets, Java Server
Pages (JSPs), Expression Language (EL) and Java
Server Faces (JSF)
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Introduction to Java EE
The Tiers (continued)
Business Tier
• Consists of components that provide the business
logic
• Core functionality should exist in business tier
components
• EE technologies include Enterprise JavaBeans
(EJBs) and Web Services (JAX-WS)
Enterprise Information System (EIS) Tier
• Consists of database servers, enterprise resource
planning systems, and other legacy data sources
• EE technologies include Java Database Connectivity
API (JDBC), Java Persistence API (JPA), and Java
Transaction API (JTA)
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Introduction to Java EE
The Java EE Server
A Java EE Server such as WebLogic Server implements the Java EE platform APIs and
provides the standard Java EE services
The specification defines the server’s contract
using the term container
The Web Container
• Interface between web components and the
web server – runs in J2EE server
The EJB Container
• Manages the execution of an application's
enterprise beans – runs in J2EE server
The Application Client Container
• Interface between Java SE applications and
Java EE resources
• Runs on client machine
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Enterprise Java Beans
EJBs
• Hosted components that encapsulate business logic
• Session Beans
• Synchronous request/reply processing
• EJB 3.1 introduces an asynchronous option, but this is for exceptional
use cases
• Stateless – no state retained on server
• Stateful – state not persisted, but kept for life of client session
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Enterprise Java Beans
EJBs
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Servlets
• Web-Tier request/response protocol handler
• Commonly used to provide HTTP functionality
• The javax.servlet and javax.servlet.http packages
provide interfaces
• Interface defines common methods and objects used to
interact with the server
• doGet(HttpServletRequest req,
HttpServletResponse resp)
• Allows Java programmers to quickly develop web application
without worrying about underlying complexities
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java Server Pages
JSPs
• Simple and fast way to create dynamic web pages
• Consists of HTML with Java annotations
• Allows control of look and feel using corporate CCS or designs
• Processed on the server and the resulting page delivered to
the requestor
• Libraries of ‘tags’ are available, including Java Standard Tag
Library (JSTL)
• Expression Language (EL) used to access data objects in
JSPs
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Introduction to Java EE
Deployment
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Example WAR Package
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE 6
•Embrace Open
Source Frameworks
•Drag & drop
•Web Profile Flexible & framework installation
•Pruning Lightweight Extensible
Java EE
Developer
Productivity
•More annotations
•More POJOs
•Less XML
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE 6 Overview
New features
Web Profile, REST, managed beans,
standard dependency injection, validation
Enhanced APIs
EJB 3.1, JSF 2.0, JPA 2.0, Servlet 3.0
More ease of use
Optional XML, simpler packaging, extensibility
Usable “as is”
The end of the 100's MB .war
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE, a brief History
Right-sizing
Ease of Java EE 6
development EJB 3.1
Java EE 5 JPA 2.0
Web Services Servlet 3.0
J2EE 1.4 JSF 2.0
Robust
JAX-RS 1.1
Scalable
Enterprise CDI 1.0
Application J2EE 1.3 @Inject
J2EE 1.2 WebValidat°
Bean Profile
Annotations
Servlet EJB 3
JSP WS JPA 1.0 Managed
Project JPE EJB CMP Management WS-* Bean
JMS JCA Deployment JSF
RMI/IIOP
May 1998 Dec 1999 Sept 2001 Nov 2003 May 2006 Q4 2009
10 specs 13 specs 20 specs 23 specs 28 specs
For Oracle employees and authorized partners only. Do not distribute to third parties.
New and improved specifications
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
JAX-RS sample code
• @Path("widgets/{id}")
• @Produces("application/widgets+xml")
• public class WidgetResource {
• public WidgetResource(
@PathParam("id") String id) {
• ...
• }
• @GET
• Widget getWidget() {
• ...
• }
• }
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Bean Validation 1.0
public class Address {
@NotNull @Size(max=30,
message="longer than {max} characters")
private String street1;
...
@NotNull @Valid
private Country country;
}
public class Country {
@NotNull @Size(max=20) request recursive
private String name; object graph
... validation
}
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Build your own!
@Size(min=5, max=5)
@ConstraintValidator(ZipcodeValidator.class)
@Documented
@Target({ANNOTATION_TYPE, METHOD, FIELD})
@Retention(RUNTIME)
public @interface ZipCode {
String message() default "Wrong zipcode";
String[] groups() default {};
}
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE 6 Web Profile
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Extensible & Pluggable
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Modular Web Applications
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
JSF 2.0
Optional faces-config.xml
Standardized facelets
Auto-discovery of component libraries
Composite components
Ajax support (with or without JavaScript)
Even a JavaScript API !
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
EJB 3.1
@Singleton beans
@Startup beans
@Asynchronous invocations
@Schedule tasks
EJBContainer API works on Java SE
Define EJBs directly inside a web app
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Packaging in a war
foo.ear foo.war
lib/foo_common.jar WEB-INF/classes
com/acme/Foo.class
com/acme/Foo.class
com/acme/FooServlet.class
foo_web.war com/acme/FooEJB.class
WEB-INF/web.xml
WEB-INF/classes
com/acme/FooServlet.class
foo_ejb.jar
com/acme/FooEJB.class
com/acme/FooEJBLocal.class
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Dependency Injection
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Qualified injection
@ConversationScoped
public class CheckoutHandler {
@Inject
CheckoutHandler(@LoggedIn User user,
@Reliable @PayBy(CREDIT_CARD)
PaymentProcessor processor,
@Default Cart cart) {
...
}
}
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
A lot more to CDI
Events
Stereotypes
Consumer/Producer
Decorator
Alternatives
Portable extensions
etc...
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
Java EE 6
• Standard
• Lightweight
• Right-sized
• Widely available
• A foundation for PaaS
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
The preceding is intended to outline our general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any
features or functionality described for Oracle’s
products remains at the sole discretion of Oracle.
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential
For Oracle employees and authorized partners only. Do not distribute to third parties.
© 2012 Oracle Corporation – Proprietary and Confidential