SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
What's new in Java EE 7?
Expertenkreis Java
19.09.2013, GEDOPLAN
Dirk Weil, GEDOPLAN GmbH
JavaServer Faces 2.2
Big Ticket Features
Faces Flows
Resource Library Contracts
HTML 5 Friendly Markup
Stateless Views
Other Changes
UIData supports Collection
@ViewScoped
javax.faces.bean deprecated in next version
What's new in Java EE 7? 2
JSF 2.2: Faces Flows
Combination of various views
Internal navigation
Dedicated entry and return views
"Subroutine"
Embeddable
Flow scoped values
and beans
What's new in Java EE 7? 3
JSF 2.2: Faces Flows
Various flow definitions
Simple, directory-based
Flow descriptor
CDI Producer
Location
Web app root
Library JAR
META-INF/flows
What's new in Java EE 7? 4
JSF 2.2: Resource Library Contracts
Encapsulation of templates, images, CSS and JS files
Subdir of
WebappRoot/contracts
Library JAR META-INF/contracts
Activation in faces-config.xml or view attributes
5What's new in Java EE 7?
<resource-library-contracts>
<contract-mapping>
<url-pattern>*</url-pattern>
<contracts>siteLayout</contracts>
</contract-mapping>
</resource-library-contracts>
siteLayout/
topNav_template.xhtml
leftNav_foo.xhtml
styles.css
script.js
background.png
Java Persistence API 2.1
Converter
JPQL & Criteria Query Enhancements
CDI Injection in Entity Listener
DDL Handling
Entity Graphs
What's new in Java EE 7? 6
JPA 2.1: Converter
7What's new in Java EE 7?
@Converter
public class YesNoConverter implements AttributeConverter<Boolean, String> {
public String convertToDatabaseColumn(Boolean fieldValue) {
if (fieldValue == null) return null;
return fieldValue ? "Y" : "N";
}
public Boolean convertToEntityAttribute(String columnValue) {
if (columnValue == null) return null;
return columnValue.equals("Y");
@Entity
public class Country
{
@Convert(converter = YesNoConverter.class)
private boolean expired;
JPA 2.1: JPQL & Criteria Query Enhancements
ON: Join filter
TREAT: Downcast (includes filter)
FUNCTION: Call DB function
What's new in Java EE 7? 8
select p.name, count(b)
from Publisher p
left join p.books b
on b.bookType = BookType.PAPERBACK
group by p.name
select s from StorageLocation s
where treat(s.product as Book).bookType = BookType.HARDCOVER
select c from Customer c
where function('hasGoodCredit', c.balance, c.creditLimit)
JPA 2.1: JPQL & Criteria Query Enhancements
Bulk Update/Delete for Criteria Query
Stored Procedure Queries
What's new in Java EE 7? 9
CriteriaUpdate<Product> criteriaUpdate
= criteriaBuilder.createCriteriaUpdate(Product.class);
Root<Product> p = criteriaUpdate.from(Product.class);
Path<Number> price = p.get(Product_.price);
criteriaUpdate.set(price, criteriaBuilder.prod(price, 1.03));
entityManager.createQuery(criteriaUpdate).executeUpdate();
StoredProcedureQuery query
= entityManager.createStoredProcedureQuery("findMissingProducts");
JPA 2.1: CDI Injection in Entity Listener
10What's new in Java EE 7?
public class CountryListener {
@Inject
private AuditService auditService;
@PreUpdate
public void preUpdate(Object entity) {
this.auditService.logUpdate(entity);
}
@Entity
@EntityListeners(CountryListener.class)
public class Country {
JPA 2.1: DDL Handling
Create and/or drop db tables
Based on entity meta data (mapping)
SQL script
Data load script
What's new in Java EE 7? 11
<persistence … >
<persistence-unit name="test">
…
<properties>
<property name="javax.persistence.schema-generation.database.action"
value="drop-and-create" />
<property name="javax.persistence.schema-generation.create-script-source"
value="META-INF/create.sql" />
<property name="javax.persistence.schema-generation.create-source"
value="metadata-then-script" />
<property name="javax.persistence.sql-load-script-source"
value="META-INF/sqlLoad.sql" />
JPA 2.1: DDL Handling
Write create and/or drop scripts
12What's new in Java EE 7?
Writer createWriter = …; // File, String …
Map<String, Object> properties = new HashMap<>();
properties.put("javax.persistence.schema-generation.scripts.action",
"create");
properties.put("javax.persistence.schema-generation.scripts.create-target",
createWriter);
Persistence.generateSchema("test", properties);
JPA 2.1: Entity Graphs
Declaration of lazy attributes to be loaded by find or query
find parameter or query hint
fetchgraph: Fetch entity graph attributes only
loadgraph: Fetch eager attributes also
13What's new in Java EE 7?
@Entity
@NamedEntityGraph(name = "Publisher_books",
attributeNodes = @NamedAttributeNode(value = "books")))
public class Publisher
{
…
@OneToMany(mappedBy = "publisher", fetch = FetchType.LAZY)
private List<Book> books;
TypedQuery<Publisher> query = entityManager.createQuery(…);
query.setHint("javax.persistence.fetchgraph", "Publisher_books");
CDI 1.1
Enhanced bean discovery
Global enablement of interceptors, decorators, alternatives
Constructor interception
@TransactionScoped
@Transactional
Bean Validation for method parameters and return values
What's new in Java EE 7? 14
CDI 1.1: Bean Discovery
Discovery mode: all, annotated, none
Exclusion filter: Class or package
What's new in Java EE 7? 15
<beans … bean-discovery-mode="all" version="1.1">
<scan>
<exclude name="de.gedoplan.….sub1.beans.DiscoverableBean12"/>
<exclude name="de.gedoplan.….sub1.beans.excluded.**"/>
<exclude name="de.gedoplan.….dummy.**">
<if-system-property name="NO_DUMMY" value="true" />
</exclude>
</scan>
</beans>
CDI 1.1: Global Enablement of Interceptors etc.
@Priority
Global enablement and ordering of interceptors & decorators
Global activation of alternative with highest priority
What's new in Java EE 7? 16
@One
@Interceptor
@Priority(Interceptor.Priority.APPLICATION + 1)
public class OneInterceptor
{
CDI 1.1: Constructor Interception
17What's new in Java EE 7?
@Interceptor
public class TraceCallInterceptor
{
@AroundConstruct
public Object traceConstructorCall(InvocationContext ic)
throws Exception
{
…
}
@AroundInvoke
public Object traceMethodCall(InvocationContext ic)
throws Exception
{
…
}
CDI 1.1: @Transactional & @TransactionScoped
Platform global transaction interceptor @Transactional
TX modes like EJB TX attributes
CDI scope @TransactionScoped
What's new in Java EE 7? 18
@Transactional(value = TxType.REQUIRED,
dontRollbackOn={HarmlessException.class})
public void insert(Cocktail cocktail)
{
CDI 1.1: Bean Validation for Parameters and Return Values
19What's new in Java EE 7?
@NotNull
public List<Fragebogen> createUmfrage(@Min(10) int personenZahl)
{
More new things
Websockets
JAX-RS
JSON
Standardized Client
Concurrency Utilities
Batch
JMS
20What's new in Java EE 7?
Platforms
GlassFish 4
Reference implementation
Stable version: 4.0
Promoted build: 4.0.1 b03
WildFly 8
Formerly known as JBoss AS
Current version: 8.0.0.Alpha4
21What's new in Java EE 7?
Schön, dass Sie da waren!
Unserer nächster Termin:
21.11.2013: Testen im EE-Umfeld – Seien Sie feige!
dirk.weil@gedoplan.de

Contenu connexe

Tendances

How to create a skeleton of a Java console application
How to create a skeleton of a Java console applicationHow to create a skeleton of a Java console application
How to create a skeleton of a Java console application
Dmitri Pisarenko
 
Lifecycle Management of SOA Artifacts for WSO2 Products
Lifecycle Management of SOA Artifacts for WSO2 ProductsLifecycle Management of SOA Artifacts for WSO2 Products
Lifecycle Management of SOA Artifacts for WSO2 Products
WSO2
 

Tendances (12)

JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun GuptaJAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
JAX-RS 2.0: New and Noteworthy in RESTful Web Services API - Arun Gupta
 
We sport architecture_implementation
We sport architecture_implementationWe sport architecture_implementation
We sport architecture_implementation
 
netbeans
netbeansnetbeans
netbeans
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
 
MS SQL server audit
MS SQL server auditMS SQL server audit
MS SQL server audit
 
Data binding в массы!
Data binding в массы!Data binding в массы!
Data binding в массы!
 
Java &amp; banco de dados
Java &amp; banco de dadosJava &amp; banco de dados
Java &amp; banco de dados
 
How to create a skeleton of a Java console application
How to create a skeleton of a Java console applicationHow to create a skeleton of a Java console application
How to create a skeleton of a Java console application
 
Lifecycle Management of SOA Artifacts for WSO2 Products
Lifecycle Management of SOA Artifacts for WSO2 ProductsLifecycle Management of SOA Artifacts for WSO2 Products
Lifecycle Management of SOA Artifacts for WSO2 Products
 
Jsf Framework
Jsf FrameworkJsf Framework
Jsf Framework
 
Integration Of Springs Framework In Hibernates
Integration Of Springs Framework In HibernatesIntegration Of Springs Framework In Hibernates
Integration Of Springs Framework In Hibernates
 
iBATIS
iBATISiBATIS
iBATIS
 

Similaire à What's new in Java EE 7

Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qcon
Yiwei Ma
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
Michał Orman
 

Similaire à What's new in Java EE 7 (20)

Java Unit Testing with Unitils
Java Unit Testing with UnitilsJava Unit Testing with Unitils
Java Unit Testing with Unitils
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Spring design-juergen-qcon
Spring design-juergen-qconSpring design-juergen-qcon
Spring design-juergen-qcon
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
Devoxx UK 2013 Test-Driven Development with JavaEE 7, Arquillian and Embedded...
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7AAI-1713 Introduction to Java EE 7
AAI-1713 Introduction to Java EE 7
 
AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7AAI 1713-Introduction to Java EE 7
AAI 1713-Introduction to Java EE 7
 
OSGi and Eclipse RCP
OSGi and Eclipse RCPOSGi and Eclipse RCP
OSGi and Eclipse RCP
 
Apache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI ToolboxApache DeltaSpike: The CDI Toolbox
Apache DeltaSpike: The CDI Toolbox
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Quiery builder
Quiery builderQuiery builder
Quiery builder
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
 
Spring Boot Loves K8s
Spring Boot Loves K8sSpring Boot Loves K8s
Spring Boot Loves K8s
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

What's new in Java EE 7

  • 1. What's new in Java EE 7? Expertenkreis Java 19.09.2013, GEDOPLAN Dirk Weil, GEDOPLAN GmbH
  • 2. JavaServer Faces 2.2 Big Ticket Features Faces Flows Resource Library Contracts HTML 5 Friendly Markup Stateless Views Other Changes UIData supports Collection @ViewScoped javax.faces.bean deprecated in next version What's new in Java EE 7? 2
  • 3. JSF 2.2: Faces Flows Combination of various views Internal navigation Dedicated entry and return views "Subroutine" Embeddable Flow scoped values and beans What's new in Java EE 7? 3
  • 4. JSF 2.2: Faces Flows Various flow definitions Simple, directory-based Flow descriptor CDI Producer Location Web app root Library JAR META-INF/flows What's new in Java EE 7? 4
  • 5. JSF 2.2: Resource Library Contracts Encapsulation of templates, images, CSS and JS files Subdir of WebappRoot/contracts Library JAR META-INF/contracts Activation in faces-config.xml or view attributes 5What's new in Java EE 7? <resource-library-contracts> <contract-mapping> <url-pattern>*</url-pattern> <contracts>siteLayout</contracts> </contract-mapping> </resource-library-contracts> siteLayout/ topNav_template.xhtml leftNav_foo.xhtml styles.css script.js background.png
  • 6. Java Persistence API 2.1 Converter JPQL & Criteria Query Enhancements CDI Injection in Entity Listener DDL Handling Entity Graphs What's new in Java EE 7? 6
  • 7. JPA 2.1: Converter 7What's new in Java EE 7? @Converter public class YesNoConverter implements AttributeConverter<Boolean, String> { public String convertToDatabaseColumn(Boolean fieldValue) { if (fieldValue == null) return null; return fieldValue ? "Y" : "N"; } public Boolean convertToEntityAttribute(String columnValue) { if (columnValue == null) return null; return columnValue.equals("Y"); @Entity public class Country { @Convert(converter = YesNoConverter.class) private boolean expired;
  • 8. JPA 2.1: JPQL & Criteria Query Enhancements ON: Join filter TREAT: Downcast (includes filter) FUNCTION: Call DB function What's new in Java EE 7? 8 select p.name, count(b) from Publisher p left join p.books b on b.bookType = BookType.PAPERBACK group by p.name select s from StorageLocation s where treat(s.product as Book).bookType = BookType.HARDCOVER select c from Customer c where function('hasGoodCredit', c.balance, c.creditLimit)
  • 9. JPA 2.1: JPQL & Criteria Query Enhancements Bulk Update/Delete for Criteria Query Stored Procedure Queries What's new in Java EE 7? 9 CriteriaUpdate<Product> criteriaUpdate = criteriaBuilder.createCriteriaUpdate(Product.class); Root<Product> p = criteriaUpdate.from(Product.class); Path<Number> price = p.get(Product_.price); criteriaUpdate.set(price, criteriaBuilder.prod(price, 1.03)); entityManager.createQuery(criteriaUpdate).executeUpdate(); StoredProcedureQuery query = entityManager.createStoredProcedureQuery("findMissingProducts");
  • 10. JPA 2.1: CDI Injection in Entity Listener 10What's new in Java EE 7? public class CountryListener { @Inject private AuditService auditService; @PreUpdate public void preUpdate(Object entity) { this.auditService.logUpdate(entity); } @Entity @EntityListeners(CountryListener.class) public class Country {
  • 11. JPA 2.1: DDL Handling Create and/or drop db tables Based on entity meta data (mapping) SQL script Data load script What's new in Java EE 7? 11 <persistence … > <persistence-unit name="test"> … <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" /> <property name="javax.persistence.schema-generation.create-script-source" value="META-INF/create.sql" /> <property name="javax.persistence.schema-generation.create-source" value="metadata-then-script" /> <property name="javax.persistence.sql-load-script-source" value="META-INF/sqlLoad.sql" />
  • 12. JPA 2.1: DDL Handling Write create and/or drop scripts 12What's new in Java EE 7? Writer createWriter = …; // File, String … Map<String, Object> properties = new HashMap<>(); properties.put("javax.persistence.schema-generation.scripts.action", "create"); properties.put("javax.persistence.schema-generation.scripts.create-target", createWriter); Persistence.generateSchema("test", properties);
  • 13. JPA 2.1: Entity Graphs Declaration of lazy attributes to be loaded by find or query find parameter or query hint fetchgraph: Fetch entity graph attributes only loadgraph: Fetch eager attributes also 13What's new in Java EE 7? @Entity @NamedEntityGraph(name = "Publisher_books", attributeNodes = @NamedAttributeNode(value = "books"))) public class Publisher { … @OneToMany(mappedBy = "publisher", fetch = FetchType.LAZY) private List<Book> books; TypedQuery<Publisher> query = entityManager.createQuery(…); query.setHint("javax.persistence.fetchgraph", "Publisher_books");
  • 14. CDI 1.1 Enhanced bean discovery Global enablement of interceptors, decorators, alternatives Constructor interception @TransactionScoped @Transactional Bean Validation for method parameters and return values What's new in Java EE 7? 14
  • 15. CDI 1.1: Bean Discovery Discovery mode: all, annotated, none Exclusion filter: Class or package What's new in Java EE 7? 15 <beans … bean-discovery-mode="all" version="1.1"> <scan> <exclude name="de.gedoplan.….sub1.beans.DiscoverableBean12"/> <exclude name="de.gedoplan.….sub1.beans.excluded.**"/> <exclude name="de.gedoplan.….dummy.**"> <if-system-property name="NO_DUMMY" value="true" /> </exclude> </scan> </beans>
  • 16. CDI 1.1: Global Enablement of Interceptors etc. @Priority Global enablement and ordering of interceptors & decorators Global activation of alternative with highest priority What's new in Java EE 7? 16 @One @Interceptor @Priority(Interceptor.Priority.APPLICATION + 1) public class OneInterceptor {
  • 17. CDI 1.1: Constructor Interception 17What's new in Java EE 7? @Interceptor public class TraceCallInterceptor { @AroundConstruct public Object traceConstructorCall(InvocationContext ic) throws Exception { … } @AroundInvoke public Object traceMethodCall(InvocationContext ic) throws Exception { … }
  • 18. CDI 1.1: @Transactional & @TransactionScoped Platform global transaction interceptor @Transactional TX modes like EJB TX attributes CDI scope @TransactionScoped What's new in Java EE 7? 18 @Transactional(value = TxType.REQUIRED, dontRollbackOn={HarmlessException.class}) public void insert(Cocktail cocktail) {
  • 19. CDI 1.1: Bean Validation for Parameters and Return Values 19What's new in Java EE 7? @NotNull public List<Fragebogen> createUmfrage(@Min(10) int personenZahl) {
  • 20. More new things Websockets JAX-RS JSON Standardized Client Concurrency Utilities Batch JMS 20What's new in Java EE 7?
  • 21. Platforms GlassFish 4 Reference implementation Stable version: 4.0 Promoted build: 4.0.1 b03 WildFly 8 Formerly known as JBoss AS Current version: 8.0.0.Alpha4 21What's new in Java EE 7?
  • 22. Schön, dass Sie da waren! Unserer nächster Termin: 21.11.2013: Testen im EE-Umfeld – Seien Sie feige! dirk.weil@gedoplan.de