SlideShare ist ein Scribd-Unternehmen logo
1 von 102
Downloaden Sie, um offline zu lesen
1 
50 new features 
of 
Java EE 7 
in 
50 minutes 
Arun Gupta, @arungupta 
Director, Developer Advocacy 
Sep 9, 2014
2 
#NN: <spec>: <feature>
3 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5
4 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
CDI 1.1 (JSR 346)
5 
#01: CDI: Default enabling 
Finer scanning control 
Possible values: all, annotated, none! 
all behaves like in Java EE 6 (default if not set)! 
! 
<beans ... version="1.1" bean-discovery-mode="all">! 
<alternatives>! 
<class>org.agoncal.book.MockGenerator</class>! 
</alternatives>! 
</beans>!
6 
#02: CDI: @Vetoed 
Veto the processing of the class or package 
@Vetoed! 
public class NonProcessedBean { 
...! 
}! 
! 
package-info.java 
@Vetoed! 
package com.non.processed.package;!
7 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Bean Validation 1.1 (JSR 349)
8 
#03: Bean Validation: Method validation 
Pre/post conditions on method and constructors 
public class CardValidator {! 
! 
public CardValidator(@NotNull Algorithm algorithm) {! 
this.algorithm = algorithm;! 
}! 
! 
@AssertTrue! 
public Boolean validate(@NotNull CreditCard creditCard) {! 
return algorithm.validate(creditCard.getNumber());! 
}! 
}!
9 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Interceptors 1.2 (JSR 318)
10 
#04: Interceptors: AroundConstruct 
Interceptor associated with a constructor 
!public class LoggingInterceptor {! 
@AroundConstruct! p r i vlaotgeg evro.ifdi inne(i"t(EInntveorciantgi ocnoCnosnttreuxctt oirc")) ;{!! ilco.ggperor.cefeidn(e()";!Exiting constructor");! ! }! @pAurboluincd IOnbvjoekcet! logMethod(InvocationContext ic) ... {}! // ...! }!
11 
#05: Interceptors: @Priority 
Prioritizing interceptor bindings 
PLATFORM_BEFORE (0), LIBRARY_BEFORE (1000), 
APPLICATION (2000), LIBRARY_AFTER (3000), 
PLATFORM_AFTER (4000)! 
@Interceptor! 
@Loggable! 
@Priority(Interceptor.Priority.LIBRARY_BEFORE+10)! 
public class LoggingInterceptor {! 
! 
@AroundInvoke! 
...! 
}!
12 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Concurrency utilities 1.0 (JSR 236)
13 
#06: Concurrency: ManagedExecutor 
User threads in Java EE applications 
Support simple and advance concurrency design patterns 
Extend Concurrency Utilities API from Java SE (JSR 
166y) 
java.util.concurrent package
14 
#06: Concurrency: ManagedExecutor 
Default ManagedExectuor 
@Resource 
ManagedExecutorService executor; 
! 
ManagedExecutorService executor = (ManagedExecutorService) 
ctx.lookup("java:comp/DefaultManagedExecutorService");!
15 
#06: Concurrency: ManagedExecutor 
Specify in web.xml 
<web-app … version="3.1">! 
<resource-env-ref>! 
<resource-env-ref-name>! 
concurrent/myExecutor! 
</resource-env-ref-name>! 
<resource-env-ref-type>! 
javax.enterprise.concurrent.ManagedExecutorService! 
</resource-env-ref-type>! 
</resource-env-ref>! 
</web-app>!
16 
#07: Concurrency: ManagedScheduledExecutor 
Managed version of ScheduledExecutorService! 
Submit delayed or periodic tasks 
@Resource 
ManagedScheduledExecutorService executor;!
17 
#07: Concurrency: ManagedScheduledExecutor 
Access using JNDI 
InitialContext ctx = new InitialContext(); 
ManagedScheduledExecutorService executor = 
(ManagedScheduledExecutorService)ctx.lookup( 
"java:comp/ 
DefaultManagedScheduledExecutorService"); 
! 
Can be defined in web.xml as well
18 
#07: Concurrency: ManagedScheduledExecutor 
executor.schedule(new MyCallableTask(), 5, 
TimeUnit.SECONDS);! 
executor.scheduleAtFixedRate(new 
MyRunnableTask(), 2, 3, TimeUnit.SECONDS);! 
executor.scheduleWithFixedDelay(new 
MyRunnableTask(), 2, 3, TimeUnit.SECONDS);!
19 
#08: Concurrency: ManagedThreadFactory 
Extends ThreadFactory 
@Resource(name = "DefaultManagedThreadFactory") 
ManagedThreadFactory factory; 
ManagedThreadFactory factory = 
(ManagedThreadFactory) ctx.lookup("java:comp/ 
DefaultManagedThreadFactory");
20 
#08: Concurrency: ManagedThreadFactory 
Thread thread = factory.newThread(new MyTask()); 
((ManageableThread)thread).isShutdown();
21 
#09: Concurrency: DynamicProxy 
Create dynamic proxy objects, adds contextual 
information available for applications running in Java EE 
environment 
Classloading, JNDI, Security, …
22 
#09: Concurrency: DynamicProxy 
@Resource 
ContextService service; 
Runnable proxy = 
service.createContextualProxy(new 
MyRunnable(), Runnable.class); 
Future f = executor.submit(proxy);!
23 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JPA 2.1 (JSR 338)
24 
#10: JPA: Schema Generation 
Standardized database schema generation 
<persistence ... version="2.1">! 
<persistence-unit ...>! 
<properties>! 
<property name="javax.persistence.schema-generation.scripts.action"value="drop-and-create"/>! 
<property name="javax.persistence.schema-generation.scripts.create-target" 
! 
value="create.sql"/>! 
<property name="javax.persistence.sql-load-script-source" ! 
value="insert.sql"/>! 
</properties>! 
</persistence-unit>!
25 
#11: JPA: @Index 
Defines additional indexes in schema generation 
@Entity! 
@Table(indexes = {! 
@Index(columnList = "ISBN"),! 
@Index(columnList = "NBOFPAGE")! })! 
public class Book {! 
! 
@Id @GeneratedValue! 
private Long id;! 
private String isbn;! 
private Integer nbOfPage;! 
...! 
}!
26 
#12: JPA: Unsynchronized Persistence Context 
Persistence context is not enlisted in any tx unless explicitly 
joined 
@PersistenceContext(synchronization =! 
SynchronizationType.UNSYNCHRONIZED)private EntityManager em;! 
...! 
! 
em.persist(book);! 
! 
...! 
em.joinTransaction();! !
27 
#13: JPA: Stored Procedure 
Calling a stored procedure 
@Entity! 
@NamedStoredProcedureQuery(name = "archiveOldBooks", ! 
procedureName = "sp_archive_books",! 
parameters = {! 
@StoredProcedureParameter(name = ”date", mode = IN, ! 
type = Date.class),! 
@StoredProcedureParameter(name = "warehouse", mode = IN, type = String.class)! 
})! 
public class Book {...}!
28 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JTA 1.2 (JSR 907)
29 
#14: JTA: @Transactional 
Transaction management on Managed Beans as CDI 
interceptor binding 
@Path("book")! 
@Transactional(value = Transactional.TxType.REQUIRED,! 
rollbackOn = {SQLException.class, 
JMSException.class},! 
dontRollbackOn = SQLWarning.class)! public class BookRestService {! 
! 
@PersistenceContext! 
private EntityManager em;! 
! 
@POST! 
@Consumes(MediaType.APPLICATION_XML)! 
public Response createBook(Book book) {...}! 
}!
30 
#15: JTA: @TransactionScoped 
CDI scope whose lifecycle is scoped to the currently active JTA 
transaction 
@TransactionScoped! public class BookBean {...}! 
!@ 
WebServlet! 
public class TxServlet extends HttpServlet {! 
@Inject BookBean b1;! 
@Inject BookBean b2;! 
@Transactional! 
protected void processRequest(...) {! 
s_out.println(b1.getReference());! 
s_out.println(b2.getReference());! 
}! 
}!
31 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
EJB 3.2 (JSR 345)
32 
#16: EJB: Disable passivation of stateful 
In some cases increases performance, scalability and 
robustness 
@Stateful(passivationCapable = false)! 
public class ShoppingCart {! 
...! 
}!
33 
#17: EJB-Lite: Async + Non-persistent timer 
Extended the EJB Lite to include local asynchronous invocations 
and non-persistent EJB Timer Service 
@Stateless! 
public class OrderEJB {! 
! 
@Asynchronous! public void sendEmail (Order order) {! 
// Very Long task! 
}! 
! 
@Schedule(hour="2", persistent=false)! 
public void createDailyReport() {! 
// ...! 
}! 
}!
34 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JMS 2.0 (JSR 343)
35 
#18: JMS: JMSContext API 
New simplified API to produce and consume messages 
JMSContext ctx = connectionFactory.createContext()! 
! 
ctx.createProducer().send(queue, "Text message sent");! 
! 
ctx.createConsumer(queue).receiveBody(String.class);! 
! 
ctx.createProducer()! 
.setPriority(2)! 
.setTimeToLive(1000)! 
.setDeliveryMode(DeliveryMode.NON_PERSISTENT)! 
.send(queue, message);!
36 
#19: JMS: Autocloseable 
Several JMS interfaces implement Autocloseable 
try (JMSContext ctx = connectionFactory.createContext()) {! 
ctx.createProducer().send(queue, "Text message sent");! 
}! 
! 
...! 
! 
try (JMSContext ctx = connectionFactory.createContext()) {! 
while (true) {! 
String s = 
ctx.createConsumer(queue).receiveBody(String.class);! 
}! 
}!
37 
#20: JMS: JMSConnectionFactoryDefinition 
A JMS ConnectionFactory can be defined using an annotation 
on a container-managed class 
@Stateless! 
@JMSConnectionFactoryDefinition(! 
name = "java:app/jms/MyConnectionFactory",! 
interfaceName = 
"javax.jms.TopicConnectionFactory")! ! 
! 
! 
public class ExpensiveOrderEJB {...}!
38 
#21: JMS: JMSDestinationDefinition 
A JMS queue or topic can be defined using an annotation 
@Stateless! 
@JMSConnectionFactoryDefinition(! 
name = "java:app/jms/MyConnectionFactory",! 
"j a v a x . j imnst.eTrofpaicceCNoanmnee c=t ionFactory")! 
@JMSDestinationDefinition(! 
name = "java:app/jms/MyTopic",! 
interfaceName = "javax.jms.Topic")! public class ExpensiveOrderEJB {...}!
39 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Servlet 3.1 (JSR 340)
40 
#22: Servlet: Non-blocking I/O 
public class TestServlet extends HttpServlet 
protected void doGet(HttpServletRequest request, 
HttpServletResponse response) 
throws IOException, ServletException { 
ServletInputStream input = request.getInputStream(); 
byte[] b = new byte[1024]; 
int len = -1; 
while ((len = input.read(b)) != -1) { 
. . . 
} 
} 
}!
41 
#22: Servlet: Non-blocking I/O 
New methods to existing interfaces 
ServletInputStream! 
public void setReadListener(ReadListener 
listener);! 
public boolean isFinished();! 
public boolean isReady();! 
ServletOutputStream! 
public setWriteListener(WriteListener 
listener);! 
public boolean canWrite();!
42 
#22: Servlet: Non-blocking I/O 
New interfaces 
public interface ReadListener extends 
EventListener { 
public void onDataAvailable(); 
pubic void onAllDataRead(); 
public void onError(); 
}! 
public interface WriteListener extends 
EventListener { 
public void onWritePossible(); 
public void onError(); 
}!
43 
#22: Servlet: Non-blocking I/O 
Only for Asynchronous Servlets 
AsyncContext context = request.startAsync(); 
ServletInputStream input = 
request.getInputStream(); 
input.setReadListener( 
new MyReadListener(input, context)); !
44 
#23: Servlet: Protocol Upgrade 
<T extends HttpUpgradeHandler> T 
HttpServletRequest.upgrade(Class<T> class) throws 
IOException; 
! 
HttpUpgradeHandler! 
init(WebConnection wc);! 
destroy();!
45 
#23: Servlet: Protocol Upgrade 
public interface WebConnection { 
ServletInputStream getInputStream(); 
ServletOutputStream getOutputStream(); 
}!
46 
#24: Servlet: Improved Security 
Deny an HTTP method request for an uncovered HTTP method 
<web-app . . . version="3.1"> 
<web-resource-collection> 
<url-pattern>/account/*</url-pattern> 
<http-method>GET</http-method> 
</web-resource-collection> 
<auth-contraint> 
. . . 
</auth-contraint> 
</web-app> ! 
!
47 
#24: Servlet: Improved Security 
Deny an HTTP method request for an uncovered HTTP method 
<web-app . . . version="3.1"> 
<deny-uncovered-http-methods/> 
<web-resource-collection> 
<url-pattern>/account/*</url-pattern> 
<http-method>GET</http-method> 
</web-resource-collection> 
<auth-contraint> 
. . . 
</auth-contraint> 
</web-app> ! 
!
48 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Web Socket 1.0 (JSR 356)
49 
#25: WebSocket: Annotated server endpoint 
Enables full-duplex bi-directional communication over 
single TCP connection 
@javax.websocket.server.ServerEndpoint("/chat") 
public class ChatServer { 
@OnMessage 
public String chat(String name, Session session) { 
for (Session peer : client.getOpenSessions()) {! 
peer.getBasicRemote().sendObject(message);! 
} 
} 
}!
50 
#26: WebSocket: Lifecycle callbacks 
@javax.websocket.OnOpen 
public void open(Session s) { . . . } 
@javax.websocket.OnClose 
public void close(CloseReason c) { . . . } 
@javax.websocket.OnError 
public void error(Throwable t) { . . . }!
51 
#27: WebSocket: Annotated client endpoint 
@javax.websocket.ClientEndpoint 
public class MyClient { 
@javax.websocket.OnOpen 
public void open(Session session) { … } 
// Lifecycle callbacks 
}!
52 
#27: WebSocket: Annotated client endpoint 
ContainerProvider 
.getWebSocketContainer() 
.connectToServer( 
MyClient.class, 
URI.create("ws://. . ."));!
53 
#28: WebSocket: Programmatic endpoints 
public class ChatServer extends Endpoint { 
@Override 
public void onOpen(Session s, EndpointConfig ec) { 
s.addMessageHandler(new MessageHandler.Whole<String>() 
{ 
public void onMessage(String text) { . . . } 
} 
} 
@Override 
public void onClose(Session s, CloseReason cr) { . . . } 
//. . . 
}!
54 
#28: WebSocket: Programmatic endpoints 
public class MyApplicationConfig implements 
ServerApplicationConfig { 
public Set<ServerEndpointConfig> 
getEndpointConfigs(…) { 
ServerEndpointConfig.Builder 
.create(MyEndpoint.class, "/websocket”) 
.configurator(new MyConfig()) 
.build() 
} 
}!
55 
#28: WebSocket: Programmatic endpoints 
public class MyConfig extends 
ServerEndpointConfig.Configurator { 
public <T> T getEndpointInstance(. . .) { . . . } 
public void modifyHandshake(. . .) { . . . } 
. . . 
}!
56 
#29: WebSocket: Encoder and Decoder 
@javax.websocket.server.ServerEndpoint( 
value="/chat", 
decoders="MyDecoder.class", 
encoders="MyEncoder.class") 
public class ChatServer { 
@OnMessage 
public String chat(ChatMessage name, Session session) { 
. . . 
} 
}!
57 
#29: WebSocket: Encoder and Decoder 
public class MyDecoder implements Decoder.Text<ChatMessage> 
{ 
public ChatMessage decode(String s) { 
// . . . 
} 
public boolean willDecode(String string) { 
// . . . 
} 
//. . . 
} 
!
58 
#29: WebSocket: Encoder and Decoder 
public class MyEncoder implements Encoder.Text<ChatMessage> 
{ 
public String encode(ChatMessage chatMessage) { 
// . . . 
} 
! 
// . . . 
}!
59 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Expression Language 3.0 (JSR 341)
60 
#30: Expression Langauge: ELProcessor 
Use EL in a stand-alone environment 
Evaluate EL expressions 
Get/set bean properties 
Defining a static method as an EL function 
Defining an object instance as an EL name 
ELProcessor elp = new ELProcessor(); 
elp.defineBean("employee", new Employee("Charlie Brown")); 
String name = elp.eval("employee.name");!
61 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JSF 2.2 (JSR 344)
62 
#31: JSF: Faces Flow 
Package reusable flows in JAR 
./src/main/webapp/flow1 
/flow1.xhtml 
/flow1a.xhtml 
/flow1b.xhtml 
./src/main/webapp/flow2 
/flow2-flow.xml 
/flow2.xhtml 
/flow2a.xhtml 
/flow2b.xhtml 
/index.xhtml!
63 
#31: JSF: Faces Flow 
Package reusable flows in JAR 
@Named 
@FlowScoped("flow1") 
public class Flow1Bean implements Serializable { 
}! 
! 
@Produces @FlowDefinition 
public Flow defineFlow(@FlowBuilderParameter FlowBuilder 
fb) { 
String flowId = "flow1"; 
//. . . 
return fb.getFlow(); 
}!
64 
#31: JSF: Faces Flow 
Package reusable flows in JAR 
#{flowScope}: Local flow storage 
#{facesContext.application.flowHandler.currentFlow} 
: Returns true if within a flow
65 
#32: JSF: Resource Library Contract 
Apply templates in a reusable and interchangeable manner 
index-blue.xhtml 
index-red.xhtml 
WEB-INF/lib/contracts-library-1.0-SNAPSHOT.jar 
/META-INF/contracts/blue 
/style.css 
/javax.faces.contract.xml 
/template.xhtml 
/META-INF/contracts/red 
/style.css 
/javax.faces.contract.xml 
/template.xhtml!
66 
#32: JSF: Resource Library Contract 
Apply templates in a reusable and interchangeable manner 
<f:view contracts=”red”> 
<ui:composition template="/template.xhtml"> 
. . . 
</ui:composition> 
</f:view> 
!
67 
#33: JSF: Pass-through Attributes 
HTML5-Friendly Markup 
<h:inputText type="email" value="#{user.email}"/> 
! 
<input type="text" name="j_idt6:j_idt10"/>! 
<h:inputText p:type="email" value="#{user.email}"/> 
<input type="email" name="j_idt6:j_idt10"/>! 
!
68 
#34: JSF: File Upload Component 
<h:form enctype="multipart/form-data"> 
<h:inputFile value="#{fileUploadBean.file}"/><br/> 
<h:commandButton value="Upload"/><p/> 
</h:form> ! 
@Named @RequestScoped 
public class FileUploadBean { 
private Part file; 
//getter and setter 
} !
69 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JAX-RS 2.0 (JSR 339)
70 
#35: JAX-RS: Client API 
New API to consume rest services 
Client client = ClientBuilder.newClient();! 
WbeoboTk"a)r;g!et target = client.target("http://www.foo.com/ 
Itanrvgoceat.tireonq uiensvt(oTcEaXtTi_oPnL A=I N).buildGet();! 
Response response = invocation.invoke();! 
! 
Response response = ClientBuilder.newClient()! 
.target("http://www.foo.com/book")! 
.request(MediaType.TEXT_PLAIN)! 
.get();! 
! 
String body = ClientBuilder.newClient()! 
.target("http://www.foo.com/book")! 
.request()! 
.get(String.class);!
71 
#36: JAX-RS: Async Client 
The client API also supports asynchronous invocation 
Future<String> future = ClientBuilder.newClient()! 
.target("http://www.foo.com/book")! 
.request()! 
.async()! .get(String.class);! 
! 
try {! 
String body = future.get(1, TimeUnit.MINUTES);! 
{} ..c.at}!ch (InterruptedException | ExecutionException e)
72 
#37: JAX-RS: Async Server 
Asynchronous request processing on the server 
@Path("/async")! 
public class AsyncResource {! 
! 
@GET! 
a spynubcRleics p)v o{i!d asyncGet(@Suspended AsyncResponse 
! 
new Thread(new Runnable() {! 
! 
public void run() {! 
String result = veryExpensiveOperation();! 
asyncResp.resume(result);! }! 
}).start();! 
}}!
73 
#38: JAX-RS: Message Filter 
Used to process incoming and outgoing request or response 
headers 
Filters on client side 
ClientRequestFilter! 
ClientResponseFilter! 
Filters on server side 
ContainerRequestFilter! 
ContainerResponseFilter!
74 
#38: JAX-RS: Message Filter 
Used to process incoming and outgoing request or response 
headers 
public class LogginFilter implements ClientRequestFilter {! 
! 
I O E xcpeubpltiico n v{o!id filter(ClientRequestContext ctx) throws 
System.out.println(ctx.getMethod());! 
System.out.println(ctx.getUri());! 
}! 
}!
75 
#39: JAX-RS: Entity Interceptors 
Marshalling and unmarshalling HTTP message bodies 
Intercepts inbound entity streams (reads from the “wire”) 
ReaderInterceptor! 
Intercepts outbound entity streams (writes to the “wire”) 
WriterInterceptor!
76 
#39: JAX-RS: Entity Interceptors 
Marshalling and unmarshalling HTTP message bodies 
public class GZipInterceptor implements 
WriterInterceptor {! 
! 
c t x) {p!ublic void aroundWriteTo(WriterInterceptorContext 
OutputStream os = ctx.getOutputStream();! 
ctx.setOutputStream(new GZIPOutputStream(os));! 
ctx.proceed();! 
}! 
}!
77 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JSON-P 1.0 (JSR 353)
78 
#40: JSON-P: JSON Builder 
Creates an object model (or an array) in memory by adding 
elements 
JsonObject value = Json.createObjectBuilder()! 
.add("id", "1234")! 
.add("date", "19/09/2012")! 
.add("total_amount", "93.48")! 
.add("customer", Json.createObjectBuilder()! 
.add("first_name", "James")! 
.add("last_name", "Rorrison")! 
.add("email", "j.rorri@me.com")! 
.add("phoneNumber", "+44 1234 1234"))! 
.build();!
79 
#41: JSON-P: JsonParser 
Event-based parser that can read JSON data from a stream 
JsonParser parser = Json.createParser(new 
FileReader(“order.json"));! 
while (parser.hasNext()) {! 
JsonParser.Event event = parser.next();! 
! 
if (event.equals(JsonParser.Event.KEY_NAME) && ! 
parser.getString().matches("email")) {! 
parser.next();! 
email = parser.getString();! 
}! 
}!
80 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Batch 1.0 (JSR 352)
81 
#42: Batch: Chunk-style Processing 
Item-oriented Processing Style (primary)
82 
#42: Batch: Chunk-style Processing 
<step id=”sendStatements”>! 
<chunk item-count=“3”> 
<reader ref=”accountReader”/>! 
<processor ref=”accountProcessor”/> 
<writer ref=”emailWriter”/>! 
</step>! 
…implements ItemReader { 
public Object readItem() { 
// read account using JPA! 
}! 
! 
…implements ItemProcessor {! 
public Object processItems(Object account) { 
// read Account, return Statement! 
}! 
! 
…implements ItemWriter {! 
public void writeItems(List accounts) { 
// use JavaMail to send email! 
}! 
!
83 
#43: Batch: Batchlet-style Processing 
Task-oriented processing style 
<step id=”transferFile”>! 
<batchlet ref=“MyFileTransfer” />! 
</step>! 
…implements Batchlet {! 
@Override 
public void process() { 
// Transfer file! 
}! 
!
84 
#44: Batch: Job/Step/Chunk Listeners 
<job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
version="1.0”> 
<listeners> 
<listener ref="myJobListener"/> 
</listeners> 
<step id="myStep" > 
<listeners> 
<listener ref="myStepListener"/> 
<listener ref="myChunkListener"/> 
<listener ref="myItemReadListener"/> 
<listener ref="myItemProcessorListener"/> 
<listener ref="myItemWriteListener"/> 
</listeners> 
<chunk item-count="3”>. . .</chunk> 
</step> 
</job>! 
!
85 
#44: Batch: Job/Step/Chunk Listeners 
Interface Abstract Classes 
JobListener! AbstractJobListener! 
StepListener! AbstractStepListener! 
ChunkListener! AbstractChunkListener! 
ItemRead/Write/ 
AbstractItemRead/Write/ 
ProcessListener! 
ProcessListener! 
SkipRead/Write/ 
ProcessListener! 
AbstractSkipRead/Write/ 
ProcessListener! 
RetryRead/Write/ 
ProcessListener! 
AbstractRetryRead/Write/ 
ProcessListener!
86 
#44: Batch: Job/Step/Chunk Listeners 
@Named 
public class MyJobListener extends AbstractJobListener { 
@Override 
public void beforeJob() throws Exception { . . . } 
@Override 
public void afterJob() throws Exception { . . . } 
}!
87 
#45: Batch: Partition 
<step> 
<chunk item-count="3"> 
<reader ref="myItemReader"> 
<properties> 
<property name="start" value="#{partitionPlan['start']}"/> 
<property name="end" value="#{partitionPlan['end']}"/> 
</properties> 
</reader> 
. . . 
</chunk>!
88 
#45: Batch: Partition 
<partition> 
<plan partitions="2"> 
<properties partition="0"> 
<property name="start" value="1"/> 
<property name="end" value="10"/> 
</properties> 
<properties partition="1"> 
<property name="start" value="11"/> 
<property name="end" value="20"/> 
</properties> 
</plan> 
</partition> 
</step>!
89 
#46: Batch: Creating Workflows 
Flow: Elements that execute together as a unit 
<flow id="flow1" next="step3"> 
<step id="step1" next="step2"> . . . </step> 
<step id="step2"> . . . </step> 
</flow> 
<step id="step3"> . . . </step>!
90 
#46: Batch: Creating Workflows 
Split: Concurrent execution of flows 
<split id="split1" next=" . . . "> 
<flow id="flow1”> 
<step id="step1”> . . . </step> 
</flow> 
<flow id="flow2”> 
<step id="step2”> . . . </step> 
</flow> 
</split>!
91 
#46: Batch: Creating Workflows 
Decision: Customized way of sequencing between steps, flows, 
splits 
<step id="step1" next="decider1">. . .</step> 
<decision id="decider1" ref="myDecider"> 
<next on="DATA_LOADED" to="step2"/> 
<end on="NOT_LOADED"/> </decision> 
<step id="step2">. . .</step> ! 
! 
@Named 
public class MyDecider implements Decider { 
@Override 
public String decide(StepExecution[] ses) throws 
Exception { 
. . . 
return "DATA_LOADED"; // or "NOT_LOADED"! 
} ! 
}!
92 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JavaMail 1.5 (JSR 919)
93 
#47: JavaMail 
@MailSessionDefinition(name = "java:comp/myMailSession", 
properties = { 
"mail.smtp.host=smtp.gmail.com", 
"mail.smtp.ssl.enable=true", 
"mail.smtp.auth=true", 
"mail.transport.protocol=smtp", 
"mail.debug=true" 
}) 
@Resource(lookup = "java:comp/myMailSession") 
Session session;!
94 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
JCA 1.7 (JSR 322)
95 
#48: Java Connector Architecture 
@ConnectionDefinition( 
connection="MyConnection.class", 
connectionImpl="MyConnectionImpl.class", 
connectionFactory="MyConnectionFactory.class", 
connectionFactoryImpl="MyConnectionFactoryImpl.class" 
) 
! 
@AdministeredObjectDefinition( 
className="MyQueueImpl.class", 
name="java:comp/MyQueue", 
resourceAdapter="myAdapter", 
)!
96 
JAX-RS 
2.0 
JSON-P 
JSP EL 3.0 JSF 2.2 
JSTL 
Web Socket 1.0 
Servlet 3.1 1.0 
Bean Validation 1.1 
Interceptors 1.2 
CDI 1.1 
Concurrency 1.0 
JTA 1.2 EJB 3.2 JMS 2.0 
JPA 2.1 
Batch 1.0 
JCA 1.7 
Java EE 7 
JavaMail 
1.5 
Java EE 7 (JSR 342)
97 
#49: Default Resources 
Default Data Source 
JNDI name: java:comp/DefaultDataSource 
@Resource(lookup="java:comp/DefaultDataSource") 
DataSource myDS; 
! 
@Resource 
DataSource myDS; !
98 
#49: Default Resources 
Default JMS Connection Factory 
JNDI name: java:comp/ 
DefaultJMSConnectionFactory 
@Resource(lookup="java:comp/DefaultJMSConnectionFactory") 
ConnectionFactory myCF; 
@Resource 
ConnectionFactory myCF;!
99 
#49: Default Resources 
Default Concurrency Utilities Objects 
JNDI names 
java:comp/DefaultManagedExecutorService! 
java:comp/ 
DefaultManagedScheduledExecutorService! 
java:comp/DefaultManagedThreadFactory! 
java:comp/DefaultContextService!
100 
#50: Buy our books!
101 
References 
github.com/javaee-samples/javaee7-samples
102

Weitere ähnliche Inhalte

Was ist angesagt?

Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeansRyan Cuprak
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with GradleRyan Cuprak
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula Sorin Chiprian
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)roland.huss
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
Simple REST with Dropwizard
Simple REST with DropwizardSimple REST with Dropwizard
Simple REST with DropwizardAndrei Savu
 
Apache Aries Overview
Apache Aries   OverviewApache Aries   Overview
Apache Aries OverviewIan Robinson
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
Extending WildFly
Extending WildFlyExtending WildFly
Extending WildFlyJBUG London
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Ryan Cuprak
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security LoggingMilton Smith
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Arun Gupta
 

Was ist angesagt? (20)

Node.js Development with Apache NetBeans
Node.js Development with Apache NetBeansNode.js Development with Apache NetBeans
Node.js Development with Apache NetBeans
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Why Play Framework is fast
Why Play Framework is fastWhy Play Framework is fast
Why Play Framework is fast
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
JAX-RS 2.1 Reloaded @ Devoxx
JAX-RS 2.1 Reloaded @ DevoxxJAX-RS 2.1 Reloaded @ Devoxx
JAX-RS 2.1 Reloaded @ Devoxx
 
Faster Java EE Builds with Gradle
Faster Java EE Builds with GradleFaster Java EE Builds with Gradle
Faster Java EE Builds with Gradle
 
Play framework productivity formula
Play framework   productivity formula Play framework   productivity formula
Play framework productivity formula
 
Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)Spicing up JMX with Jolokia (Devoxx 2014)
Spicing up JMX with Jolokia (Devoxx 2014)
 
Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Simple REST with Dropwizard
Simple REST with DropwizardSimple REST with Dropwizard
Simple REST with Dropwizard
 
Apache Aries Overview
Apache Aries   OverviewApache Aries   Overview
Apache Aries Overview
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Extending WildFly
Extending WildFlyExtending WildFly
Extending WildFly
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]Faster java ee builds with gradle [con4921]
Faster java ee builds with gradle [con4921]
 
Play framework
Play frameworkPlay framework
Play framework
 
How to Use OWASP Security Logging
How to Use OWASP Security LoggingHow to Use OWASP Security Logging
How to Use OWASP Security Logging
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 

Andere mochten auch

Deploying Web Applications with WildFly 8
Deploying Web Applications with WildFly 8Deploying Web Applications with WildFly 8
Deploying Web Applications with WildFly 8Arun Gupta
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesArun Gupta
 
How to run your first marathon ? JavaOne 2014 Ignite
How to run your first marathon ? JavaOne 2014 IgniteHow to run your first marathon ? JavaOne 2014 Ignite
How to run your first marathon ? JavaOne 2014 IgniteArun Gupta
 
NoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern SuccessNoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern SuccessArun Gupta
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Arun Gupta
 
Teaching kids how to program
Teaching kids how to programTeaching kids how to program
Teaching kids how to programArun Gupta
 
Introduce Programming to Kids at Geecon 2014
Introduce Programming to Kids at Geecon 2014Introduce Programming to Kids at Geecon 2014
Introduce Programming to Kids at Geecon 2014Arun Gupta
 
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 7WASdev Community
 
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.PilgrimJavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.PilgrimPayara
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!Arun Gupta
 
2012 04-09-v2-tdp-1167-cdi-bestpractices-final
2012 04-09-v2-tdp-1167-cdi-bestpractices-final2012 04-09-v2-tdp-1167-cdi-bestpractices-final
2012 04-09-v2-tdp-1167-cdi-bestpractices-finalRohit Kelapure
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
 
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 minutesArun Gupta
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersArun Gupta
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Arun Gupta
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Arun Gupta
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersArun Gupta
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftArun Gupta
 

Andere mochten auch (20)

Deploying Web Applications with WildFly 8
Deploying Web Applications with WildFly 8Deploying Web Applications with WildFly 8
Deploying Web Applications with WildFly 8
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
How to run your first marathon ? JavaOne 2014 Ignite
How to run your first marathon ? JavaOne 2014 IgniteHow to run your first marathon ? JavaOne 2014 Ignite
How to run your first marathon ? JavaOne 2014 Ignite
 
NoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern SuccessNoSQL - Vital Open Source Ingredient for Modern Success
NoSQL - Vital Open Source Ingredient for Modern Success
 
Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014Java EE 7 Soup to Nuts at JavaOne 2014
Java EE 7 Soup to Nuts at JavaOne 2014
 
Teaching kids how to program
Teaching kids how to programTeaching kids how to program
Teaching kids how to program
 
Introduce Programming to Kids at Geecon 2014
Introduce Programming to Kids at Geecon 2014Introduce Programming to Kids at Geecon 2014
Introduce Programming to Kids at Geecon 2014
 
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
 
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.PilgrimJavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!
 
2012 04-09-v2-tdp-1167-cdi-bestpractices-final
2012 04-09-v2-tdp-1167-cdi-bestpractices-final2012 04-09-v2-tdp-1167-cdi-bestpractices-final
2012 04-09-v2-tdp-1167-cdi-bestpractices-final
 
Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5Java EE 7: Boosting Productivity and Embracing HTML5
Java EE 7: Boosting Productivity and Embracing HTML5
 
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
 
Migrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to ContainersMigrate your traditional VM-based Clusters to Containers
Migrate your traditional VM-based Clusters to Containers
 
Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014Nuts and Bolts of WebSocket Devoxx 2014
Nuts and Bolts of WebSocket Devoxx 2014
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
CQRS is not Event Sourcing
CQRS is not Event SourcingCQRS is not Event Sourcing
CQRS is not Event Sourcing
 
CDI 1.1 university
CDI 1.1 universityCDI 1.1 university
CDI 1.1 university
 
Docker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developersDocker, Kubernetes, and Mesos recipes for Java developers
Docker, Kubernetes, and Mesos recipes for Java developers
 
Java EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShiftJava EE and NoSQL using JBoss EAP 7 and OpenShift
Java EE and NoSQL using JBoss EAP 7 and OpenShift
 

Ähnlich wie 50 features of Java EE 7 in 50 minutes at JavaZone 2014

Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Arun Gupta
 
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 MinutesArun 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 Minutesglassfish
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nationArun Gupta
 
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 minutesAntonio Goncalves
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012Arun Gupta
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Alex Soto
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationPeter Lehto
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Anna Shymchenko
 
The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platformLorraine JUG
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 
Java EE 7 - New Features and the WebSocket API
Java EE 7 - New Features and the WebSocket APIJava EE 7 - New Features and the WebSocket API
Java EE 7 - New Features and the WebSocket APIMarcus Schiesser
 

Ähnlich wie 50 features of Java EE 7 in 50 minutes at JavaZone 2014 (20)

Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
 
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
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
 
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
 
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
The Java EE 7 Platform: Productivity & HTML5 at JavaOne Latin America 2012
 
Whats New In Java Ee 6
Whats New In Java Ee 6Whats New In Java Ee 6
Whats New In Java Ee 6
 
Java EE 7, what's in it for me?
Java EE 7, what's in it for me?Java EE 7, what's in it for me?
Java EE 7, what's in it for me?
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integration
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"
 
The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platform
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
Java EE 7 - New Features and the WebSocket API
Java EE 7 - New Features and the WebSocket APIJava EE 7 - New Features and the WebSocket API
Java EE 7 - New Features and the WebSocket API
 

Mehr von Arun Gupta

5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdfArun Gupta
 
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Arun Gupta
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesArun Gupta
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerArun Gupta
 
Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Arun Gupta
 
Why Amazon Cares about Open Source
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open SourceArun Gupta
 
Machine learning using Kubernetes
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using KubernetesArun Gupta
 
Building Cloud Native Applications
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native ApplicationsArun Gupta
 
Chaos Engineering with Kubernetes
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with KubernetesArun Gupta
 
How to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMArun Gupta
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteArun Gupta
 
Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Arun Gupta
 
Mastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitArun Gupta
 
Top 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeArun Gupta
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017Arun Gupta
 

Mehr von Arun Gupta (16)

5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf5 Skills To Force Multiply Technical Talents.pdf
5 Skills To Force Multiply Technical Talents.pdf
 
Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019Machine Learning using Kubernetes - AI Conclave 2019
Machine Learning using Kubernetes - AI Conclave 2019
 
Machine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and KubernetesMachine Learning using Kubeflow and Kubernetes
Machine Learning using Kubeflow and Kubernetes
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using Firecracker
 
Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019Building Java in the Open - j.Day at OSCON 2019
Building Java in the Open - j.Day at OSCON 2019
 
Why Amazon Cares about Open Source
Why Amazon Cares about Open SourceWhy Amazon Cares about Open Source
Why Amazon Cares about Open Source
 
Machine learning using Kubernetes
Machine learning using KubernetesMachine learning using Kubernetes
Machine learning using Kubernetes
 
Building Cloud Native Applications
Building Cloud Native ApplicationsBuilding Cloud Native Applications
Building Cloud Native Applications
 
Chaos Engineering with Kubernetes
Chaos Engineering with KubernetesChaos Engineering with Kubernetes
Chaos Engineering with Kubernetes
 
How to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAMHow to be a mentor to bring more girls to STEAM
How to be a mentor to bring more girls to STEAM
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
 
Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018Introduction to Amazon EKS - KubeCon 2018
Introduction to Amazon EKS - KubeCon 2018
 
Mastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv SummitMastering Kubernetes on AWS - Tel Aviv Summit
Mastering Kubernetes on AWS - Tel Aviv Summit
 
Top 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's LandscapeTop 10 Technology Trends Changing Developer's Landscape
Top 10 Technology Trends Changing Developer's Landscape
 
Container Landscape in 2017
Container Landscape in 2017Container Landscape in 2017
Container Landscape in 2017
 

Kürzlich hochgeladen

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Kürzlich hochgeladen (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

50 features of Java EE 7 in 50 minutes at JavaZone 2014

  • 1. 1 50 new features of Java EE 7 in 50 minutes Arun Gupta, @arungupta Director, Developer Advocacy Sep 9, 2014
  • 2. 2 #NN: <spec>: <feature>
  • 3. 3 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5
  • 4. 4 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 CDI 1.1 (JSR 346)
  • 5. 5 #01: CDI: Default enabling Finer scanning control Possible values: all, annotated, none! all behaves like in Java EE 6 (default if not set)! ! <beans ... version="1.1" bean-discovery-mode="all">! <alternatives>! <class>org.agoncal.book.MockGenerator</class>! </alternatives>! </beans>!
  • 6. 6 #02: CDI: @Vetoed Veto the processing of the class or package @Vetoed! public class NonProcessedBean { ...! }! ! package-info.java @Vetoed! package com.non.processed.package;!
  • 7. 7 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Bean Validation 1.1 (JSR 349)
  • 8. 8 #03: Bean Validation: Method validation Pre/post conditions on method and constructors public class CardValidator {! ! public CardValidator(@NotNull Algorithm algorithm) {! this.algorithm = algorithm;! }! ! @AssertTrue! public Boolean validate(@NotNull CreditCard creditCard) {! return algorithm.validate(creditCard.getNumber());! }! }!
  • 9. 9 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Interceptors 1.2 (JSR 318)
  • 10. 10 #04: Interceptors: AroundConstruct Interceptor associated with a constructor !public class LoggingInterceptor {! @AroundConstruct! p r i vlaotgeg evro.ifdi inne(i"t(EInntveorciantgi ocnoCnosnttreuxctt oirc")) ;{!! ilco.ggperor.cefeidn(e()";!Exiting constructor");! ! }! @pAurboluincd IOnbvjoekcet! logMethod(InvocationContext ic) ... {}! // ...! }!
  • 11. 11 #05: Interceptors: @Priority Prioritizing interceptor bindings PLATFORM_BEFORE (0), LIBRARY_BEFORE (1000), APPLICATION (2000), LIBRARY_AFTER (3000), PLATFORM_AFTER (4000)! @Interceptor! @Loggable! @Priority(Interceptor.Priority.LIBRARY_BEFORE+10)! public class LoggingInterceptor {! ! @AroundInvoke! ...! }!
  • 12. 12 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Concurrency utilities 1.0 (JSR 236)
  • 13. 13 #06: Concurrency: ManagedExecutor User threads in Java EE applications Support simple and advance concurrency design patterns Extend Concurrency Utilities API from Java SE (JSR 166y) java.util.concurrent package
  • 14. 14 #06: Concurrency: ManagedExecutor Default ManagedExectuor @Resource ManagedExecutorService executor; ! ManagedExecutorService executor = (ManagedExecutorService) ctx.lookup("java:comp/DefaultManagedExecutorService");!
  • 15. 15 #06: Concurrency: ManagedExecutor Specify in web.xml <web-app … version="3.1">! <resource-env-ref>! <resource-env-ref-name>! concurrent/myExecutor! </resource-env-ref-name>! <resource-env-ref-type>! javax.enterprise.concurrent.ManagedExecutorService! </resource-env-ref-type>! </resource-env-ref>! </web-app>!
  • 16. 16 #07: Concurrency: ManagedScheduledExecutor Managed version of ScheduledExecutorService! Submit delayed or periodic tasks @Resource ManagedScheduledExecutorService executor;!
  • 17. 17 #07: Concurrency: ManagedScheduledExecutor Access using JNDI InitialContext ctx = new InitialContext(); ManagedScheduledExecutorService executor = (ManagedScheduledExecutorService)ctx.lookup( "java:comp/ DefaultManagedScheduledExecutorService"); ! Can be defined in web.xml as well
  • 18. 18 #07: Concurrency: ManagedScheduledExecutor executor.schedule(new MyCallableTask(), 5, TimeUnit.SECONDS);! executor.scheduleAtFixedRate(new MyRunnableTask(), 2, 3, TimeUnit.SECONDS);! executor.scheduleWithFixedDelay(new MyRunnableTask(), 2, 3, TimeUnit.SECONDS);!
  • 19. 19 #08: Concurrency: ManagedThreadFactory Extends ThreadFactory @Resource(name = "DefaultManagedThreadFactory") ManagedThreadFactory factory; ManagedThreadFactory factory = (ManagedThreadFactory) ctx.lookup("java:comp/ DefaultManagedThreadFactory");
  • 20. 20 #08: Concurrency: ManagedThreadFactory Thread thread = factory.newThread(new MyTask()); ((ManageableThread)thread).isShutdown();
  • 21. 21 #09: Concurrency: DynamicProxy Create dynamic proxy objects, adds contextual information available for applications running in Java EE environment Classloading, JNDI, Security, …
  • 22. 22 #09: Concurrency: DynamicProxy @Resource ContextService service; Runnable proxy = service.createContextualProxy(new MyRunnable(), Runnable.class); Future f = executor.submit(proxy);!
  • 23. 23 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JPA 2.1 (JSR 338)
  • 24. 24 #10: JPA: Schema Generation Standardized database schema generation <persistence ... version="2.1">! <persistence-unit ...>! <properties>! <property name="javax.persistence.schema-generation.scripts.action"value="drop-and-create"/>! <property name="javax.persistence.schema-generation.scripts.create-target" ! value="create.sql"/>! <property name="javax.persistence.sql-load-script-source" ! value="insert.sql"/>! </properties>! </persistence-unit>!
  • 25. 25 #11: JPA: @Index Defines additional indexes in schema generation @Entity! @Table(indexes = {! @Index(columnList = "ISBN"),! @Index(columnList = "NBOFPAGE")! })! public class Book {! ! @Id @GeneratedValue! private Long id;! private String isbn;! private Integer nbOfPage;! ...! }!
  • 26. 26 #12: JPA: Unsynchronized Persistence Context Persistence context is not enlisted in any tx unless explicitly joined @PersistenceContext(synchronization =! SynchronizationType.UNSYNCHRONIZED)private EntityManager em;! ...! ! em.persist(book);! ! ...! em.joinTransaction();! !
  • 27. 27 #13: JPA: Stored Procedure Calling a stored procedure @Entity! @NamedStoredProcedureQuery(name = "archiveOldBooks", ! procedureName = "sp_archive_books",! parameters = {! @StoredProcedureParameter(name = ”date", mode = IN, ! type = Date.class),! @StoredProcedureParameter(name = "warehouse", mode = IN, type = String.class)! })! public class Book {...}!
  • 28. 28 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JTA 1.2 (JSR 907)
  • 29. 29 #14: JTA: @Transactional Transaction management on Managed Beans as CDI interceptor binding @Path("book")! @Transactional(value = Transactional.TxType.REQUIRED,! rollbackOn = {SQLException.class, JMSException.class},! dontRollbackOn = SQLWarning.class)! public class BookRestService {! ! @PersistenceContext! private EntityManager em;! ! @POST! @Consumes(MediaType.APPLICATION_XML)! public Response createBook(Book book) {...}! }!
  • 30. 30 #15: JTA: @TransactionScoped CDI scope whose lifecycle is scoped to the currently active JTA transaction @TransactionScoped! public class BookBean {...}! !@ WebServlet! public class TxServlet extends HttpServlet {! @Inject BookBean b1;! @Inject BookBean b2;! @Transactional! protected void processRequest(...) {! s_out.println(b1.getReference());! s_out.println(b2.getReference());! }! }!
  • 31. 31 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 EJB 3.2 (JSR 345)
  • 32. 32 #16: EJB: Disable passivation of stateful In some cases increases performance, scalability and robustness @Stateful(passivationCapable = false)! public class ShoppingCart {! ...! }!
  • 33. 33 #17: EJB-Lite: Async + Non-persistent timer Extended the EJB Lite to include local asynchronous invocations and non-persistent EJB Timer Service @Stateless! public class OrderEJB {! ! @Asynchronous! public void sendEmail (Order order) {! // Very Long task! }! ! @Schedule(hour="2", persistent=false)! public void createDailyReport() {! // ...! }! }!
  • 34. 34 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JMS 2.0 (JSR 343)
  • 35. 35 #18: JMS: JMSContext API New simplified API to produce and consume messages JMSContext ctx = connectionFactory.createContext()! ! ctx.createProducer().send(queue, "Text message sent");! ! ctx.createConsumer(queue).receiveBody(String.class);! ! ctx.createProducer()! .setPriority(2)! .setTimeToLive(1000)! .setDeliveryMode(DeliveryMode.NON_PERSISTENT)! .send(queue, message);!
  • 36. 36 #19: JMS: Autocloseable Several JMS interfaces implement Autocloseable try (JMSContext ctx = connectionFactory.createContext()) {! ctx.createProducer().send(queue, "Text message sent");! }! ! ...! ! try (JMSContext ctx = connectionFactory.createContext()) {! while (true) {! String s = ctx.createConsumer(queue).receiveBody(String.class);! }! }!
  • 37. 37 #20: JMS: JMSConnectionFactoryDefinition A JMS ConnectionFactory can be defined using an annotation on a container-managed class @Stateless! @JMSConnectionFactoryDefinition(! name = "java:app/jms/MyConnectionFactory",! interfaceName = "javax.jms.TopicConnectionFactory")! ! ! ! public class ExpensiveOrderEJB {...}!
  • 38. 38 #21: JMS: JMSDestinationDefinition A JMS queue or topic can be defined using an annotation @Stateless! @JMSConnectionFactoryDefinition(! name = "java:app/jms/MyConnectionFactory",! "j a v a x . j imnst.eTrofpaicceCNoanmnee c=t ionFactory")! @JMSDestinationDefinition(! name = "java:app/jms/MyTopic",! interfaceName = "javax.jms.Topic")! public class ExpensiveOrderEJB {...}!
  • 39. 39 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Servlet 3.1 (JSR 340)
  • 40. 40 #22: Servlet: Non-blocking I/O public class TestServlet extends HttpServlet protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ServletInputStream input = request.getInputStream(); byte[] b = new byte[1024]; int len = -1; while ((len = input.read(b)) != -1) { . . . } } }!
  • 41. 41 #22: Servlet: Non-blocking I/O New methods to existing interfaces ServletInputStream! public void setReadListener(ReadListener listener);! public boolean isFinished();! public boolean isReady();! ServletOutputStream! public setWriteListener(WriteListener listener);! public boolean canWrite();!
  • 42. 42 #22: Servlet: Non-blocking I/O New interfaces public interface ReadListener extends EventListener { public void onDataAvailable(); pubic void onAllDataRead(); public void onError(); }! public interface WriteListener extends EventListener { public void onWritePossible(); public void onError(); }!
  • 43. 43 #22: Servlet: Non-blocking I/O Only for Asynchronous Servlets AsyncContext context = request.startAsync(); ServletInputStream input = request.getInputStream(); input.setReadListener( new MyReadListener(input, context)); !
  • 44. 44 #23: Servlet: Protocol Upgrade <T extends HttpUpgradeHandler> T HttpServletRequest.upgrade(Class<T> class) throws IOException; ! HttpUpgradeHandler! init(WebConnection wc);! destroy();!
  • 45. 45 #23: Servlet: Protocol Upgrade public interface WebConnection { ServletInputStream getInputStream(); ServletOutputStream getOutputStream(); }!
  • 46. 46 #24: Servlet: Improved Security Deny an HTTP method request for an uncovered HTTP method <web-app . . . version="3.1"> <web-resource-collection> <url-pattern>/account/*</url-pattern> <http-method>GET</http-method> </web-resource-collection> <auth-contraint> . . . </auth-contraint> </web-app> ! !
  • 47. 47 #24: Servlet: Improved Security Deny an HTTP method request for an uncovered HTTP method <web-app . . . version="3.1"> <deny-uncovered-http-methods/> <web-resource-collection> <url-pattern>/account/*</url-pattern> <http-method>GET</http-method> </web-resource-collection> <auth-contraint> . . . </auth-contraint> </web-app> ! !
  • 48. 48 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Web Socket 1.0 (JSR 356)
  • 49. 49 #25: WebSocket: Annotated server endpoint Enables full-duplex bi-directional communication over single TCP connection @javax.websocket.server.ServerEndpoint("/chat") public class ChatServer { @OnMessage public String chat(String name, Session session) { for (Session peer : client.getOpenSessions()) {! peer.getBasicRemote().sendObject(message);! } } }!
  • 50. 50 #26: WebSocket: Lifecycle callbacks @javax.websocket.OnOpen public void open(Session s) { . . . } @javax.websocket.OnClose public void close(CloseReason c) { . . . } @javax.websocket.OnError public void error(Throwable t) { . . . }!
  • 51. 51 #27: WebSocket: Annotated client endpoint @javax.websocket.ClientEndpoint public class MyClient { @javax.websocket.OnOpen public void open(Session session) { … } // Lifecycle callbacks }!
  • 52. 52 #27: WebSocket: Annotated client endpoint ContainerProvider .getWebSocketContainer() .connectToServer( MyClient.class, URI.create("ws://. . ."));!
  • 53. 53 #28: WebSocket: Programmatic endpoints public class ChatServer extends Endpoint { @Override public void onOpen(Session s, EndpointConfig ec) { s.addMessageHandler(new MessageHandler.Whole<String>() { public void onMessage(String text) { . . . } } } @Override public void onClose(Session s, CloseReason cr) { . . . } //. . . }!
  • 54. 54 #28: WebSocket: Programmatic endpoints public class MyApplicationConfig implements ServerApplicationConfig { public Set<ServerEndpointConfig> getEndpointConfigs(…) { ServerEndpointConfig.Builder .create(MyEndpoint.class, "/websocket”) .configurator(new MyConfig()) .build() } }!
  • 55. 55 #28: WebSocket: Programmatic endpoints public class MyConfig extends ServerEndpointConfig.Configurator { public <T> T getEndpointInstance(. . .) { . . . } public void modifyHandshake(. . .) { . . . } . . . }!
  • 56. 56 #29: WebSocket: Encoder and Decoder @javax.websocket.server.ServerEndpoint( value="/chat", decoders="MyDecoder.class", encoders="MyEncoder.class") public class ChatServer { @OnMessage public String chat(ChatMessage name, Session session) { . . . } }!
  • 57. 57 #29: WebSocket: Encoder and Decoder public class MyDecoder implements Decoder.Text<ChatMessage> { public ChatMessage decode(String s) { // . . . } public boolean willDecode(String string) { // . . . } //. . . } !
  • 58. 58 #29: WebSocket: Encoder and Decoder public class MyEncoder implements Encoder.Text<ChatMessage> { public String encode(ChatMessage chatMessage) { // . . . } ! // . . . }!
  • 59. 59 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Expression Language 3.0 (JSR 341)
  • 60. 60 #30: Expression Langauge: ELProcessor Use EL in a stand-alone environment Evaluate EL expressions Get/set bean properties Defining a static method as an EL function Defining an object instance as an EL name ELProcessor elp = new ELProcessor(); elp.defineBean("employee", new Employee("Charlie Brown")); String name = elp.eval("employee.name");!
  • 61. 61 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JSF 2.2 (JSR 344)
  • 62. 62 #31: JSF: Faces Flow Package reusable flows in JAR ./src/main/webapp/flow1 /flow1.xhtml /flow1a.xhtml /flow1b.xhtml ./src/main/webapp/flow2 /flow2-flow.xml /flow2.xhtml /flow2a.xhtml /flow2b.xhtml /index.xhtml!
  • 63. 63 #31: JSF: Faces Flow Package reusable flows in JAR @Named @FlowScoped("flow1") public class Flow1Bean implements Serializable { }! ! @Produces @FlowDefinition public Flow defineFlow(@FlowBuilderParameter FlowBuilder fb) { String flowId = "flow1"; //. . . return fb.getFlow(); }!
  • 64. 64 #31: JSF: Faces Flow Package reusable flows in JAR #{flowScope}: Local flow storage #{facesContext.application.flowHandler.currentFlow} : Returns true if within a flow
  • 65. 65 #32: JSF: Resource Library Contract Apply templates in a reusable and interchangeable manner index-blue.xhtml index-red.xhtml WEB-INF/lib/contracts-library-1.0-SNAPSHOT.jar /META-INF/contracts/blue /style.css /javax.faces.contract.xml /template.xhtml /META-INF/contracts/red /style.css /javax.faces.contract.xml /template.xhtml!
  • 66. 66 #32: JSF: Resource Library Contract Apply templates in a reusable and interchangeable manner <f:view contracts=”red”> <ui:composition template="/template.xhtml"> . . . </ui:composition> </f:view> !
  • 67. 67 #33: JSF: Pass-through Attributes HTML5-Friendly Markup <h:inputText type="email" value="#{user.email}"/> ! <input type="text" name="j_idt6:j_idt10"/>! <h:inputText p:type="email" value="#{user.email}"/> <input type="email" name="j_idt6:j_idt10"/>! !
  • 68. 68 #34: JSF: File Upload Component <h:form enctype="multipart/form-data"> <h:inputFile value="#{fileUploadBean.file}"/><br/> <h:commandButton value="Upload"/><p/> </h:form> ! @Named @RequestScoped public class FileUploadBean { private Part file; //getter and setter } !
  • 69. 69 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JAX-RS 2.0 (JSR 339)
  • 70. 70 #35: JAX-RS: Client API New API to consume rest services Client client = ClientBuilder.newClient();! WbeoboTk"a)r;g!et target = client.target("http://www.foo.com/ Itanrvgoceat.tireonq uiensvt(oTcEaXtTi_oPnL A=I N).buildGet();! Response response = invocation.invoke();! ! Response response = ClientBuilder.newClient()! .target("http://www.foo.com/book")! .request(MediaType.TEXT_PLAIN)! .get();! ! String body = ClientBuilder.newClient()! .target("http://www.foo.com/book")! .request()! .get(String.class);!
  • 71. 71 #36: JAX-RS: Async Client The client API also supports asynchronous invocation Future<String> future = ClientBuilder.newClient()! .target("http://www.foo.com/book")! .request()! .async()! .get(String.class);! ! try {! String body = future.get(1, TimeUnit.MINUTES);! {} ..c.at}!ch (InterruptedException | ExecutionException e)
  • 72. 72 #37: JAX-RS: Async Server Asynchronous request processing on the server @Path("/async")! public class AsyncResource {! ! @GET! a spynubcRleics p)v o{i!d asyncGet(@Suspended AsyncResponse ! new Thread(new Runnable() {! ! public void run() {! String result = veryExpensiveOperation();! asyncResp.resume(result);! }! }).start();! }}!
  • 73. 73 #38: JAX-RS: Message Filter Used to process incoming and outgoing request or response headers Filters on client side ClientRequestFilter! ClientResponseFilter! Filters on server side ContainerRequestFilter! ContainerResponseFilter!
  • 74. 74 #38: JAX-RS: Message Filter Used to process incoming and outgoing request or response headers public class LogginFilter implements ClientRequestFilter {! ! I O E xcpeubpltiico n v{o!id filter(ClientRequestContext ctx) throws System.out.println(ctx.getMethod());! System.out.println(ctx.getUri());! }! }!
  • 75. 75 #39: JAX-RS: Entity Interceptors Marshalling and unmarshalling HTTP message bodies Intercepts inbound entity streams (reads from the “wire”) ReaderInterceptor! Intercepts outbound entity streams (writes to the “wire”) WriterInterceptor!
  • 76. 76 #39: JAX-RS: Entity Interceptors Marshalling and unmarshalling HTTP message bodies public class GZipInterceptor implements WriterInterceptor {! ! c t x) {p!ublic void aroundWriteTo(WriterInterceptorContext OutputStream os = ctx.getOutputStream();! ctx.setOutputStream(new GZIPOutputStream(os));! ctx.proceed();! }! }!
  • 77. 77 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JSON-P 1.0 (JSR 353)
  • 78. 78 #40: JSON-P: JSON Builder Creates an object model (or an array) in memory by adding elements JsonObject value = Json.createObjectBuilder()! .add("id", "1234")! .add("date", "19/09/2012")! .add("total_amount", "93.48")! .add("customer", Json.createObjectBuilder()! .add("first_name", "James")! .add("last_name", "Rorrison")! .add("email", "j.rorri@me.com")! .add("phoneNumber", "+44 1234 1234"))! .build();!
  • 79. 79 #41: JSON-P: JsonParser Event-based parser that can read JSON data from a stream JsonParser parser = Json.createParser(new FileReader(“order.json"));! while (parser.hasNext()) {! JsonParser.Event event = parser.next();! ! if (event.equals(JsonParser.Event.KEY_NAME) && ! parser.getString().matches("email")) {! parser.next();! email = parser.getString();! }! }!
  • 80. 80 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Batch 1.0 (JSR 352)
  • 81. 81 #42: Batch: Chunk-style Processing Item-oriented Processing Style (primary)
  • 82. 82 #42: Batch: Chunk-style Processing <step id=”sendStatements”>! <chunk item-count=“3”> <reader ref=”accountReader”/>! <processor ref=”accountProcessor”/> <writer ref=”emailWriter”/>! </step>! …implements ItemReader { public Object readItem() { // read account using JPA! }! ! …implements ItemProcessor {! public Object processItems(Object account) { // read Account, return Statement! }! ! …implements ItemWriter {! public void writeItems(List accounts) { // use JavaMail to send email! }! !
  • 83. 83 #43: Batch: Batchlet-style Processing Task-oriented processing style <step id=”transferFile”>! <batchlet ref=“MyFileTransfer” />! </step>! …implements Batchlet {! @Override public void process() { // Transfer file! }! !
  • 84. 84 #44: Batch: Job/Step/Chunk Listeners <job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0”> <listeners> <listener ref="myJobListener"/> </listeners> <step id="myStep" > <listeners> <listener ref="myStepListener"/> <listener ref="myChunkListener"/> <listener ref="myItemReadListener"/> <listener ref="myItemProcessorListener"/> <listener ref="myItemWriteListener"/> </listeners> <chunk item-count="3”>. . .</chunk> </step> </job>! !
  • 85. 85 #44: Batch: Job/Step/Chunk Listeners Interface Abstract Classes JobListener! AbstractJobListener! StepListener! AbstractStepListener! ChunkListener! AbstractChunkListener! ItemRead/Write/ AbstractItemRead/Write/ ProcessListener! ProcessListener! SkipRead/Write/ ProcessListener! AbstractSkipRead/Write/ ProcessListener! RetryRead/Write/ ProcessListener! AbstractRetryRead/Write/ ProcessListener!
  • 86. 86 #44: Batch: Job/Step/Chunk Listeners @Named public class MyJobListener extends AbstractJobListener { @Override public void beforeJob() throws Exception { . . . } @Override public void afterJob() throws Exception { . . . } }!
  • 87. 87 #45: Batch: Partition <step> <chunk item-count="3"> <reader ref="myItemReader"> <properties> <property name="start" value="#{partitionPlan['start']}"/> <property name="end" value="#{partitionPlan['end']}"/> </properties> </reader> . . . </chunk>!
  • 88. 88 #45: Batch: Partition <partition> <plan partitions="2"> <properties partition="0"> <property name="start" value="1"/> <property name="end" value="10"/> </properties> <properties partition="1"> <property name="start" value="11"/> <property name="end" value="20"/> </properties> </plan> </partition> </step>!
  • 89. 89 #46: Batch: Creating Workflows Flow: Elements that execute together as a unit <flow id="flow1" next="step3"> <step id="step1" next="step2"> . . . </step> <step id="step2"> . . . </step> </flow> <step id="step3"> . . . </step>!
  • 90. 90 #46: Batch: Creating Workflows Split: Concurrent execution of flows <split id="split1" next=" . . . "> <flow id="flow1”> <step id="step1”> . . . </step> </flow> <flow id="flow2”> <step id="step2”> . . . </step> </flow> </split>!
  • 91. 91 #46: Batch: Creating Workflows Decision: Customized way of sequencing between steps, flows, splits <step id="step1" next="decider1">. . .</step> <decision id="decider1" ref="myDecider"> <next on="DATA_LOADED" to="step2"/> <end on="NOT_LOADED"/> </decision> <step id="step2">. . .</step> ! ! @Named public class MyDecider implements Decider { @Override public String decide(StepExecution[] ses) throws Exception { . . . return "DATA_LOADED"; // or "NOT_LOADED"! } ! }!
  • 92. 92 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JavaMail 1.5 (JSR 919)
  • 93. 93 #47: JavaMail @MailSessionDefinition(name = "java:comp/myMailSession", properties = { "mail.smtp.host=smtp.gmail.com", "mail.smtp.ssl.enable=true", "mail.smtp.auth=true", "mail.transport.protocol=smtp", "mail.debug=true" }) @Resource(lookup = "java:comp/myMailSession") Session session;!
  • 94. 94 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JCA 1.7 (JSR 322)
  • 95. 95 #48: Java Connector Architecture @ConnectionDefinition( connection="MyConnection.class", connectionImpl="MyConnectionImpl.class", connectionFactory="MyConnectionFactory.class", connectionFactoryImpl="MyConnectionFactoryImpl.class" ) ! @AdministeredObjectDefinition( className="MyQueueImpl.class", name="java:comp/MyQueue", resourceAdapter="myAdapter", )!
  • 96. 96 JAX-RS 2.0 JSON-P JSP EL 3.0 JSF 2.2 JSTL Web Socket 1.0 Servlet 3.1 1.0 Bean Validation 1.1 Interceptors 1.2 CDI 1.1 Concurrency 1.0 JTA 1.2 EJB 3.2 JMS 2.0 JPA 2.1 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Java EE 7 (JSR 342)
  • 97. 97 #49: Default Resources Default Data Source JNDI name: java:comp/DefaultDataSource @Resource(lookup="java:comp/DefaultDataSource") DataSource myDS; ! @Resource DataSource myDS; !
  • 98. 98 #49: Default Resources Default JMS Connection Factory JNDI name: java:comp/ DefaultJMSConnectionFactory @Resource(lookup="java:comp/DefaultJMSConnectionFactory") ConnectionFactory myCF; @Resource ConnectionFactory myCF;!
  • 99. 99 #49: Default Resources Default Concurrency Utilities Objects JNDI names java:comp/DefaultManagedExecutorService! java:comp/ DefaultManagedScheduledExecutorService! java:comp/DefaultManagedThreadFactory! java:comp/DefaultContextService!
  • 100. 100 #50: Buy our books!
  • 102. 102