SlideShare a Scribd company logo
Rapid Development Tools for
Java EE 8
Mert Çalışkan, Gaurav Gupta
JavaOne 2017
Mert Çalışkan
Payara Developer
Java EE / Spring Consultant
Author of PrimeFaces Cookbook
Author of Beginning Spring book
Part-time Lecturer
@mertcal
Gaurav Gupta
Payara Developer
NetBeans Dream Team
Jeddict Creator ( jeddict.github.io )
@jGauravGupta , @ImJeddict
React to the talk
Join at
slido.com
#EE8
Agenda
- What’s new with Java EE 8? : Quick overview
- Java EE 8 application generation w/ Jeddict
- Java EE Tools : In depth
- Q&A
@jGauravGupta
What’s new with Java EE 8?
Java EE 8 is released on Sep 06, 2017.
● JAX-RS 2.1 (Jersey 2.26)
● CDI 2.0 (Weld 3.0.0.Final)
● Bean Validation 2.0 (Hibernate Validator 6.0.2.Final)
● JSON-B (Yasson 1.0)
● JPA 2.2 (EclipseLink 2.7.0)
● Java Security API 1.0 (Soteria 1.0)
Checkout https://github.com/javaee-samples/javaee8-samples for details on the
examples
@mertcal
● Reactive Client API
● JSON-B support
● Server Sent Events (SSE)
JAX-RS 2.1 (JSR 370)
@mertcal
● With JAX-RS 2.0, we had asynchronous invoker approach as:
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://localhost:8080/service-url");
Invocation.Builder builder = target.request();
Future<MyClass> futureResult = builder.async().get(MyClass.class);
System.out.println(futureResult.get());
client.close();
JAX-RS 2.1
@mertcal
● Previous scenario can also be implemented with InvocationCallback<T>
but…
Client client = ClientBuilder. newClient();
WebTarget target = client.target( "http://localhost:8080/service-url");
Invocation.Builder builder = target.request();
builder.async().get( new InvocationCallback<MyClass>() {
@Override
public void completed(MyClass t) {}
@Override
public void failed(Throwable throwable) {}
});
JAX-RS 2.1
@mertcal
● Reactive Client API to the rescue.
Client client = ClientBuilder.newClient();
WebTarget target = client.target("http://localhost:8080/service-url");
Invocation.Builder builder = target.request();
CompletionStage<Response> response = builder.rx().get();
response.thenAcceptAsync(res -> {
MyClass t = res.readEntity(MyClass.class);
System.out.println(t);
});
JerseyCompletionStageRxInvoker
CompletionStage<Response>
JAX-RS 2.1
@mertcal
● 3rd Party Reactive Framework Support
○ RxJava
Client client = ClientBuilder.newClient().register(RxFlowableInvokerProvider.class);
WebTarget target = client.target("http://localhost:8080/service-url");
Invocation.Builder builder = target.request();
Flowable<Response> flowable = builder.rx(RxFlowableInvoker.class).get();
flowable.subscribe(res -> {
MyClass t = res.readEntity(MyClass.class);
System.out.println(t);
});
reactive invoker specialized
for io.reactivex.Flowable
JAX-RS 2.1
@mertcal
Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url")
.request()
.get();
Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url")
.request()
.async()
.get();
Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url")
.request()
.rx()
.get();
JAX-RS 2.1
@mertcal
● Server Sent Events (SSE) is a mechanism that allows server to
asynchronously push data from the server to client once the client-server
connection is established by the client.
● It’s mostly like Long-Pooling but it’s not :) and it’s not WebSockets either.
● Implementations already provided it with JAX-RS 2.0 but there was no standard
API. With JAX-RS 2.1, API is created under javax.ws.rs.sse
JAX-RS 2.1
@mertcal
@Path("/temperature")
public class TemperatureResource {
private final OutboundSseEvent.Builder sseEventBuilder;
public TemperatureResource( @Context Sse sse) {
this.sseEventBuilder = sse.newEventBuilder();
}
@GET
@Path("/{city}")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void getCurrentTemperatureStream( @Context SseEventSink eventSink) {
while (true) {
eventSink.send( sseEventBuilder.data(temperature)
.mediaType(MediaType. APPLICATION_JSON_TYPE).build());
Thread. sleep(1000);
}
}
}
"text/event-stream"
1
2
3
4
JAX-RS 2.1
@mertcal
CDI 2.0 (JSR 365)
- SE Support - It’s possible to use CDI outside of Java EE
- Ordering of CDI events - @Priority helps ordering observers
void receive(@Observes @Priority(APPLICATION + 200) String greet) {
this.greet += greet + "2";
}
void receive2(@Observes @Priority(APPLICATION) String greet) {
this.greet = greet + "1";
}
For send(“Welcome”) output will be:
Welcome1Welcome2
@Inject
private Event<String> event;
public void send(String message) {
event.fire(message);
}
@mertcal
CompletableStage<MyEvent> eventSent = event.fireAsync( new MyEvent(),
NotificationOptions.ofExecutor(executor));
- Exception in async observer doesn’t break the observer invocation chain.
callMe(@Observes payload) callMe(@ObservesAsync payload)
event.fire(payload) Sync call Not Notified
event.fireAsync(payload) Not Notified Async call
- Long awaited Asynchronous Events Support
- Fire Sync → Observer Sync / Fire Async → Observer Async
CDI 2.0
@mertcal
● Java 8 Date and Time API Support
@Past(message = "must be a past date")
private java.time.Year yearOfBirth;
● Type Annotations
private List<@NotNull @Email String> emails;
private String @NotNull @Email[] emails;
private Map<@Valid Employee, @Valid Address> addressMap = new HashMap<>();
@mertcal
Bean Validation 2 (JSR 380)
● java.util.Optional Support
private Optional<@Past LocalDate> marriageAnniversary;
private Optional<@Size(max = 20) String> name;
● Repeating Annotations
@Max(value = 2000, groups = Default.class)
@Max(value = 5000, groups = GoldCustomer.class)
private long withdrawalAmount;
@mertcal
Bean Validation 2
Bean Validation 2
● Introduces new constraints
○ @Email
○ @NotBlank
○ @NotEmpty
○ @PastOrPresent
○ @FutureOrPresent
○ @Negative
○ @NegativeOrZero
○ @Positive
○ @PositiveOrZero
@mertcal
JSON-B (JSR 367)
● Standard solution like JAXB
● Default mapping between classes and JSON
● Customizable
a. Compile time
■ Property naming @JsonbProperty
■ Property ignoring @JsonbTransient
■ Null handling @JsonbNillable
■ Property ordering @JsonbPropertyOrder
■ Date and Number Format @JsonbDateFormat/@JsonbNumberFormat
■ Adapter @JsonbTypeAdapter
b. Runtime configration
■ Configuration builder JsonbConfig
@jGauravGupta
JSON-B - Customizations
class Employee {
private String name;
private String pin;
private String email;
}
{
"name": "Gaurav",
"pin": "J1-Secret",
"email": "gaurav.gupta@payara.fish",
}
@jGauravGupta
JSON-B - Customizations
@JsonbPropertyOrder({"email", "name"})
class Employee {
@JsonbProperty("empName")
private String name;
@JsonbTransient
private String pin;
private String email;
}
{
"email": "gaurav.gupta@payara.fish",
"empName": "Gaurav"
}
@jGauravGupta
JPA 2.2 (JSR 338)
● @Repeatable annotations
● Support Java 8 Date and Time API
● Ability to return stream of query result
● CDI Injection in AttributeConverters
@jGauravGupta
JPA 2.1
Container annotation required
@Entity
@NamedQueries({
@NamedQuery(name = "Employee.findAll",
query = "SELECT e FROM Employee e"),
@NamedQuery(name = "Employee.findByName",
query = "SELECT e FROM Employee e WHERE e.name = :name")
})
class Employee {
@Convert(converter=LocalDateConverter.class)
private LocalDate dateOfBirth;
} AttributeConverter
implementation @jGauravGupta
JPA 2.2
Container annotation not required
@Entity
@NamedQueries({
@NamedQuery(name = "Employee.findAll",
query = "SELECT e FROM Employee e"),
@NamedQuery(name = "Employee.findByName",
query = "SELECT e FROM Employee e WHERE e.name = :name")
})
class Employee {
@Convert(converter=LocalDateConverter.class)
private LocalDate dateOfBirth;
}
AttributeConverter not required @jGauravGupta
JPA 2.2
@Entity
@NamedQuery(name = "Employee.findAll",
query = "SELECT e FROM Employee e")
@NamedQuery(name = "Employee.findByName",
query = "SELECT e FROM Employee e WHERE e.name = :name")
class Employee {
private LocalDate dateOfBirth;
}
@jGauravGupta
JPA 2.2
● Stream query results
Stream<Employee> employees =
em.createQuery(“SELECT e FROM Employee”, Employee.class)
.getResultStream();
@jGauravGupta
Security API 1.0 (JSR 375)
● Simplify the existing solution
● Enhance the portability
● New APIs
○ HTTPAuthenticationMechanism
○ IdentityStore
○ SecurityContext
@jGauravGupta
Security API 1.0 (JSR 375)
● Authentication Mechanism
○ validateRequest(request, response, httpMessageContext)
○ secureResponse(request, response, httpMessageContext)
○ cleanSubject(request, response, httpMessageContext)
● Identity Store
○ validate(credential)
○ getCallerGroups(credentialValidationResult)
● Security Context
○ getCallerPrincipal()
○ isCallerInRole(role)
○ … … …
@jGauravGupta
@ApplicationScoped
public class MyAuthMechanism implements HttpAuthenticationMechanism {
@Override
public AuthenticationStatus validateRequest(HttpServletRequest request,
HttpServletResponse response, HttpMessageContext context) {
}
}
Security API 1.0
@jGauravGupta
@ApplicationScoped
public class MyAuthMechanism implements HttpAuthenticationMechanism {
@Inject
private IdentityStoreHandler identityStoreHandler;
@Override
public AuthenticationStatus validateRequest(HttpServletRequest request,
HttpServletResponse response, HttpMessageContext context) {
………
identityStoreHandler.validate(credential);
………
}
}
Security API 1.0
@jGauravGupta
@ApplicationScoped
public class MyAuthMechanism implements HttpAuthenticationMechanism {
@Inject
private IdentityStoreHandler identityStoreHandler;
@Override
public AuthenticationStatus validateRequest (HttpServletRequest request,
HttpServletResponse response, HttpMessageContext context) {
………
identityStoreHandler.validate(credential);
………
}
}
Security API 1.0
@jGauravGupta
Java EE 8 App generation w/
jeddict.github.io
@Email
@JsonbProperty
("fName")
@JsonbTransient
java.time.LocalDate
@NamedQuery(name = "findAll")
@NamedQuery(name = "findByFirstName")
@NamedQuery(name = "findByEmail")
@JsonbProperty
("number")
@NotEmpty
@JsonbProperty
("lName")
OpenERP Domain model
@jGauravGupta
Building Angular app
Java EE Tools : In depth
● Jeddict modeler
● Dynamic Code Evaluation
● Payara Fish in NetBeans IDE
● Payara CDI Dev Mode
● Payara AsAdmin Recorder
● Maven Plugin
@jGauravGupta
● Supports any relational database (JDBC compliant)
● Relationship mapping
○ JoinColumn to JoinTable converter and vice versa
○ java.util.Collection, java.util.Map
● Embeddable
● Inheritance
● Query Builder / Executor / Generator (JPQL, SQL, Stored Procedure, Entity Graph)
● JAXB / JSON-B
● Bean Validation
● more… Fluent API, java.util.Optional, Reverse Engineering etc.
Jeddict modeler
@jGauravGupta
JPA 2.2 modeler - Relationship
Self reference
Many-to-One
One-to-One
Many-to-Many
@jGauravGupta
JPA 2.2 modeler - Embedded
Nested Embeddable
Embedded Collection Multiple Embedded fields @jGauravGupta
JPA 2.2 modeler - Entity Inheritance
Nested Inheritance
@jGauravGupta
● Supports any relational database (JDBC compliant)
● Relationship mapping
○ JoinColumn to JoinTable converter and vice versa
○ java.util.Collection, java.util.Map
● Embeddable
● Inheritance
● Query Builder / Executor / Generator (JPQL, SQL, Stored Procedure, Entity Graph)
● Bean Validation
● JAXB / JSON-B
● more… Fluent API, java.util.Optional, Reverse Engineering etc.
Jeddict modeler
@jGauravGupta
● JRE Patch
● Update the code instantly
● DCEVM Dynamic Code Evolution VM http://dcevm.github.io/
STEP-1 : Java installation with the DCEVM engine
STEP-2 : Connect with the Payara Server
STEP-3 : Turn off redeployment of the application on save
STEP-4 : Turn on compile and apply code changes on save
Dynamic Code Evolution
@jGauravGupta
● Bean Archives
● Beans and their properties
○ such as qualifiers, stereotypes and name
● Invocation Trees
● Observers and producers declared by beans
● Interceptors and decorators
● Extensions
● Fired events
Payara CDI Dev Mode : to inspect
@jGauravGupta
● Graph of bean dependency
Payara CDI Dev Mode : to inspect
@jGauravGupta
● Graph of bean archives
Payara CDI Dev Mode : to inspect
@jGauravGupta
● Trace the admin console actions
● Create automation scripts easily
● Helps to investigate
Payara AsAdmin Recorder
@jGauravGupta
● payara-micro-maven-plugin incorporates payara-micro with produced
artifact.
● Offers 3 mojos
○ bundle
○ start
○ stop
● Plugin is available on Maven Central
<groupId>fish.payara.maven.plugins</groupId>
<artifactId>payara-micro-maven-plugin</artifactId>
<version>1.0.0</version>
Maven Plugin
@mertcal
<configuration>
<customJars>
<artifactItem>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.0</version>
</artifactItem>
</customJars>
</configuration>
<configuration>
<startClass>
my.custom.start.class.Main
</startClass>
<deployArtifacts>
<artifactItem>
<groupId>org.mycompany</groupId>
<artifactId>my-project</artifactId>
<version>1.0</version>
<type>ear</type>
</artifactItem>
</deployArtifacts>
<configuration>
Maven Plugin - bundle mojo config
into MICRO-INF/deploy folder
into MICRO-INF/lib folder
@mertcal
<configuration>
<useUberJar>true</useUberJar>
<daemon>true</daemon>
<javaPath>/path/to/Java/Home</javaPath>
<payaraMicroAbsolutePath>/path/to/payara-micro.jar</payaraMicroAbsolutePath>
<artifactItem>
<groupId>fish.payara.extras</groupId>
<artifactId>payara-micro</artifactId>
<version>4.1.1.171</version>
</artifactItem>
<commandLineOptions>
<option>
<key>--autoBindHttp</key>
<value>true</value>
</option>
</commandLineOptions>
</configuration>
Maven Plugin - start mojo config
@mertcal
Thank you!
Any
Questions?
%50 on ebook - JE8MEK50
%15 on printed - JE8MPK15
valid until October 11

More Related Content

What's hot

Jasig Cas High Availability - Yale University
Jasig Cas High Availability -  Yale UniversityJasig Cas High Availability -  Yale University
Jasig Cas High Availability - Yale University
Jasig CAS
 
Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin components
Peter Lehto
 
Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.
Michele Giacobazzi
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2
Haroon Idrees
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Michaël Figuière
 
Apache Struts 2 Advance
Apache Struts 2 AdvanceApache Struts 2 Advance
Apache Struts 2 Advance
Emprovise
 
Drools rule Concepts
Drools rule ConceptsDrools rule Concepts
Drools rule Concepts
RaviShankar Mishra
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with Hazelcast
Hazelcast
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
Carol McDonald
 
An intro to cqrs
An intro to cqrsAn intro to cqrs
An intro to cqrs
Neil Robbins
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tips
osa_ora
 
J2EE jsp_03
J2EE jsp_03J2EE jsp_03
J2EE jsp_03
Biswabrata Banerjee
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
Emprovise
 
Android development
Android developmentAndroid development
Android development
Gregoire BARRET
 
Struts2
Struts2Struts2
Jpa 2.1 Application Development
Jpa 2.1 Application DevelopmentJpa 2.1 Application Development
Jpa 2.1 Application Development
ThirupathiReddy Vajjala
 
React lecture
React lectureReact lecture
React lecture
Christoffer Noring
 
Struts 2
Struts 2Struts 2
Struts 2
Lalit Garg
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
scottw
 

What's hot (19)

Jasig Cas High Availability - Yale University
Jasig Cas High Availability -  Yale UniversityJasig Cas High Availability -  Yale University
Jasig Cas High Availability - Yale University
 
Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin components
 
Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.Repetition is bad, repetition is bad.
Repetition is bad, repetition is bad.
 
Spring framework part 2
Spring framework part 2Spring framework part 2
Spring framework part 2
 
Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!Cassandra summit 2013 - DataStax Java Driver Unleashed!
Cassandra summit 2013 - DataStax Java Driver Unleashed!
 
Apache Struts 2 Advance
Apache Struts 2 AdvanceApache Struts 2 Advance
Apache Struts 2 Advance
 
Drools rule Concepts
Drools rule ConceptsDrools rule Concepts
Drools rule Concepts
 
Clustering your Application with Hazelcast
Clustering your Application with HazelcastClustering your Application with Hazelcast
Clustering your Application with Hazelcast
 
JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 
An intro to cqrs
An intro to cqrsAn intro to cqrs
An intro to cqrs
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tips
 
J2EE jsp_03
J2EE jsp_03J2EE jsp_03
J2EE jsp_03
 
Apache Struts 2 Framework
Apache Struts 2 FrameworkApache Struts 2 Framework
Apache Struts 2 Framework
 
Android development
Android developmentAndroid development
Android development
 
Struts2
Struts2Struts2
Struts2
 
Jpa 2.1 Application Development
Jpa 2.1 Application DevelopmentJpa 2.1 Application Development
Jpa 2.1 Application Development
 
React lecture
React lectureReact lecture
React lecture
 
Struts 2
Struts 2Struts 2
Struts 2
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
 

Similar to Rapid development tools for java ee 8 [tut2998]

Struts2 notes
Struts2 notesStruts2 notes
Struts2 notes
Rajiv Gupta
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Red Hat Developers
 
50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes
Antonio Goncalves
 
Fifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty MinutesFifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty Minutes
Arun Gupta
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
glassfish
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
javatwo2011
 
Annotation processing and code gen
Annotation processing and code genAnnotation processing and code gen
Annotation processing and code gen
koji lin
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
Jini Lee
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
Sunghyouk Bae
 
Core2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdfCore2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdf
ThchTrngGia
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
Pinaki Poddar
 
Java Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner WalkthroughJava Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner Walkthrough
Mahfuz Islam Bhuiyan
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?
gedoplan
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
Carol McDonald
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
Matt Raible
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
petabridge
 
Vaadin with Java EE 7
Vaadin with Java EE 7Vaadin with Java EE 7
Vaadin with Java EE 7
Peter Lehto
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
Ted Pennings
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
React native
React nativeReact native
React native
Vishal Dubey
 

Similar to Rapid development tools for java ee 8 [tut2998] (20)

Struts2 notes
Struts2 notesStruts2 notes
Struts2 notes
 
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
 
50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes
 
Fifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty MinutesFifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty Minutes
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Annotation processing and code gen
Annotation processing and code genAnnotation processing and code gen
Annotation processing and code gen
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
Core2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdfCore2 Document - Java SCORE Overview.pptx.pdf
Core2 Document - Java SCORE Overview.pptx.pdf
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
 
Java Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner WalkthroughJava Annotation Processing: A Beginner Walkthrough
Java Annotation Processing: A Beginner Walkthrough
 
JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?JUG Berlin Brandenburg: What's new in Java EE 7?
JUG Berlin Brandenburg: What's new in Java EE 7?
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
NET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptxNET Systems Programming Learned the Hard Way.pptx
NET Systems Programming Learned the Hard Way.pptx
 
Vaadin with Java EE 7
Vaadin with Java EE 7Vaadin with Java EE 7
Vaadin with Java EE 7
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
React native
React nativeReact native
React native
 

More from Payara

Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​
Payara
 
Payara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptxPayara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptx
Payara
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
Payara
 
GlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptxGlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptx
Payara
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
Payara
 
Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2
Payara
 
Reactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learnReactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learn
Payara
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
Payara
 
A step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice designA step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice design
Payara
 
Transactions in Microservices
Transactions in MicroservicesTransactions in Microservices
Transactions in Microservices
Payara
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5
Payara
 
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
Payara
 
Previewing Payara Platform 5.192
Previewing Payara Platform 5.192Previewing Payara Platform 5.192
Previewing Payara Platform 5.192
Payara
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
Payara
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfile
Payara
 
Monitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsMonitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile Metrics
Payara
 
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stackJava2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Payara
 
Java2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_appsJava2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_apps
Payara
 
Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS] Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS]
Payara
 
Ondrej mihalyi be reactive and micro with a micro profile stack
Ondrej mihalyi   be reactive and micro with a micro profile stackOndrej mihalyi   be reactive and micro with a micro profile stack
Ondrej mihalyi be reactive and micro with a micro profile stack
Payara
 

More from Payara (20)

Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​
 
Payara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptxPayara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptx
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
 
GlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptxGlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptx
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
 
Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2
 
Reactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learnReactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learn
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
 
A step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice designA step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice design
 
Transactions in Microservices
Transactions in MicroservicesTransactions in Microservices
Transactions in Microservices
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5
 
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
 
Previewing Payara Platform 5.192
Previewing Payara Platform 5.192Previewing Payara Platform 5.192
Previewing Payara Platform 5.192
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfile
 
Monitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsMonitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile Metrics
 
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stackJava2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
 
Java2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_appsJava2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_apps
 
Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS] Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS]
 
Ondrej mihalyi be reactive and micro with a micro profile stack
Ondrej mihalyi   be reactive and micro with a micro profile stackOndrej mihalyi   be reactive and micro with a micro profile stack
Ondrej mihalyi be reactive and micro with a micro profile stack
 

Recently uploaded

Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
ScyllaDB
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
Enterprise Knowledge
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Ukraine
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
ScyllaDB
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
Fwdays
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 

Recently uploaded (20)

Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's TipsGetting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
Getting the Most Out of ScyllaDB Monitoring: ShareChat's Tips
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Demystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through StorytellingDemystifying Knowledge Management through Storytelling
Demystifying Knowledge Management through Storytelling
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
GlobalLogic Java Community Webinar #18 “How to Improve Web Application Perfor...
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 
Discover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched ContentDiscover the Unseen: Tailored Recommendation of Unwatched Content
Discover the Unseen: Tailored Recommendation of Unwatched Content
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
"What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w..."What does it really mean for your system to be available, or how to define w...
"What does it really mean for your system to be available, or how to define w...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 

Rapid development tools for java ee 8 [tut2998]

  • 1. Rapid Development Tools for Java EE 8 Mert Çalışkan, Gaurav Gupta JavaOne 2017
  • 2. Mert Çalışkan Payara Developer Java EE / Spring Consultant Author of PrimeFaces Cookbook Author of Beginning Spring book Part-time Lecturer @mertcal Gaurav Gupta Payara Developer NetBeans Dream Team Jeddict Creator ( jeddict.github.io ) @jGauravGupta , @ImJeddict
  • 3. React to the talk Join at slido.com #EE8
  • 4. Agenda - What’s new with Java EE 8? : Quick overview - Java EE 8 application generation w/ Jeddict - Java EE Tools : In depth - Q&A @jGauravGupta
  • 5. What’s new with Java EE 8? Java EE 8 is released on Sep 06, 2017. ● JAX-RS 2.1 (Jersey 2.26) ● CDI 2.0 (Weld 3.0.0.Final) ● Bean Validation 2.0 (Hibernate Validator 6.0.2.Final) ● JSON-B (Yasson 1.0) ● JPA 2.2 (EclipseLink 2.7.0) ● Java Security API 1.0 (Soteria 1.0) Checkout https://github.com/javaee-samples/javaee8-samples for details on the examples @mertcal
  • 6. ● Reactive Client API ● JSON-B support ● Server Sent Events (SSE) JAX-RS 2.1 (JSR 370) @mertcal
  • 7. ● With JAX-RS 2.0, we had asynchronous invoker approach as: Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://localhost:8080/service-url"); Invocation.Builder builder = target.request(); Future<MyClass> futureResult = builder.async().get(MyClass.class); System.out.println(futureResult.get()); client.close(); JAX-RS 2.1 @mertcal
  • 8. ● Previous scenario can also be implemented with InvocationCallback<T> but… Client client = ClientBuilder. newClient(); WebTarget target = client.target( "http://localhost:8080/service-url"); Invocation.Builder builder = target.request(); builder.async().get( new InvocationCallback<MyClass>() { @Override public void completed(MyClass t) {} @Override public void failed(Throwable throwable) {} }); JAX-RS 2.1 @mertcal
  • 9. ● Reactive Client API to the rescue. Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://localhost:8080/service-url"); Invocation.Builder builder = target.request(); CompletionStage<Response> response = builder.rx().get(); response.thenAcceptAsync(res -> { MyClass t = res.readEntity(MyClass.class); System.out.println(t); }); JerseyCompletionStageRxInvoker CompletionStage<Response> JAX-RS 2.1 @mertcal
  • 10. ● 3rd Party Reactive Framework Support ○ RxJava Client client = ClientBuilder.newClient().register(RxFlowableInvokerProvider.class); WebTarget target = client.target("http://localhost:8080/service-url"); Invocation.Builder builder = target.request(); Flowable<Response> flowable = builder.rx(RxFlowableInvoker.class).get(); flowable.subscribe(res -> { MyClass t = res.readEntity(MyClass.class); System.out.println(t); }); reactive invoker specialized for io.reactivex.Flowable JAX-RS 2.1 @mertcal
  • 11. Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url") .request() .get(); Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url") .request() .async() .get(); Client client = ClientBuilder.newClient().target("http://localhost:8080/service-url") .request() .rx() .get(); JAX-RS 2.1 @mertcal
  • 12. ● Server Sent Events (SSE) is a mechanism that allows server to asynchronously push data from the server to client once the client-server connection is established by the client. ● It’s mostly like Long-Pooling but it’s not :) and it’s not WebSockets either. ● Implementations already provided it with JAX-RS 2.0 but there was no standard API. With JAX-RS 2.1, API is created under javax.ws.rs.sse JAX-RS 2.1 @mertcal
  • 13. @Path("/temperature") public class TemperatureResource { private final OutboundSseEvent.Builder sseEventBuilder; public TemperatureResource( @Context Sse sse) { this.sseEventBuilder = sse.newEventBuilder(); } @GET @Path("/{city}") @Produces(MediaType.SERVER_SENT_EVENTS) public void getCurrentTemperatureStream( @Context SseEventSink eventSink) { while (true) { eventSink.send( sseEventBuilder.data(temperature) .mediaType(MediaType. APPLICATION_JSON_TYPE).build()); Thread. sleep(1000); } } } "text/event-stream" 1 2 3 4 JAX-RS 2.1 @mertcal
  • 14. CDI 2.0 (JSR 365) - SE Support - It’s possible to use CDI outside of Java EE - Ordering of CDI events - @Priority helps ordering observers void receive(@Observes @Priority(APPLICATION + 200) String greet) { this.greet += greet + "2"; } void receive2(@Observes @Priority(APPLICATION) String greet) { this.greet = greet + "1"; } For send(“Welcome”) output will be: Welcome1Welcome2 @Inject private Event<String> event; public void send(String message) { event.fire(message); } @mertcal
  • 15. CompletableStage<MyEvent> eventSent = event.fireAsync( new MyEvent(), NotificationOptions.ofExecutor(executor)); - Exception in async observer doesn’t break the observer invocation chain. callMe(@Observes payload) callMe(@ObservesAsync payload) event.fire(payload) Sync call Not Notified event.fireAsync(payload) Not Notified Async call - Long awaited Asynchronous Events Support - Fire Sync → Observer Sync / Fire Async → Observer Async CDI 2.0 @mertcal
  • 16. ● Java 8 Date and Time API Support @Past(message = "must be a past date") private java.time.Year yearOfBirth; ● Type Annotations private List<@NotNull @Email String> emails; private String @NotNull @Email[] emails; private Map<@Valid Employee, @Valid Address> addressMap = new HashMap<>(); @mertcal Bean Validation 2 (JSR 380)
  • 17. ● java.util.Optional Support private Optional<@Past LocalDate> marriageAnniversary; private Optional<@Size(max = 20) String> name; ● Repeating Annotations @Max(value = 2000, groups = Default.class) @Max(value = 5000, groups = GoldCustomer.class) private long withdrawalAmount; @mertcal Bean Validation 2
  • 18. Bean Validation 2 ● Introduces new constraints ○ @Email ○ @NotBlank ○ @NotEmpty ○ @PastOrPresent ○ @FutureOrPresent ○ @Negative ○ @NegativeOrZero ○ @Positive ○ @PositiveOrZero @mertcal
  • 19. JSON-B (JSR 367) ● Standard solution like JAXB ● Default mapping between classes and JSON ● Customizable a. Compile time ■ Property naming @JsonbProperty ■ Property ignoring @JsonbTransient ■ Null handling @JsonbNillable ■ Property ordering @JsonbPropertyOrder ■ Date and Number Format @JsonbDateFormat/@JsonbNumberFormat ■ Adapter @JsonbTypeAdapter b. Runtime configration ■ Configuration builder JsonbConfig @jGauravGupta
  • 20. JSON-B - Customizations class Employee { private String name; private String pin; private String email; } { "name": "Gaurav", "pin": "J1-Secret", "email": "gaurav.gupta@payara.fish", } @jGauravGupta
  • 21. JSON-B - Customizations @JsonbPropertyOrder({"email", "name"}) class Employee { @JsonbProperty("empName") private String name; @JsonbTransient private String pin; private String email; } { "email": "gaurav.gupta@payara.fish", "empName": "Gaurav" } @jGauravGupta
  • 22. JPA 2.2 (JSR 338) ● @Repeatable annotations ● Support Java 8 Date and Time API ● Ability to return stream of query result ● CDI Injection in AttributeConverters @jGauravGupta
  • 23. JPA 2.1 Container annotation required @Entity @NamedQueries({ @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e"), @NamedQuery(name = "Employee.findByName", query = "SELECT e FROM Employee e WHERE e.name = :name") }) class Employee { @Convert(converter=LocalDateConverter.class) private LocalDate dateOfBirth; } AttributeConverter implementation @jGauravGupta
  • 24. JPA 2.2 Container annotation not required @Entity @NamedQueries({ @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e"), @NamedQuery(name = "Employee.findByName", query = "SELECT e FROM Employee e WHERE e.name = :name") }) class Employee { @Convert(converter=LocalDateConverter.class) private LocalDate dateOfBirth; } AttributeConverter not required @jGauravGupta
  • 25. JPA 2.2 @Entity @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e") @NamedQuery(name = "Employee.findByName", query = "SELECT e FROM Employee e WHERE e.name = :name") class Employee { private LocalDate dateOfBirth; } @jGauravGupta
  • 26. JPA 2.2 ● Stream query results Stream<Employee> employees = em.createQuery(“SELECT e FROM Employee”, Employee.class) .getResultStream(); @jGauravGupta
  • 27. Security API 1.0 (JSR 375) ● Simplify the existing solution ● Enhance the portability ● New APIs ○ HTTPAuthenticationMechanism ○ IdentityStore ○ SecurityContext @jGauravGupta
  • 28. Security API 1.0 (JSR 375) ● Authentication Mechanism ○ validateRequest(request, response, httpMessageContext) ○ secureResponse(request, response, httpMessageContext) ○ cleanSubject(request, response, httpMessageContext) ● Identity Store ○ validate(credential) ○ getCallerGroups(credentialValidationResult) ● Security Context ○ getCallerPrincipal() ○ isCallerInRole(role) ○ … … … @jGauravGupta
  • 29. @ApplicationScoped public class MyAuthMechanism implements HttpAuthenticationMechanism { @Override public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext context) { } } Security API 1.0 @jGauravGupta
  • 30. @ApplicationScoped public class MyAuthMechanism implements HttpAuthenticationMechanism { @Inject private IdentityStoreHandler identityStoreHandler; @Override public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response, HttpMessageContext context) { ……… identityStoreHandler.validate(credential); ……… } } Security API 1.0 @jGauravGupta
  • 31. @ApplicationScoped public class MyAuthMechanism implements HttpAuthenticationMechanism { @Inject private IdentityStoreHandler identityStoreHandler; @Override public AuthenticationStatus validateRequest (HttpServletRequest request, HttpServletResponse response, HttpMessageContext context) { ……… identityStoreHandler.validate(credential); ……… } } Security API 1.0 @jGauravGupta
  • 32. Java EE 8 App generation w/ jeddict.github.io @Email @JsonbProperty ("fName") @JsonbTransient java.time.LocalDate @NamedQuery(name = "findAll") @NamedQuery(name = "findByFirstName") @NamedQuery(name = "findByEmail") @JsonbProperty ("number") @NotEmpty @JsonbProperty ("lName") OpenERP Domain model
  • 34. Java EE Tools : In depth ● Jeddict modeler ● Dynamic Code Evaluation ● Payara Fish in NetBeans IDE ● Payara CDI Dev Mode ● Payara AsAdmin Recorder ● Maven Plugin @jGauravGupta
  • 35. ● Supports any relational database (JDBC compliant) ● Relationship mapping ○ JoinColumn to JoinTable converter and vice versa ○ java.util.Collection, java.util.Map ● Embeddable ● Inheritance ● Query Builder / Executor / Generator (JPQL, SQL, Stored Procedure, Entity Graph) ● JAXB / JSON-B ● Bean Validation ● more… Fluent API, java.util.Optional, Reverse Engineering etc. Jeddict modeler @jGauravGupta
  • 36. JPA 2.2 modeler - Relationship Self reference Many-to-One One-to-One Many-to-Many @jGauravGupta
  • 37. JPA 2.2 modeler - Embedded Nested Embeddable Embedded Collection Multiple Embedded fields @jGauravGupta
  • 38. JPA 2.2 modeler - Entity Inheritance Nested Inheritance @jGauravGupta
  • 39. ● Supports any relational database (JDBC compliant) ● Relationship mapping ○ JoinColumn to JoinTable converter and vice versa ○ java.util.Collection, java.util.Map ● Embeddable ● Inheritance ● Query Builder / Executor / Generator (JPQL, SQL, Stored Procedure, Entity Graph) ● Bean Validation ● JAXB / JSON-B ● more… Fluent API, java.util.Optional, Reverse Engineering etc. Jeddict modeler @jGauravGupta
  • 40. ● JRE Patch ● Update the code instantly ● DCEVM Dynamic Code Evolution VM http://dcevm.github.io/ STEP-1 : Java installation with the DCEVM engine STEP-2 : Connect with the Payara Server STEP-3 : Turn off redeployment of the application on save STEP-4 : Turn on compile and apply code changes on save Dynamic Code Evolution @jGauravGupta
  • 41. ● Bean Archives ● Beans and their properties ○ such as qualifiers, stereotypes and name ● Invocation Trees ● Observers and producers declared by beans ● Interceptors and decorators ● Extensions ● Fired events Payara CDI Dev Mode : to inspect @jGauravGupta
  • 42. ● Graph of bean dependency Payara CDI Dev Mode : to inspect @jGauravGupta
  • 43. ● Graph of bean archives Payara CDI Dev Mode : to inspect @jGauravGupta
  • 44. ● Trace the admin console actions ● Create automation scripts easily ● Helps to investigate Payara AsAdmin Recorder @jGauravGupta
  • 45. ● payara-micro-maven-plugin incorporates payara-micro with produced artifact. ● Offers 3 mojos ○ bundle ○ start ○ stop ● Plugin is available on Maven Central <groupId>fish.payara.maven.plugins</groupId> <artifactId>payara-micro-maven-plugin</artifactId> <version>1.0.0</version> Maven Plugin @mertcal
  • 48. Thank you! Any Questions? %50 on ebook - JE8MEK50 %15 on printed - JE8MPK15 valid until October 11