SlideShare une entreprise Scribd logo
1  sur  107
Télécharger pour lire hors ligne
Java EE 7 :
What’s new in the Java EE
Platform
Arun Gupta
Antonio Goncalves

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


CDI 1.1 (JSR 346)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
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>!

#DV13-UniJavaEE7

@arungupta @agoncal
@Vetoed

Veto the processing of the class or package	

@Vetoed!
public class NonProcessedBean {

...!
}!
!
package-info.java!
@Vetoed!
package com.non.processed.package;!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Bean Validation 1.1 (JSR 349)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
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());!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI in validators

Injection in validators is now possible	

public class ZipCodeValidator implements!
ConstraintValidator<ZipCode, String> {!
!
@Inject @USA!
ZipCodeChecker checker = new ZipCodeChecker();!
!
public boolean isValid(String value,!
ConstraintValidatorContext context) {!
!
return checker.isZipCodeValid(value);!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Interceptors 1.2 (JSR 318)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
AroundConstruct

Interceptor associated with a constructor	

public class LoggingInterceptor {!
!
@AroundConstruct!
private void init(InvocationContext ic) throws Exception{!
logger.fine("Entering constructor");!
ic.proceed();!
logger.fine("Exiting constructor");!
}!
!
@AroundInvoke!
public Object logMethod(InvocationContext ic) ... {!
// ...!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
@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!
...!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Concurrency utilities 1.0 (JSR 236)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
ManagedExecutor
Threads in Java EE	


•  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

#DV13-UniJavaEE7

package

@arungupta @agoncal
ManagedExecutor
Default ManagedExectuor	


@Resource

ManagedExecutorService executor;

!


ManagedExecutorService executor = (ManagedExecutorService) !
ctx.lookup("java:comp/DefaultManagedExecutorService");!

#DV13-UniJavaEE7

@arungupta @agoncal
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>!

#DV13-UniJavaEE7

@arungupta @agoncal
ManagedScheduledExecutor
Thread Scheduler in Java EE	


•  Managed version of ScheduledExecutorService
•  Submit delayed or periodic tasks	

@Resource

ManagedScheduledExecutorService executor;!

#DV13-UniJavaEE7

@arungupta @agoncal
ManagedScheduledExecutor
Access using JNDI	


•  Can be defined in web.xml as well
InitialContext ctx = new InitialContext(); 



ManagedScheduledExecutorService executor =
(ManagedScheduledExecutorService)ctx.lookup(

"java:comp/DefaultManagedScheduledExecutorService");

!

#DV13-UniJavaEE7

@arungupta @agoncal
ManagedScheduledExecutor
Samples	


executor.schedule(new MyCallableTask(), 5, TimeUnit.SECONDS);!
!
executor.scheduleAtFixedRate(new MyRunnableTask(), 2, 3,!
TimeUnit.SECONDS);!
!
executor.scheduleWithFixedDelay(new MyRunnableTask(), 2, 3,!
TimeUnit.SECONDS);!
!

#DV13-UniJavaEE7

@arungupta @agoncal
ManagedThreadFactory

Extends ThreadFactory
	

 @Resource(name = DefaultManagedThreadFactory)

ManagedThreadFactory factory;


ManagedThreadFactory factory = (ManagedThreadFactory)
ctx.lookup(java:comp/DefaultManagedThreadFactory);

!

#DV13-UniJavaEE7

@arungupta @agoncal
ManagedThreadFactory
Extends ThreadFactory
	

 Thread thread = factory.newThread(new

MyTask());




!
((ManageableThread)thread).isShutdown();



!

#DV13-UniJavaEE7

@arungupta @agoncal
DynamicProxy
Dynamic proxies	


•  Create dynamic proxy objects, adds contextual information
• 

available for applications running in Java EE environment	

Classloading, JNDI, Security, …	


#DV13-UniJavaEE7

@arungupta @agoncal
DynamicProxy
Create contextual proxies	


@Resource

ContextService service;





Runnable proxy = service.createContextualProxy(!
new MyRunnable(), Runnable.class);





Future f = executor.submit(proxy);!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JPA 2.1 (JSR 338)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
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!

#DV13-UniJavaEE7

@arungupta @agoncal
@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;!
...!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Unsynchronized Persistence Context
Persistence context not enlisted in any tx unless explicitly joined	


@PersistenceContext(synchronization =!
SynchronizationType.UNSYNCHRONIZED)!
private EntityManager em;!
...!
!
em.persist(book);!
!
...!
em.joinTransaction();!
!

#DV13-UniJavaEE7

@arungupta @agoncal
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 {...}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI in listeners

Injection is now possible into event listeners	

public class AgeCalculationListener {!
!
@Inject!
private AgeCalculator ageCalculator;!
!
@PostLoad!
@PostPersist!
@PostUpdate!
public void calculateAge(Customer c) {!
customer.setAge(ageCalculator.calc(c.getBirth));!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Converters

Classes that convert between database and attributes	


@Converter!
public class CreditCardEnumConverter implements!
AttributeConverterCreditCard, String {!
!
public String convertToDatabaseColumn(CreditCard attr) {...}!
public CreditCard convertToEntityAttribute(String data){...}!
}!
!
@Entity!
public class Order {!
!
@Convert(converter = CreditCardEnumConverter.class)!
private CreditCard creditCard;!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JTA 1.2 (JSR 907)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
@Transactional

TX 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) {...}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
@TransactionScoped

CDI scope whose lifecycle is scoped to the currently active JTA tx	

@TransactionScoped!
public class BookBean {...}!
!
@WebServlet!
public class TxServlet extends HttpServlet {!
@Inject UserTransaction tx;!
@Inject BookBean b1;!
@Inject BookBean b2;!
!
protected void processRequest(...) {!
tx.begin();!
s_out.println(b1.getReference());!
s_out.println(b2.getReference());!
tx.commit(); }}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


EJB 3.2 (JSR 345)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Disable passivation of stateful

In some cases increases performance, scalability and robustness	

@Stateful(passivationCapable = false)!
public class ShoppingCart {!
...!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
EJB-Lite: Async + Non-persistent timer
EJB Lite includes async invocations and non-persistent EJB Timer	

@Stateless!
public class OrderEJB {!
!
@Asynchronous!
public void sendEmail (Order order) {!
// Very Long task!
}!
!
@Schedule(hour=2, persistent=false)!
public void createDailyReport() {!
// ...!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JMS 2.0 (JSR 343)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
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);!

#DV13-UniJavaEE7

@arungupta @agoncal
Runtime Exceptions

A set of new unchecked exceptions have been created	

RuntimeException!
JMSRuntimeException!
IllegalStateRuntimeException!
InvalidClientIDRuntimeException!
InvalidDestinationRuntimeException!
InvalidSelectorRuntimeException!
JMSSecurityRuntimeException!
MessageFormatRuntimeException!
MessageNotWriteableRuntimeException!
ResourceAllocationRuntimeException!
TransactionInProgressRuntimeException!
TransactionRolledBackRuntimeException!

#DV13-UniJavaEE7

@arungupta @agoncal
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(q).receiveBody(String.class);!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
JMSConnectionFactoryDefinition
ConnectionFactory can be defined using an annotation	


@Stateless!
@JMSConnectionFactoryDefinition(!
name = java:app/jms/MyConnectionFactory,!
interfaceName = javax.jms.TopicConnectionFactory)!
!
!
!
public class ExpensiveOrderEJB {...}!

#DV13-UniJavaEE7

@arungupta @agoncal
JMSDestinationDefinition

A JMS queue or topic can be defined using an annotation	

@Stateless!
@JMSConnectionFactoryDefinition(!
name = java:app/jms/MyConnectionFactory,!
interfaceName = javax.jms.TopicConnectionFactory)!
@JMSDestinationDefinition(!
name = java:app/jms/MyTopic,!
interfaceName = javax.jms.Topic)!
public class ExpensiveOrderEJB {...}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Servlet 3.1 (JSR 340)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Non-blocking I/O
Non-blocking I/O in Servlets	


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) {

. . .

}

}

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Non-blocking I/O

New methods to existing interfaces	


•  ServletInputStream
•  public
•  public
•  public

void setReadListener(ReadListener l);
boolean isFinished();
boolean isReady();

•  public
•  public

setWriteListener(WriteListener l);
boolean canWrite();

•  ServletOutputStream

#DV13-UniJavaEE7

@arungupta @agoncal
Non-blocking I/O
New interfaces	


public interface ReadListener extends EventListener {

public void onDataAvailable();

public void onAllDataRead();

public void onError();

}!
public interface WriteListener extends EventListener {

public void onWritePossible();

public void onError();

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Non-blocking I/O

Only for Asynchronous Servlets	

AsyncContext context = request.startAsync();

ServletInputStream input = request.getInputStream();

input.setReadListener(new MyReadListener(input, context)); !

#DV13-UniJavaEE7

@arungupta @agoncal
Protocol Upgrade
New interface	


•  T
• 

extends HttpUpgradeHandler T
HttpServletRequest.upgrade(ClassT class)
throws IOException;
HttpUpgradeHandler

•  init(WebConnection
•  destroy();

#DV13-UniJavaEE7

wc);

@arungupta @agoncal
Protocol Upgrade
New interface	


public interface WebConnection {

ServletInputStream getInputStream();

ServletOutputStream getOutputStream();

}!

#DV13-UniJavaEE7

@arungupta @agoncal
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-methodGET/http-method

/web-resource-collection

/web-app !
!

#DV13-UniJavaEE7

@arungupta @agoncal
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-methodGET/http-method

/web-resource-collection

/web-app !

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Web Socket 1.0 (JSR 356)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Annotated server endpoint

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);!
}

}

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Lifecycle callbacks
Connection lifecycle	


@javax.websocket.OnOpen

public void open(Session s) { . . . }



@javax.websocket.OnClose

public void close(CloseReason c) { . . . }



@javax.websocket.OnError

public void error(Throwable t) { . . . }!

#DV13-UniJavaEE7

@arungupta @agoncal
Annotated client endpoint

Full-duplex bi-directional communication over single TCP connection	

@javax.websocket.ClientEndpoint

public class MyClient {

@javax.websocket.OnOpen

public void open(Session session) { … }



// Lifecycle callbacks

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Annotated client endpoint

Full-duplex bi-directional communication over single TCP connection	

ContainerProvider

.getWebSocketContainer()

.connectToServer(

MyClient.class, 

URI.create(ws://. . .));!
!

#DV13-UniJavaEE7

@arungupta @agoncal
Programmatic endpoints
API of rendpoints	


public class ChatServer extends Endpoint {

@Override

public void onOpen(Session s, EndpointConfig ec) {

s.addMessageHandler(new MessageHandler.WholeString() {

public void onMessage(String text) { . . . }

}

}



@Override

public void onClose(Session s, CloseReason cr) { . . . }



//. . . 

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Programmatic endpoints
API of rendpoints	


public class MyApplicationConfig implements
ServerApplicationConfig {

public SetServerEndpointConfig getEndpointConfigs(…) {
ServerEndpointConfig.Builder

.create(MyEndpoint.class, /websocket”)

.configurator(new MyConfig())

.build()

}

}!

#DV13-UniJavaEE7




@arungupta @agoncal
Programmatic endpoints
API of rendpoints	


public class MyConfig extends ServerEndpointConfig.Configurator{



public T T getEndpointInstance(. . .) { . . . }



public void modifyHandshake(. . .) { . . . }



. . .

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Encoder and Decoder
Encodes and decodes messages	


@javax.websocket.server.ServerEndpoint(

value=/chat,

decoders=MyDecoder.class,

encoders=MyEncoder.class)

public class ChatServer {



@OnMessage

public String chat(ChatMessage name, Session session) {

. . . 

}

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Encoder and Decoder
Encodes and decodes messages	


public class MyDecoder implements Decoder.TextChatMessage {

public ChatMessage decode(String s) {

// . . .

}



public boolean willDecode(String string) {

// . . .

}



//. . .

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Encoder and Decoder
Encodes and decodes messages	


public class MyEncoder implements Encoder.TextChatMessage {



public String encode(ChatMessage chatMessage) {

// . . .

}

!
// . . .

}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Expression Language 3.0 (JSR 341)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
ELProcessor

Use EL in a stand-alone environment	

ELProcessor el = new ELProcessor();!
!
assert ((Integer)el.eval(a = [1, 2]; a[1])) == 2;!
!
el.defineBean(employee, new Employee(John));!
assert (el.eval(employee.name)).equals(John);!
!

#DV13-UniJavaEE7

@arungupta @agoncal
Lambda expression
Use lambdas before Java SE 8	


ELProcessor el = new ELProcessor();!
!
assert ((Integer)(el.eval(((x,y) - x+y)(4, 5)))) == 9;!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JSF 2.2 (JSR 344)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
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!

#DV13-UniJavaEE7

@arungupta @agoncal
Faces Flow
Use annotations	


Named

@FlowScoped(flow1)

public class Flow1Bean implements Serializable {

}!
!
@Produces @FlowDefinition

public Flow defineFlow(@FlowBuilderParameter FlowBuilder fb) {

String flowId = flow1;

//. . .

return fb.getFlow();

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Faces Flow
Use flows in EL	


#{flowScope}: Local flow storage



#{facesContext.application.flowHandler.currentFlow}: Returns !
true if within a flow!

#DV13-UniJavaEE7

@arungupta @agoncal
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!

#DV13-UniJavaEE7

@arungupta @agoncal
Resource Library Contract

Apply templates in a reusable and interchangeable manner	

f:view contracts=”red”

ui:composition template=/template.xhtml

. . .

/ui:composition

/f:view

!

#DV13-UniJavaEE7

@arungupta @agoncal
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/!

#DV13-UniJavaEE7

@arungupta @agoncal
File Upload Component
Upload files	


h:form enctype=multipart/form-data

h:inputFile value=#{fileUploadBean.file}/

h:commandButton value=Upload/

/h:form !
!
!
@Named @RequestScoped 

public class FileUploadBean {

private Part file;



//getter and setter

} !
!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JAX-RS 2.0 (JSR 339)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Client API

New API to consume rest services	

Client client = ClientBuilder.newClient();!
WebTarget target = client.target(http://www.foo.com/book);!
Invocation invocation = target.request(TEXT_PLAIN).get();!
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);!

#DV13-UniJavaEE7

@arungupta @agoncal
Async client

The client API also supports asynchronous invocation	

FutureString future = ClientBuilder.newClient()!
.target(http://www.foo.com/book)!
.request()!
.async()!
.get(String.class);!
!
try {!
String body = future.get(1, TimeUnit.MINUTES);!
} catch (InterruptedException |ExecutionException e){!
...!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Async server

Asynchronous request processing on the server	

@Path(/async)!
public class AsyncResource {!
!
@GET!
public void asyncGet(@Suspended AsyncResponse resp){!
!
new Thread(new Runnable() {!
!
public void run() {!
String result = veryExpensiveOperation();!
resp.resume(result);!
}!
}).start();!
}}!

#DV13-UniJavaEE7

@arungupta @agoncal
Message Filter

Process incoming/outgoing request/response headers	


•  Filters on client side	


•  javax.ws.rs.client.ClientRequestFilter
•  javax.ws.rs.client.ClientResponseFilter

•  Filters on server side	


•  javax.ws.rs.container.ContainerRequestFilter
•  javax.ws.rs.container.ContainerResponseFilter

#DV13-UniJavaEE7

@arungupta @agoncal
Message Filter

Process incoming/outgoing request/response headers	

public class LogginFilter implements ClientRequestFilter{!
!
public void filter(ClientRequestContext ctx) ... {!
System.out.println(ctx.getMethod());!
System.out.println(ctx.getUri());!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Entity Interceptors

Marshalling and unmarshalling HTTP message bodies	


•  Intercepts inbound stream (read from the “wire”)	

•  javax.ws.rs.ext.ReaderInterceptor

•  Intercepts outbound stream (written to the “wire”)	

•  javax.ws.rs.ext.WriterInterceptor

#DV13-UniJavaEE7

@arungupta @agoncal
Entity Interceptors

Marshalling and unmarshalling HTTP message bodies	

public class ZipInterceptor implements WriterInterceptor{!
!
public void aroundWriteTo(WriterInterceptorContext ctx){!
OutputStream os = ctx.getOutputStream();!
ctx.setOutputStream(new GZIPOutputStream(os));!
ctx.proceed();!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JSON-P 1.0 (JSR 353)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
JSON Builder

Builds an object model 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();!

#DV13-UniJavaEE7

@arungupta @agoncal
JSON Parser

Event-based parser reading 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();!
}!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Batch 1.0 (JSR 352)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Chunk-style Processing
Item-oriented Processing Style (primary)	


#DV13-UniJavaEE7

@arungupta @agoncal
Chunk-style Processing
Item-oriented Processing Style (primary)	


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!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Batchlet-style Processing
Task-oriented processing style	


step id=”transferFile”!
batchlet ref=“MyFileTransfer” /!
/step!

…implements Batchlet {!
@Override

public void process() {

// Transfer file!
}!

#DV13-UniJavaEE7

@arungupta @agoncal
Job/Step/Chunk Listeners
Listeners	


job id=myJob xmlns=http://xmlns.jcp.org/xml/ns/javaee ...

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!
!
#DV13-UniJavaEE7
@arungupta @agoncal
Job/Step/Chunk Listeners
Listeners	


Interface	


Abstract Classes	


JobListener!

AbstractJobListener!

StepListener!

AbstractStepListener!

ChunkListener!

AbstractChunkListener!

ItemRead/Write/ProcessListener!

AbstractItemRead/Write/ProcessListener!

SkipRead/Write/ProcessListener!

AbstractSkipRead/Write/ProcessListener!

RetryRead/Write/ProcessListener!

AbstractRetryRead/Write/ProcessListener!

#DV13-UniJavaEE7

@arungupta @agoncal
Job/Step/Chunk Listeners
Listeners	


@Named

public class MyJobListener extends AbstractJobListener {



@Override

public void beforeJob() throws Exception { . . . }



@Override

public void afterJob() throws Exception { . . . }

}!

#DV13-UniJavaEE7

@arungupta @agoncal
Partition
Partitioning	


step

chunk item-count=3

reader ref=myItemReader

properties

property name=start value=#{partitionPlan['start']}/

property name=end value=#{partitionPlan['end']}/

/properties


/reader

. . .

/chunk!

#DV13-UniJavaEE7

@arungupta @agoncal
Partition
Partitioning	


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!

#DV13-UniJavaEE7

@arungupta @agoncal
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!

#DV13-UniJavaEE7

@arungupta @agoncal
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!

#DV13-UniJavaEE7

@arungupta @agoncal
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!
} !
}!
!
#DV13-UniJavaEE7
@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JavaMail 1.5 (JSR 919)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
MailSessionDefinition

A mail session can be defined using an annotation	

@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;!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


JCA 1.7 (JSR 322)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Connector definition

A connector can be defined using an annotation	

@ConnectionDefinition(!
connection=MyConnection.class,!
connectionImpl=MyConnectionImpl.class,!
connectionFactory=MyConnectionFactory.class,!
connectionFactoryImpl=MyConnectionFactoryImpl.class!
)!
!
@AdministeredObjectDefinition(!
className=MyQueueImpl.class,!
name=java:comp/MyQueue,!
resourceAdapter=myAdapter,!
)!

#DV13-UniJavaEE7

@arungupta @agoncal
CDI 1.1	

Bean Validation 1.1	

Interceptors 1.2	

Concurrency 1.0	


Java EE 7 (JSR 342)
JSP JSTL	


EL 3.0	


Servlet 3.1	

JTA 1.2	


JSF 2.2	


Web Socket 1.0	


EJB 3.2	

JPA 2.1	


JMS 2.0	


JAX-RS 2.0	

JSON-P 1.0	

Batch 1.0	

JavaMail 1.5	

JCA 1.7	


Java EE 7	


#DV13-UniJavaEE7

@arungupta @agoncal
Default Resources
Default datasource	


@Resource(lookup=java:comp/DefaultDataSource)!
private DataSource myDS;!
!
@Resource!
private DataSource myDS; !

#DV13-UniJavaEE7

@arungupta @agoncal
Default Resources

Default JMS factory	

	

 @Resource(lookup=java:comp/DefaultJMSConnectionFactory)

!

private ConnectionFactory myCF; !
!
@Resource!
private ConnectionFactory myCF;!

#DV13-UniJavaEE7

@arungupta @agoncal
Default Resources

Default Concurrency Utilities objects	

@Resource(lookup=java:comp/DefaultManagedExecutorService) !
private ManagedExecutorService mes; !
@Resource(lookup=java:comp/DefaultManagedScheduledExecutorService) !
private ManagedScheduledExecutorService mses; !
@Resource(lookup=java:comp/DefaultManagedThreadFactory) !
private ManagedThreadFactory mtf; !
@Resource(lookup=java:comp/DefaultContextService) !
private ContextService cs; !
!
@Resource!
private ManagedExecutorService mes; !
@Resource!
private ManagedScheduledExecutorService mses; !
@Resource!
private ManagedThreadFactory mtf; !
@Resource!
private ContextService cs; !

#DV13-UniJavaEE7

@arungupta @agoncal
New namespaces
Bye bye Sun	


persistence xmlns=http://xmlns.jcp.org/xml/ns/persistence!
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance!
xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/persistence !
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd!
version=2.1!
!
web-app xmlns=http://xmlns.jcp.org/xml/ns/javaee!
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance!
xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/javaee !
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd!
version=3.1!
!

#DV13-UniJavaEE7

@arungupta @agoncal
Buy our books!

#DV13-UniJavaEE7

@arungupta @agoncal
Q/A
#DV13-UniJavaEE7

@arungupta @agoncal
Thank you
Arun Gupta
Antonio Goncalves

#DV13-UniJavaEE7

@arungupta @agoncal

Contenu connexe

Tendances

5050 dev nation
5050 dev nation5050 dev nation
5050 dev nationArun Gupta
 
Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5IndicThreads
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGArun Gupta
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
Spring 4 final xtr_presentation
Spring 4 final xtr_presentationSpring 4 final xtr_presentation
Spring 4 final xtr_presentationsourabh aggarwal
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Hamed Hatami
 
Spring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationsourabh aggarwal
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013Jagadish Prasath
 
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionTo inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionAntonio Goncalves
 
Java EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise SystemsJava EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise SystemsHirofumi Iwasaki
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5Arun Gupta
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8javafxpert
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)Hendrik Ebbers
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXIMC Institute
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능knight1128
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsIMC Institute
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introductionejlp12
 

Tendances (20)

5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
 
Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5Indic threads pune12-java ee 7 platformsimplification html5
Indic threads pune12-java ee 7 platformsimplification html5
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Java EE 7 overview
Java EE 7 overviewJava EE 7 overview
Java EE 7 overview
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Spring 4 final xtr_presentation
Spring 4 final xtr_presentationSpring 4 final xtr_presentation
Spring 4 final xtr_presentation
 
Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)Java EE 7 (Hamed Hatami)
Java EE 7 (Hamed Hatami)
 
Spring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentation
 
What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013What's new in JMS 2.0 - OTN Bangalore 2013
What's new in JMS 2.0 - OTN Bangalore 2013
 
To inject or not to inject: CDI is the question
To inject or not to inject: CDI is the questionTo inject or not to inject: CDI is the question
To inject or not to inject: CDI is the question
 
Java EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise SystemsJava EE 7 for Real Enterprise Systems
Java EE 7 for Real Enterprise Systems
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5
 
What's New in Java 8
What's New in Java 8What's New in Java 8
What's New in Java 8
 
DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)DataFX 8 (JavaOne 2014)
DataFX 8 (JavaOne 2014)
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 

Similaire à Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013

50 features of Java EE 7 in 50 minutes at JavaZone 2014
50 features of Java EE 7 in 50 minutes at JavaZone 201450 features of Java EE 7 in 50 minutes at JavaZone 2014
50 features of Java EE 7 in 50 minutes at JavaZone 2014Arun Gupta
 
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 201450 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014Arun Gupta
 
50 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 201450 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 2014Arun 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
 
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
 
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
 
Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationPeter Lehto
 
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 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
 
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.
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Skills Matter
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Arun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Arun Gupta
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Arun Gupta
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 

Similaire à Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013 (20)

50 features of Java EE 7 in 50 minutes at JavaZone 2014
50 features of Java EE 7 in 50 minutes at JavaZone 201450 features of Java EE 7 in 50 minutes at JavaZone 2014
50 features of Java EE 7 in 50 minutes at JavaZone 2014
 
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 201450 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
 
50 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 201450 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 2014
 
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
 
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?
 
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)
 
Vaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integrationVaadin 7 - Java Enterprise Edition integration
Vaadin 7 - Java Enterprise Edition integration
 
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
 
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
 
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
 
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
 
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3 Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ JAX London ...
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
 
Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010Deep Dive Hands-on in Java EE 6 - Oredev 2010
Deep Dive Hands-on in Java EE 6 - Oredev 2010
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 

Plus de 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
 
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
 
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
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!Arun 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
 

Plus de Arun Gupta (20)

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
 
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
 
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
 
Thanks Managers!
Thanks Managers!Thanks Managers!
Thanks Managers!
 
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
 

Dernier

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
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
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Dernier (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
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
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
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
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013

  • 1. Java EE 7 : What’s new in the Java EE Platform Arun Gupta Antonio Goncalves #DV13-UniJavaEE7 @arungupta @agoncal
  • 2. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 3. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 CDI 1.1 (JSR 346) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 4. 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>! #DV13-UniJavaEE7 @arungupta @agoncal
  • 5. @Vetoed Veto the processing of the class or package @Vetoed! public class NonProcessedBean {
 ...! }! ! package-info.java! @Vetoed! package com.non.processed.package;! #DV13-UniJavaEE7 @arungupta @agoncal
  • 6. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Bean Validation 1.1 (JSR 349) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 7. 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());! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 8. CDI in validators Injection in validators is now possible public class ZipCodeValidator implements! ConstraintValidator<ZipCode, String> {! ! @Inject @USA! ZipCodeChecker checker = new ZipCodeChecker();! ! public boolean isValid(String value,! ConstraintValidatorContext context) {! ! return checker.isZipCodeValid(value);! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 9. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Interceptors 1.2 (JSR 318) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 10. AroundConstruct Interceptor associated with a constructor public class LoggingInterceptor {! ! @AroundConstruct! private void init(InvocationContext ic) throws Exception{! logger.fine("Entering constructor");! ic.proceed();! logger.fine("Exiting constructor");! }! ! @AroundInvoke! public Object logMethod(InvocationContext ic) ... {! // ...! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 11. @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! ...! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 12. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Concurrency utilities 1.0 (JSR 236) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 13. ManagedExecutor Threads in Java EE •  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 #DV13-UniJavaEE7 package @arungupta @agoncal
  • 14. ManagedExecutor Default ManagedExectuor @Resource
 ManagedExecutorService executor;
 ! 
 ManagedExecutorService executor = (ManagedExecutorService) ! ctx.lookup("java:comp/DefaultManagedExecutorService");! #DV13-UniJavaEE7 @arungupta @agoncal
  • 15. 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>! #DV13-UniJavaEE7 @arungupta @agoncal
  • 16. ManagedScheduledExecutor Thread Scheduler in Java EE •  Managed version of ScheduledExecutorService •  Submit delayed or periodic tasks @Resource
 ManagedScheduledExecutorService executor;! #DV13-UniJavaEE7 @arungupta @agoncal
  • 17. ManagedScheduledExecutor Access using JNDI •  Can be defined in web.xml as well InitialContext ctx = new InitialContext(); 
 
 ManagedScheduledExecutorService executor = (ManagedScheduledExecutorService)ctx.lookup(
 "java:comp/DefaultManagedScheduledExecutorService");
 ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 18. ManagedScheduledExecutor Samples executor.schedule(new MyCallableTask(), 5, TimeUnit.SECONDS);! ! executor.scheduleAtFixedRate(new MyRunnableTask(), 2, 3,! TimeUnit.SECONDS);! ! executor.scheduleWithFixedDelay(new MyRunnableTask(), 2, 3,! TimeUnit.SECONDS);! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 19. ManagedThreadFactory Extends ThreadFactory @Resource(name = DefaultManagedThreadFactory)
 ManagedThreadFactory factory; ManagedThreadFactory factory = (ManagedThreadFactory) ctx.lookup(java:comp/DefaultManagedThreadFactory);
 ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 20. ManagedThreadFactory Extends ThreadFactory Thread thread = factory.newThread(new MyTask());
 
 ! ((ManageableThread)thread).isShutdown();
 
 ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 21. DynamicProxy Dynamic proxies •  Create dynamic proxy objects, adds contextual information •  available for applications running in Java EE environment Classloading, JNDI, Security, … #DV13-UniJavaEE7 @arungupta @agoncal
  • 22. DynamicProxy Create contextual proxies @Resource
 ContextService service;
 
 
 Runnable proxy = service.createContextualProxy(! new MyRunnable(), Runnable.class);
 
 
 Future f = executor.submit(proxy);! #DV13-UniJavaEE7 @arungupta @agoncal
  • 23. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JPA 2.1 (JSR 338) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 24. 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 25. @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;! ...! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 26. Unsynchronized Persistence Context Persistence context not enlisted in any tx unless explicitly joined @PersistenceContext(synchronization =! SynchronizationType.UNSYNCHRONIZED)! private EntityManager em;! ...! ! em.persist(book);! ! ...! em.joinTransaction();! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 27. 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 {...}! #DV13-UniJavaEE7 @arungupta @agoncal
  • 28. CDI in listeners Injection is now possible into event listeners public class AgeCalculationListener {! ! @Inject! private AgeCalculator ageCalculator;! ! @PostLoad! @PostPersist! @PostUpdate! public void calculateAge(Customer c) {! customer.setAge(ageCalculator.calc(c.getBirth));! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 29. Converters Classes that convert between database and attributes @Converter! public class CreditCardEnumConverter implements! AttributeConverterCreditCard, String {! ! public String convertToDatabaseColumn(CreditCard attr) {...}! public CreditCard convertToEntityAttribute(String data){...}! }! ! @Entity! public class Order {! ! @Convert(converter = CreditCardEnumConverter.class)! private CreditCard creditCard;! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 30. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JTA 1.2 (JSR 907) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 31. @Transactional TX 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) {...}! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 32. @TransactionScoped CDI scope whose lifecycle is scoped to the currently active JTA tx @TransactionScoped! public class BookBean {...}! ! @WebServlet! public class TxServlet extends HttpServlet {! @Inject UserTransaction tx;! @Inject BookBean b1;! @Inject BookBean b2;! ! protected void processRequest(...) {! tx.begin();! s_out.println(b1.getReference());! s_out.println(b2.getReference());! tx.commit(); }}! #DV13-UniJavaEE7 @arungupta @agoncal
  • 33. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 EJB 3.2 (JSR 345) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 34. Disable passivation of stateful In some cases increases performance, scalability and robustness @Stateful(passivationCapable = false)! public class ShoppingCart {! ...! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 35. EJB-Lite: Async + Non-persistent timer EJB Lite includes async invocations and non-persistent EJB Timer @Stateless! public class OrderEJB {! ! @Asynchronous! public void sendEmail (Order order) {! // Very Long task! }! ! @Schedule(hour=2, persistent=false)! public void createDailyReport() {! // ...! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 36. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JMS 2.0 (JSR 343) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 37. 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);! #DV13-UniJavaEE7 @arungupta @agoncal
  • 38. Runtime Exceptions A set of new unchecked exceptions have been created RuntimeException! JMSRuntimeException! IllegalStateRuntimeException! InvalidClientIDRuntimeException! InvalidDestinationRuntimeException! InvalidSelectorRuntimeException! JMSSecurityRuntimeException! MessageFormatRuntimeException! MessageNotWriteableRuntimeException! ResourceAllocationRuntimeException! TransactionInProgressRuntimeException! TransactionRolledBackRuntimeException! #DV13-UniJavaEE7 @arungupta @agoncal
  • 39. 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(q).receiveBody(String.class);! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 40. JMSConnectionFactoryDefinition ConnectionFactory can be defined using an annotation @Stateless! @JMSConnectionFactoryDefinition(! name = java:app/jms/MyConnectionFactory,! interfaceName = javax.jms.TopicConnectionFactory)! ! ! ! public class ExpensiveOrderEJB {...}! #DV13-UniJavaEE7 @arungupta @agoncal
  • 41. JMSDestinationDefinition A JMS queue or topic can be defined using an annotation @Stateless! @JMSConnectionFactoryDefinition(! name = java:app/jms/MyConnectionFactory,! interfaceName = javax.jms.TopicConnectionFactory)! @JMSDestinationDefinition(! name = java:app/jms/MyTopic,! interfaceName = javax.jms.Topic)! public class ExpensiveOrderEJB {...}! #DV13-UniJavaEE7 @arungupta @agoncal
  • 42. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Servlet 3.1 (JSR 340) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 43. Non-blocking I/O Non-blocking I/O in Servlets 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) {
 . . .
 }
 }
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 44. Non-blocking I/O New methods to existing interfaces •  ServletInputStream •  public •  public •  public void setReadListener(ReadListener l); boolean isFinished(); boolean isReady(); •  public •  public setWriteListener(WriteListener l); boolean canWrite(); •  ServletOutputStream #DV13-UniJavaEE7 @arungupta @agoncal
  • 45. Non-blocking I/O New interfaces public interface ReadListener extends EventListener {
 public void onDataAvailable();
 public void onAllDataRead();
 public void onError();
 }! public interface WriteListener extends EventListener {
 public void onWritePossible();
 public void onError();
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 46. Non-blocking I/O Only for Asynchronous Servlets AsyncContext context = request.startAsync();
 ServletInputStream input = request.getInputStream();
 input.setReadListener(new MyReadListener(input, context)); ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 47. Protocol Upgrade New interface •  T •  extends HttpUpgradeHandler T HttpServletRequest.upgrade(ClassT class) throws IOException; HttpUpgradeHandler •  init(WebConnection •  destroy(); #DV13-UniJavaEE7 wc); @arungupta @agoncal
  • 48. Protocol Upgrade New interface public interface WebConnection {
 ServletInputStream getInputStream();
 ServletOutputStream getOutputStream();
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 49. 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-methodGET/http-method
 /web-resource-collection
 /web-app ! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 50. 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-methodGET/http-method
 /web-resource-collection
 /web-app ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 51. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Web Socket 1.0 (JSR 356) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 52. Annotated server endpoint 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);! }
 }
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 53. Lifecycle callbacks Connection lifecycle @javax.websocket.OnOpen
 public void open(Session s) { . . . }
 
 @javax.websocket.OnClose
 public void close(CloseReason c) { . . . }
 
 @javax.websocket.OnError
 public void error(Throwable t) { . . . }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 54. Annotated client endpoint Full-duplex bi-directional communication over single TCP connection @javax.websocket.ClientEndpoint
 public class MyClient {
 @javax.websocket.OnOpen
 public void open(Session session) { … }
 
 // Lifecycle callbacks
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 55. Annotated client endpoint Full-duplex bi-directional communication over single TCP connection ContainerProvider
 .getWebSocketContainer()
 .connectToServer(
 MyClient.class, 
 URI.create(ws://. . .));! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 56. Programmatic endpoints API of rendpoints public class ChatServer extends Endpoint {
 @Override
 public void onOpen(Session s, EndpointConfig ec) {
 s.addMessageHandler(new MessageHandler.WholeString() {
 public void onMessage(String text) { . . . }
 }
 }
 
 @Override
 public void onClose(Session s, CloseReason cr) { . . . }
 
 //. . . 
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 57. Programmatic endpoints API of rendpoints public class MyApplicationConfig implements ServerApplicationConfig {
 public SetServerEndpointConfig getEndpointConfigs(…) { ServerEndpointConfig.Builder
 .create(MyEndpoint.class, /websocket”)
 .configurator(new MyConfig())
 .build()
 }
 }! #DV13-UniJavaEE7 
 @arungupta @agoncal
  • 58. Programmatic endpoints API of rendpoints public class MyConfig extends ServerEndpointConfig.Configurator{
 
 public T T getEndpointInstance(. . .) { . . . }
 
 public void modifyHandshake(. . .) { . . . }
 
 . . .
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 59. Encoder and Decoder Encodes and decodes messages @javax.websocket.server.ServerEndpoint(
 value=/chat,
 decoders=MyDecoder.class,
 encoders=MyEncoder.class)
 public class ChatServer {
 
 @OnMessage
 public String chat(ChatMessage name, Session session) {
 . . . 
 }
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 60. Encoder and Decoder Encodes and decodes messages public class MyDecoder implements Decoder.TextChatMessage {
 public ChatMessage decode(String s) {
 // . . .
 }
 
 public boolean willDecode(String string) {
 // . . .
 }
 
 //. . .
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 61. Encoder and Decoder Encodes and decodes messages public class MyEncoder implements Encoder.TextChatMessage {
 
 public String encode(ChatMessage chatMessage) {
 // . . .
 }
 ! // . . .
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 62. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Expression Language 3.0 (JSR 341) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 63. ELProcessor Use EL in a stand-alone environment ELProcessor el = new ELProcessor();! ! assert ((Integer)el.eval(a = [1, 2]; a[1])) == 2;! ! el.defineBean(employee, new Employee(John));! assert (el.eval(employee.name)).equals(John);! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 64. Lambda expression Use lambdas before Java SE 8 ELProcessor el = new ELProcessor();! ! assert ((Integer)(el.eval(((x,y) - x+y)(4, 5)))) == 9;! #DV13-UniJavaEE7 @arungupta @agoncal
  • 65. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JSF 2.2 (JSR 344) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 66. 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 67. Faces Flow Use annotations Named
 @FlowScoped(flow1)
 public class Flow1Bean implements Serializable {
 }! ! @Produces @FlowDefinition
 public Flow defineFlow(@FlowBuilderParameter FlowBuilder fb) {
 String flowId = flow1;
 //. . .
 return fb.getFlow();
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 68. Faces Flow Use flows in EL #{flowScope}: Local flow storage
 
 #{facesContext.application.flowHandler.currentFlow}: Returns ! true if within a flow! #DV13-UniJavaEE7 @arungupta @agoncal
  • 69. 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 70. Resource Library Contract Apply templates in a reusable and interchangeable manner f:view contracts=”red”
 ui:composition template=/template.xhtml
 . . .
 /ui:composition
 /f:view
 ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 71. 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/! #DV13-UniJavaEE7 @arungupta @agoncal
  • 72. File Upload Component Upload files h:form enctype=multipart/form-data
 h:inputFile value=#{fileUploadBean.file}/
 h:commandButton value=Upload/
 /h:form ! ! ! @Named @RequestScoped 
 public class FileUploadBean {
 private Part file;
 
 //getter and setter
 } ! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 73. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JAX-RS 2.0 (JSR 339) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 74. Client API New API to consume rest services Client client = ClientBuilder.newClient();! WebTarget target = client.target(http://www.foo.com/book);! Invocation invocation = target.request(TEXT_PLAIN).get();! 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);! #DV13-UniJavaEE7 @arungupta @agoncal
  • 75. Async client The client API also supports asynchronous invocation FutureString future = ClientBuilder.newClient()! .target(http://www.foo.com/book)! .request()! .async()! .get(String.class);! ! try {! String body = future.get(1, TimeUnit.MINUTES);! } catch (InterruptedException |ExecutionException e){! ...! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 76. Async server Asynchronous request processing on the server @Path(/async)! public class AsyncResource {! ! @GET! public void asyncGet(@Suspended AsyncResponse resp){! ! new Thread(new Runnable() {! ! public void run() {! String result = veryExpensiveOperation();! resp.resume(result);! }! }).start();! }}! #DV13-UniJavaEE7 @arungupta @agoncal
  • 77. Message Filter Process incoming/outgoing request/response headers •  Filters on client side •  javax.ws.rs.client.ClientRequestFilter •  javax.ws.rs.client.ClientResponseFilter •  Filters on server side •  javax.ws.rs.container.ContainerRequestFilter •  javax.ws.rs.container.ContainerResponseFilter #DV13-UniJavaEE7 @arungupta @agoncal
  • 78. Message Filter Process incoming/outgoing request/response headers public class LogginFilter implements ClientRequestFilter{! ! public void filter(ClientRequestContext ctx) ... {! System.out.println(ctx.getMethod());! System.out.println(ctx.getUri());! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 79. Entity Interceptors Marshalling and unmarshalling HTTP message bodies •  Intercepts inbound stream (read from the “wire”) •  javax.ws.rs.ext.ReaderInterceptor •  Intercepts outbound stream (written to the “wire”) •  javax.ws.rs.ext.WriterInterceptor #DV13-UniJavaEE7 @arungupta @agoncal
  • 80. Entity Interceptors Marshalling and unmarshalling HTTP message bodies public class ZipInterceptor implements WriterInterceptor{! ! public void aroundWriteTo(WriterInterceptorContext ctx){! OutputStream os = ctx.getOutputStream();! ctx.setOutputStream(new GZIPOutputStream(os));! ctx.proceed();! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 81. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JSON-P 1.0 (JSR 353) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 82. JSON Builder Builds an object model 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();! #DV13-UniJavaEE7 @arungupta @agoncal
  • 83. JSON Parser Event-based parser reading 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();! }! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 84. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Batch 1.0 (JSR 352) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 85. Chunk-style Processing Item-oriented Processing Style (primary) #DV13-UniJavaEE7 @arungupta @agoncal
  • 86. Chunk-style Processing Item-oriented Processing Style (primary) 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! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 87. Batchlet-style Processing Task-oriented processing style step id=”transferFile”! batchlet ref=“MyFileTransfer” /! /step! …implements Batchlet {! @Override
 public void process() {
 // Transfer file! }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 88. Job/Step/Chunk Listeners Listeners job id=myJob xmlns=http://xmlns.jcp.org/xml/ns/javaee ...
 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! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 90. Job/Step/Chunk Listeners Listeners @Named
 public class MyJobListener extends AbstractJobListener {
 
 @Override
 public void beforeJob() throws Exception { . . . }
 
 @Override
 public void afterJob() throws Exception { . . . }
 }! #DV13-UniJavaEE7 @arungupta @agoncal
  • 91. Partition Partitioning step
 chunk item-count=3
 reader ref=myItemReader
 properties
 property name=start value=#{partitionPlan['start']}/
 property name=end value=#{partitionPlan['end']}/
 /properties 
 /reader
 . . .
 /chunk! #DV13-UniJavaEE7 @arungupta @agoncal
  • 92. Partition Partitioning 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 93. 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 94. 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! #DV13-UniJavaEE7 @arungupta @agoncal
  • 95. 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! } ! }! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 96. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JavaMail 1.5 (JSR 919) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 97. MailSessionDefinition A mail session can be defined using an annotation @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;! #DV13-UniJavaEE7 @arungupta @agoncal
  • 98. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 JCA 1.7 (JSR 322) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 99. Connector definition A connector can be defined using an annotation @ConnectionDefinition(! connection=MyConnection.class,! connectionImpl=MyConnectionImpl.class,! connectionFactory=MyConnectionFactory.class,! connectionFactoryImpl=MyConnectionFactoryImpl.class! )! ! @AdministeredObjectDefinition(! className=MyQueueImpl.class,! name=java:comp/MyQueue,! resourceAdapter=myAdapter,! )! #DV13-UniJavaEE7 @arungupta @agoncal
  • 100. CDI 1.1 Bean Validation 1.1 Interceptors 1.2 Concurrency 1.0 Java EE 7 (JSR 342) JSP JSTL EL 3.0 Servlet 3.1 JTA 1.2 JSF 2.2 Web Socket 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JAX-RS 2.0 JSON-P 1.0 Batch 1.0 JavaMail 1.5 JCA 1.7 Java EE 7 #DV13-UniJavaEE7 @arungupta @agoncal
  • 101. Default Resources Default datasource @Resource(lookup=java:comp/DefaultDataSource)! private DataSource myDS;! ! @Resource! private DataSource myDS; ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 102. Default Resources Default JMS factory @Resource(lookup=java:comp/DefaultJMSConnectionFactory) ! private ConnectionFactory myCF; ! ! @Resource! private ConnectionFactory myCF;! #DV13-UniJavaEE7 @arungupta @agoncal
  • 103. Default Resources Default Concurrency Utilities objects @Resource(lookup=java:comp/DefaultManagedExecutorService) ! private ManagedExecutorService mes; ! @Resource(lookup=java:comp/DefaultManagedScheduledExecutorService) ! private ManagedScheduledExecutorService mses; ! @Resource(lookup=java:comp/DefaultManagedThreadFactory) ! private ManagedThreadFactory mtf; ! @Resource(lookup=java:comp/DefaultContextService) ! private ContextService cs; ! ! @Resource! private ManagedExecutorService mes; ! @Resource! private ManagedScheduledExecutorService mses; ! @Resource! private ManagedThreadFactory mtf; ! @Resource! private ContextService cs; ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 104. New namespaces Bye bye Sun persistence xmlns=http://xmlns.jcp.org/xml/ns/persistence! xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance! xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/persistence ! http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd! version=2.1! ! web-app xmlns=http://xmlns.jcp.org/xml/ns/javaee! xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance! xsi:schemaLocation=http://xmlns.jcp.org/xml/ns/javaee ! http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd! version=3.1! ! #DV13-UniJavaEE7 @arungupta @agoncal
  • 107. Thank you Arun Gupta Antonio Goncalves #DV13-UniJavaEE7 @arungupta @agoncal