SlideShare uma empresa Scribd logo
1 de 103
Baixar para ler offline
@arungupta #javaee7 #devnation
@arungupta #javaee7 #devnation
50 new features
of
Java EE 7
in
50 minutes
Arun Gupta, @arungupta
@arungupta #javaee7 #devnation
#NN: <spec>: <feature>
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
CDI 1.1 (JSR 346)
@arungupta #javaee7 #devnation
#01: CDI: Default enabling
Finer scanning control
•  Possible values: all, annotated, none!
•  Annotated behaves like in Java EE 6 (default)!
<beans ... version="1.1" bean-discovery-mode="all">!
<alternatives>!
<class>org.agoncal.book.MockGenerator</class>!
</alternatives>!
</beans>!
@arungupta #javaee7 #devnation
#02: CDI: @Vetoed
Veto the processing of the class or package
@Vetoed!
public class NonProcessedBean {

...!
}!
!
package-info.java
@Vetoed!
package com.non.processed.package;!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Bean Validation 1.1 (JSR 349)
@arungupta #javaee7 #devnation
#03: Bean Validation: Method
validation
public class CardValidator {!
!
public CardValidator(@NotNull Algorithm algorithm) {!
this.algorithm = algorithm;!
}!
!
@AssertTrue!
public Boolean validate(@NotNull CreditCard creditCard) {!
return algorithm.validate(creditCard.getNumber());!
}!
}!
Pre/post conditions on method and constructors
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Interceptors 1.2 (JSR 318)
@arungupta #javaee7 #devnation
#04: Interceptors: 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) ... {!
// ...!
}!
}!
@arungupta #javaee7 #devnation
#05: Interceptors: @Priority
Prioritizing interceptor bindings
•  PLATFORM_BEFORE (0), LIBRARY_BEFORE (1000), APPLICATION
(2000), LIBRARY_AFTER (3000), PLATFORM_AFTER (4000)!
@Interceptor!
@Loggable!
@Priority(Interceptor.Priority.LIBRARY_BEFORE + 10)!
public class LoggingInterceptor {!
!
@AroundInvoke!
...!
}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Concurrency Utilities 1.0 (JSR 236)
@arungupta #javaee7 #devnation
#06: Concurrency: ManagedExecutor
•  User threads in Java EE applications
•  Support simple and advance concurrency design
patterns
•  Extend Concurrency Utilities API from Java SE (JSR
166y)
–  java.util.concurrent package
@arungupta #javaee7 #devnation
#06: Concurrency: ManagedExecutor
@Resource

ManagedExecutorService executor;

!


ManagedExecutorService executor =
(ManagedExecutorService) ctx

.lookup("java:comp/DefaultManagedExecutorService");!
Default ManagedExectuor
@arungupta #javaee7 #devnation
#06: Concurrency: ManagedExecutor
<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>!
Specify in web.xml
@arungupta #javaee7 #devnation
#07: Concurrency:
ManagedScheduledExecutor
•  Managed version of ScheduledExecutorService!
•  Submit delayed or periodic tasks
@Resource

ManagedScheduledExecutorService executor;!
@arungupta #javaee7 #devnation
#07: Concurrency:
ManagedScheduledExecutor
InitialContext ctx = new InitialContext(); 



ManagedScheduledExecutorService executor =
(ManagedScheduledExecutorService)ctx.lookup(

"java:comp/DefaultManagedScheduledExecutorService");

!
•  Can be defined in web.xml as well
Access using JNDI
@arungupta #javaee7 #devnation
#07: Concurrency:
ManagedScheduledExecutor
•  executor.schedule(new MyCallableTask(), 5,
TimeUnit.SECONDS);!
•  executor.scheduleAtFixedRate(new MyRunnableTask(),
2, 3, TimeUnit.SECONDS);!
•  executor.scheduleWithFixedDelay(new
MyRunnableTask(), 2, 3, TimeUnit.SECONDS);!
@arungupta #javaee7 #devnation
#08: Concurrency:
ManagedThreadFactory
•  Extends ThreadFactory
@Resource(name = "DefaultManagedThreadFactory")

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

@arungupta #javaee7 #devnation
#08: Concurrency:
ManagedThreadFactory
•  Thread thread = factory.newThread(new MyTask());
•  ((ManageableThread)thread).isShutdown();

@arungupta #javaee7 #devnation
#09: Concurrency: DynamicProxy
•  Create dynamic proxy objects, adds contextual
information available for applications running in Java EE
environment
•  Classloading, JNDI, Security, …
@arungupta #javaee7 #devnation
#09: Concurrency: DynamicProxy
@Resource

ContextService service;





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





Future f = executor.submit(proxy);!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JPA 2.1 (JSR 338)
@arungupta #javaee7 #devnation
#10: JPA: Schema Generation
Standardized database schema generation
<persistence ... version="2.1">!
<persistence-unit ...>!
<properties>!
<property name="javax.persistence.schema-generation.scripts.action"!
value="drop-and-create"/>!
<property name="javax.persistence.schema-generation.scripts.create-target"
value="create.sql"/>!
<property name="javax.persistence.sql-load-script-source" !
value="insert.sql"/>!
</properties>!
</persistence-unit>!
@arungupta #javaee7 #devnation
#11: JPA: @Index
Defines additional indexes in schema generation
@Entity!
@Table(indexes = {!
@Index(columnList = "ISBN"),!
@Index(columnList = "NBOFPAGE")!
})!
public class Book {!
!
@Id @GeneratedValue!
private Long id;!
private String isbn;!
private Integer nbOfPage;!
...!
}!
@arungupta #javaee7 #devnation
#12: JPA: Unsynchronized PC
Persistence context is not enlisted in any tx unless explicitly joined
@PersistenceContext(synchronization =!
SynchronizationType.UNSYNCHRONIZED)!
private EntityManager em;!
...!
!
em.persist(book);!
!
...!
em.joinTransaction();!
!
@arungupta #javaee7 #devnation
#13: JPA: Stored Procedure
Calling a stored procedure
@Entity!
@NamedStoredProcedureQuery(name = "archiveOldBooks", !
procedureName = "sp_archive_books",!
parameters = {!
@StoredProcedureParameter(name = ”date", mode = IN, !
type = Date.class),!
@StoredProcedureParameter(name = "warehouse", mode = IN, !
type = String.class)!
})!
public class Book {...}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JTA 1.2 (JSR 907)
@arungupta #javaee7 #devnation
#14: JTA: @Transactional
Transaction management on Managed Beans as CDI interceptor
binding
@Path("book")!
@Transactional(value = Transactional.TxType.REQUIRED,!
rollbackOn = {SQLException.class, JMSException.class},!
dontRollbackOn = SQLWarning.class)!
public class BookRestService {!
!
@PersistenceContext!
private EntityManager em;!
!
@POST!
@Consumes(MediaType.APPLICATION_XML)!
public Response createBook(Book book) {...}!
}!
@arungupta #javaee7 #devnation
#15: JTA: @TransactionScoped
CDI scope whose lifecycle is scoped to the currently active JTA
transaction
@TransactionScoped!
public class BookBean {...}!
!
@WebServlet!
public class TxServlet extends HttpServlet {!
@Inject 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();!
}!
}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
EJB 3.2 (JSR 345)
@arungupta #javaee7 #devnation
#16: EJB: Disable passivation of
stateful
@Stateful(passivationCapable = false)!
public class ShoppingCart {!
...!
}!
In some cases increases performance, scalability and robustness
@arungupta #javaee7 #devnation
#17: EJB-Lite: Async + Non-persistent
timer
@Stateless!
public class OrderEJB {!
!
@Asynchronous!
public void sendEmail (Order order) {!
// Very Long task!
}!
!
@Schedule(hour="2", persistent=false)!
public void createDailyReport() {!
// ...!
}!
}!
Extended the EJB Lite to include local asynchronous invocations and
non-persistent EJB Timer Service
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JMS 2.0 (JSR 343)
@arungupta #javaee7 #devnation
#18: JMS: JMSContext API
New simplified API to produce and consume messages
@Inject JMSContext ctx;!
!
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);!
@arungupta #javaee7 #devnation
#19: JMS: Autocloseable
Several JMS interfaces implement Autocloseable
try (JMSContext ctx = connectionFactory.createContext()) {!
ctx.createProducer().send(queue, "Text message sent");!
}!
!
...!
!
try (JMSContext ctx = connectionFactory.createContext()) {!
while (true) {!
String s = ctx.createConsumer(queue).receiveBody(String.class);!
}!
}!
@arungupta #javaee7 #devnation
#20: JMS:
JMSConnectionFactoryDefinition
@Stateless!
@JMSConnectionFactoryDefinition(!
name = "java:app/jms/MyConnectionFactory",!
interfaceName =
"javax.jms.TopicConnectionFactory")!
!
!
!
public class ExpensiveOrderEJB {...}!
A JMS ConnectionFactory can be defined using an annotation on a
container-managed class
@arungupta #javaee7 #devnation
#21: JMS: 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 {...}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Servlet 3.1 (JSR 340)
@arungupta #javaee7 #devnation
#22: Servlet: Non-blocking I/O
public class TestServlet extends HttpServlet

protected void doGet(HttpServletRequest request,

HttpServletResponse response) 

throws IOException, ServletException {

ServletInputStream input = request.getInputStream();

byte[] b = new byte[1024];

int len = -1;

while ((len = input.read(b)) != -1) {

. . .

}

}

}!
@arungupta #javaee7 #devnation
#22: Servlet: Non-blocking I/O
•  ServletInputStream!
–  public void setReadListener(ReadListener
listener);!
–  public boolean isFinished();!
–  public boolean isReady();!
•  ServletOutputStream!
–  public setWriteListener(WriteListener
listener);!
–  public boolean canWrite();!
New methods to existing interfaces
@arungupta #javaee7 #devnation
#22: Servlet: Non-blocking I/O
public interface ReadListener extends EventListener
{

public void onDataAvailable();

pubic void onAllDataRead();

public void onError();

}!
public interface WriteListener extends EventListener
{

public void onWritePossible();

public void onError();

}!
New interfaces
@arungupta #javaee7 #devnation
#22: Servlet: Non-blocking I/O
AsyncContext context = request.startAsync();

ServletInputStream input = request.getInputStream();

input.setReadListener(

new MyReadListener(input, context)); !
Only for Asynchronous Servlets
@arungupta #javaee7 #devnation
#23: Servlet: Protocol Upgrade
•  <T extends HttpUpgradeHandler> T
HttpServletRequest.upgrade(Class<T> class) throws
IOException;





!
•  HttpUpgradeHandler!
–  init(WebConnection wc);!
–  destroy();!
@arungupta #javaee7 #devnation
#23: Servlet: Protocol Upgrade
public interface WebConnection {

ServletInputStream getInputStream();

ServletOutputStream getOutputStream();

}!
@arungupta #javaee7 #devnation
#24: Servlet: Improved Security
<web-app . . . version="3.1"> 

<web-resource-collection>

<url-pattern>/account/*</url-pattern> 

<http-method>GET</http-method>

</web-resource-collection>

<auth-contraint>

. . .

</auth-contraint>

</web-app> !
!
Deny an HTTP method request for an uncovered HTTP method
@arungupta #javaee7 #devnation
#24: Servlet: Improved Security
<web-app . . . version="3.1"> 

<deny-uncovered-http-methods/>

<web-resource-collection>

<url-pattern>/account/*</url-pattern> 

<http-method>GET</http-method>

</web-resource-collection>

<auth-contraint>

. . .

</auth-contraint> 

</web-app> !
!
Deny an HTTP method request for an uncovered HTTP method
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Web Socket 1.0 (JSR 356)
@arungupta #javaee7 #devnation
#25: WebSocket: Annotated server
endpoint
•  Enables full-duplex bi-directional communication over
single TCP connection
@javax.websocket.server.ServerEndpoint("/chat")

public class ChatServer {



@OnMessage

public String chat(String name, Session session) {

for (Session peer : client.getOpenSessions()) {!
peer.getBasicRemote().sendObject(message);!
}

}

}!
@arungupta #javaee7 #devnation
#26: WebSocket: Lifecycle callbacks
@javax.websocket.OnOpen

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



@javax.websocket.OnClose

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



@javax.websocket.OnError

public void error(Throwable t) { . . . }!
@arungupta #javaee7 #devnation
#27: WebSocket: Annotated client
endpoint
@javax.websocket.ClientEndpoint

public class MyClient {

@javax.websocket.OnOpen

public void open(Session session) { … }



// Lifecycle callbacks

}!
@arungupta #javaee7 #devnation
#27: WebSocket: Annotated client
endpoint
ContainerProvider

.getWebSocketContainer()

.connectToServer(

MyClient.class, 

URI.create("ws://. . ."));!
@arungupta #javaee7 #devnation
#28: WebSocket: Programmatic
endpoints
public class ChatServer extends Endpoint {

@Override

public void onOpen(Session s, EndpointConfig ec) {

s.addMessageHandler(new MessageHandler.Whole<String>() {

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

}

}



@Override

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



//. . . 

}!
@arungupta #javaee7 #devnation
#28: WebSocket: Programmatic
endpoints
public class MyApplicationConfig implements
ServerApplicationConfig {

public Set<ServerEndpointConfig> getEndpointConfigs(…) { 

ServerEndpointConfig.Builder

.create(MyEndpoint.class, "/websocket”)

.configurator(new MyConfig())

.build()

}

}!
@arungupta #javaee7 #devnation
#28: WebSocket: Programmatic
endpoints
public class MyConfig extends ServerEndpointConfig.Configurator {



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



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



. . .

}!
@arungupta #javaee7 #devnation
#29: WebSocket: Encoder and
Decoder
@javax.websocket.server.ServerEndpoint(

value="/chat",

decoders="MyDecoder.class",

encoders="MyEncoder.class")

public class ChatServer {



@OnMessage

public String chat(ChatMessage name, Session session) {

. . . 

}

}!
@arungupta #javaee7 #devnation
#29: WebSocket: Encoder and
Decoder
public class MyDecoder implements Decoder.Text<ChatMessage> {

public ChatMessage decode(String s) {

// . . .

}



public boolean willDecode(String string) {

// . . .

}



//. . .

}



!
@arungupta #javaee7 #devnation
#29: WebSocket: Encoder and
Decoder
public class MyEncoder implements Encoder.Text<ChatMessage> {



public String encode(ChatMessage chatMessage) {

// . . .

}

!
// . . .

}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Expression Language 3.0 (JSR 341)
@arungupta #javaee7 #devnation
#30: Expression Langauge:
ELProcessor
•  Use EL in a stand-alone environment
–  Evaluate EL expressions
–  Defining a static method as an EL function
–  Defining an object instance as an EL name
ELProcessor elp = new ELProcessor();

elp.defineBean("employee", new Employee("Charlie
Brown"));

String name = elp.eval("employee.name");!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JSF 2.2 (JSR 344)
@arungupta #javaee7 #devnation
#31: JSF: Faces Flow
./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!
Package reusable flows in JAR
@arungupta #javaee7 #devnation
#31: JSF: Faces Flow
@Named

@FlowScoped("flow1")

public class Flow1Bean implements Serializable {

}!
!
@Produces @FlowDefinition

public Flow defineFlow(@FlowBuilderParameter FlowBuilder fb) {

String flowId = "flow1";

//. . .

return fb.getFlow();

}!
Package reusable flows in JAR
@arungupta #javaee7 #devnation
#31: JSF: Faces Flow
#{flowScope}: Local flow storage
#{facesContext.application.flowHandler.currentFlow}:
Returns true if within a flow
Package reusable flows in JAR
@arungupta #javaee7 #devnation
#32: JSF: Resource Library Contract
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!
Apply templates in a reusable and interchangeable manner
@arungupta #javaee7 #devnation
#32: JSF: Resource Library Contract
<f:view contracts=”red”>

<ui:composition template="/template.xhtml">

. . .

</ui:composition>

</f:view>

!
Apply templates in a reusable and interchangeable manner
@arungupta #javaee7 #devnation
#33: JSF: Pass-through Attributes
<h:inputText type="email" value="#{user.email}"/> 

!
<input type="text" name="j_idt6:j_idt10"/>!
HTML5-Friendly Markup
<h:inputText p:type="email" value="#{user.email}"/> 



<input type="email" name="j_idt6:j_idt10"/>!
!
@arungupta #javaee7 #devnation
#34: JSF: File Upload Component
<h:form enctype="multipart/form-data">

<h:inputFile value="#{fileUploadBean.file}"/><br/>

<h:commandButton value="Upload"/><p/>

</h:form> !
@Named @RequestScoped 

public class FileUploadBean {

private Part file;



//getter and setter

} !
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JAX-RS 2.0 (JSR 339)
@arungupta #javaee7 #devnation
#35: JAX-RS: Client API
Client client = ClientBuilder.newClient();!
WebTarget target = client.target("http://www.foo.com/
book");!
Invocation invocation =
target.request(TEXT_PLAIN).buildGet();!
Response response = invocation.invoke();!
!
Response response = ClientBuilder.newClient()!
.target("http://www.foo.com/book")!
.request(MediaType.TEXT_PLAIN)!
.get();!
!
String body = ClientBuilder.newClient()!
.target("http://www.foo.com/book")!
.request()!
.get(String.class);!
New API to consume rest services
@arungupta #javaee7 #devnation
#36: JAX-RS: Async Client
Future<String> 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) {

. . .

}!
The client API also supports asynchronous invocation
@arungupta #javaee7 #devnation
#37: JAX-RS: Async Server
@Path("/async")!
public class AsyncResource {!
!
@GET!
public void asyncGet(@Suspended AsyncResponse asyncResp)
{!
!
new Thread(new Runnable() {!
!
public void run() {!
String result = veryExpensiveOperation();!
asyncResp.resume(result);!
}!
}).start();!
}}!
Asynchronous request processing on the server
@arungupta #javaee7 #devnation
#38: JAX-RS: Message Filter
•  Filters on client side
–  ClientRequestFilter!
–  ClientResponseFilter!
•  Filters on server side
–  ContainerRequestFilter!
–  ContainerResponseFilter!
Used to process incoming and outgoing request or response headers
@arungupta #javaee7 #devnation
#38: JAX-RS: Message Filter
public class LogginFilter implements
ClientRequestFilter {!
!
public void filter(ClientRequestContext ctx)
throws IOException {!
System.out.println(ctx.getMethod());!
System.out.println(ctx.getUri());!
}!
}!
Used to process incoming and outgoing request or response headers
@arungupta #javaee7 #devnation
#39: JAX-RS: Entity Interceptors
•  Intercepts inbound entity streams (reads from
the “wire”)
– ReaderInterceptor!
•  Intercepts outbound entity streams (writes to the
“wire”)
– WriterInterceptor!
Marshalling and unmarshalling HTTP message bodies
@arungupta #javaee7 #devnation
#39: JAX-RS: Entity Interceptors
public class GZipInterceptor implements WriterInterceptor
{!
!
public void aroundWriteTo(WriterInterceptorContext
ctx){!
OutputStream os = ctx.getOutputStream();!
ctx.setOutputStream(new GZIPOutputStream(os));!
ctx.proceed();!
}!
}!
Marshalling and unmarshalling HTTP message bodies
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JSON-P 1.0 (JSR 353)
@arungupta #javaee7 #devnation
#40: JSON-P: JSON Builder
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();!
Creates an object model (or an array) in memory by adding elements
@arungupta #javaee7 #devnation
#41: JSON-P: JsonParser
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();!
}!
}!
Event-based parser that can read JSON data from a stream
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Batch 1.0 (JSR 352)
@arungupta #javaee7 #devnation
#42: Batch: Chunk-style Processing
Item-oriented Processing Style (primary)
@arungupta #javaee7 #devnation
#42: Batch: Chunk-style Processing
<step id=”sendStatements”>!
<chunk item-count=“3”>

<reader ref=”accountReader”/>!
<processor ref=”accountProcessor”/>

<writer ref=”emailWriter”/>!
</step>!
…implements ItemReader {

public Object readItem() {

// read account using JPA!
}!
!
…implements ItemProcessor {!
public Object processItems(Object account) {

// read Account, return Statement!
}!
!
…implements ItemWriter {!
public void writeItems(List accounts) {

// use JavaMail to send email!
}!
!
@arungupta #javaee7 #devnation
#43: Batch: Batchlet-style Processing
Task-oriented processing style
<step id=”transferFile”>!
<batchlet ref=“MyFileTransfer” />!
</step>!
…implements Batchlet {!
@Override

public void process() {

// Transfer file!
}!
!
@arungupta #javaee7 #devnation
#44: Batch: Job/Step/Chunk Listeners
<job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0”>

<listeners>

<listener ref="myJobListener"/>

</listeners>

<step id="myStep" >

<listeners>

<listener ref="myStepListener"/>

<listener ref="myChunkListener"/>

<listener ref="myItemReadListener"/>

<listener ref="myItemProcessorListener"/>

<listener ref="myItemWriteListener"/>

</listeners>

<chunk item-count="3”>. . .</chunk>

</step>

</job>!
!
@arungupta #javaee7 #devnation
#44: Batch: Job/Step/Chunk 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!
@arungupta #javaee7 #devnation
#44: Batch: Job/Step/Chunk Listeners
@Named

public class MyJobListener extends AbstractJobListener {



@Override

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



@Override

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

}!
@arungupta #javaee7 #devnation
#45: Batch: Partition
<step>

<chunk item-count="3">

<reader ref="myItemReader">

<properties>

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

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

</properties> 

</reader>

. . .

</chunk>!
@arungupta #javaee7 #devnation
#45: Batch: Partition
<partition>

<plan partitions="2">

<properties partition="0">

<property name="start" value="1"/>

<property name="end" value="10"/>

</properties>

<properties partition="1">

<property name="start" value="11"/>

<property name="end" value="20"/>

</properties>

</plan>

</partition>

</step>!
@arungupta #javaee7 #devnation
#46: Batch: Creating Workflows
<flow id="flow1" next="step3">

<step id="step1" next="step2"> . . . </step>

<step id="step2"> . . . </step>

</flow>

<step id="step3"> . . . </step>!
Flow: Elements that execute together as a unit
@arungupta #javaee7 #devnation
#46: Batch: Creating Workflows
<split id="split1" next=" . . . ">

<flow id="flow1”>

<step id="step1”> . . . </step>

</flow>

<flow id="flow2”>

<step id="step2”> . . . </step>

</flow>

</split>!
Split: Concurrent execution of flows
@arungupta #javaee7 #devnation
#46: Batch: Creating Workflows
<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> !
!
Decision: Customized way of sequencing between steps, flows, splits
@Named

public class MyDecider implements Decider {

@Override

public String decide(StepExecution[] ses) throws Exception {

. . .

return "DATA_LOADED"; // or "NOT_LOADED"!
} !
}!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JavaMail 1.5 (JSR 919)
@arungupta #javaee7 #devnation
#47: JavaMail
@MailSessionDefinition(name = "java:comp/myMailSession",

properties = {

"mail.smtp.host=smtp.gmail.com",

"mail.smtp.ssl.enable=true",

"mail.smtp.auth=true",

"mail.transport.protocol=smtp",

"mail.debug=true"

})





@Resource(lookup = "java:comp/myMailSession")

Session session;!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
JCA 1.7 (JSR 322)
@arungupta #javaee7 #devnation
#48: Java Connector Architecture
@ConnectionDefinition(

connection="MyConnection.class",

connectionImpl="MyConnectionImpl.class",

connectionFactory="MyConnectionFactory.class",

connectionFactoryImpl="MyConnectionFactoryImpl.class"

)

!
@AdministeredObjectDefinition(

className="MyQueueImpl.class",

name="java:comp/MyQueue",

resourceAdapter="myAdapter",

)!
@arungupta #javaee7 #devnation
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTLBeanValidation1.1
Interceptors1.2
CDI1.1
Concurrency1.0
JPA 2.1
JTA 1.2 EJB 3.2 JMS 2.0
Batch 1.0
JCA 1.7
Java EE 7
JavaMail 1.5
Java EE 7 (JSR 342)
@arungupta #javaee7 #devnation
#49: Default Resources
JNDI name: java:comp/DefaultDataSource
Default Data Source
@Resource(lookup="java:comp/
DefaultDataSource")

DataSource myDS;

!
@Resource

DataSource myDS; !
@arungupta #javaee7 #devnation
#49: Default Resources
JNDI name: java:comp/
DefaultJMSConnectionFactory



@Resource(lookup="java:comp/
DefaultJMSConnectionFactory”)

ConnectionFactory myCF;
@Resource

ConnectionFactory myCF;!
Default JMS Connection Factory
@arungupta #javaee7 #devnation
#49: Default Resources
JNDI names
•  java:comp/DefaultManagedExecutorService!
•  java:comp/DefaultManagedScheduledExecutorService!
•  java:comp/DefaultManagedThreadFactory!
•  java:comp/DefaultContextService!
Default Concurrency Utilities Objects
@arungupta #javaee7 #devnation
#50: Buy our books!
@arungupta #javaee7 #devnation
References
•  github.com/javaee-samples/javaee7-samples
•  github.com/javaee-samples/javaee7-hol
@arungupta #javaee7 #devnation

Mais conteúdo relacionado

Mais procurados

GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012Arun Gupta
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011Arun Gupta
 
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
 
Understanding
Understanding Understanding
Understanding Arun Gupta
 
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
 
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
 
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationGIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationArun Gupta
 
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
TDC 2011: The Java EE 7 Platform: Developing for the CloudTDC 2011: The Java EE 7 Platform: Developing for the Cloud
TDC 2011: The Java EE 7 Platform: Developing for the CloudArun Gupta
 
GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0Arun Gupta
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutesglassfish
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutesArun Gupta
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureArun Gupta
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Arun Gupta
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 RecipesJosh Juneau
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overviewsbobde
 
Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
Java EE 7: Developing for the Cloud at Geecon, JEEConf, JohannesburgJava EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
Java EE 7: Developing for the Cloud at Geecon, JEEConf, JohannesburgArun Gupta
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Arun Gupta
 
PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012Arun Gupta
 
Weblogic Administration Managed Server migration
Weblogic Administration Managed Server migrationWeblogic Administration Managed Server migration
Weblogic Administration Managed Server migrationRakesh Gujjarlapudi
 

Mais procurados (20)

GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012GlassFish REST Administration Backend at JavaOne India 2012
GlassFish REST Administration Backend at JavaOne India 2012
 
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
 
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
 
Understanding
Understanding Understanding
Understanding
 
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
 
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...
 
GIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE ApplicationGIDS 2012: PaaSing a Java EE Application
GIDS 2012: PaaSing a Java EE Application
 
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
TDC 2011: The Java EE 7 Platform: Developing for the CloudTDC 2011: The Java EE 7 Platform: Developing for the Cloud
TDC 2011: The Java EE 7 Platform: Developing for the Cloud
 
GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0GIDS 2012: Java Message Service 2.0
GIDS 2012: Java Message Service 2.0
 
Fifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 MinutesFifty Features of Java EE 7 in 50 Minutes
Fifty Features of Java EE 7 in 50 Minutes
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
 
Java EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for futureJava EE 6 and GlassFish v3: Paving the path for future
Java EE 6 and GlassFish v3: Paving the path for future
 
Java EE 7 overview
Java EE 7 overviewJava EE 7 overview
Java EE 7 overview
 
Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010Powering the Next Generation Services with Java Platform - Spark IT 2010
Powering the Next Generation Services with Java Platform - Spark IT 2010
 
Java EE 8 Recipes
Java EE 8 RecipesJava EE 8 Recipes
Java EE 8 Recipes
 
Sun Java EE 6 Overview
Sun Java EE 6 OverviewSun Java EE 6 Overview
Sun Java EE 6 Overview
 
Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
Java EE 7: Developing for the Cloud at Geecon, JEEConf, JohannesburgJava EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
Java EE 7: Developing for the Cloud at Geecon, JEEConf, Johannesburg
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012PaaSing a Java EE 6 Application at Geecon 2012
PaaSing a Java EE 6 Application at Geecon 2012
 
Weblogic Administration Managed Server migration
Weblogic Administration Managed Server migrationWeblogic Administration Managed Server migration
Weblogic Administration Managed Server migration
 

Destaque

JavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EEJavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EERodrigo Cândido da Silva
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology StackEberhard Wolff
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureKelly Goetsch
 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and ProsperKen Kousen
 

Destaque (8)

Java8.part2
Java8.part2Java8.part2
Java8.part2
 
TDD and BDD in Java 8 - what's in it for me?
TDD and BDD in Java 8 - what's in it for me?TDD and BDD in Java 8 - what's in it for me?
TDD and BDD in Java 8 - what's in it for me?
 
Going further with CDI 1.2
Going further with CDI 1.2Going further with CDI 1.2
Going further with CDI 1.2
 
JavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EEJavaOne 2016 - Reactive Microservices with Java and Java EE
JavaOne 2016 - Reactive Microservices with Java and Java EE
 
BDD Anti-patterns
BDD Anti-patternsBDD Anti-patterns
BDD Anti-patterns
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
Microservices + Oracle: A Bright Future
Microservices + Oracle: A Bright FutureMicroservices + Oracle: A Bright Future
Microservices + Oracle: A Bright Future
 
Spock: Test Well and Prosper
Spock: Test Well and ProsperSpock: Test Well and Prosper
Spock: Test Well and Prosper
 

Semelhante a 5050 dev nation

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
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Arun Gupta
 
Fifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty MinutesFifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty MinutesArun Gupta
 
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 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
 
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
 
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 @ 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 = 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 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
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Arun Gupta
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusJava EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusArun Gupta
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersBruno Borges
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Arun Gupta
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopArun Gupta
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Arun Gupta
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalacheIasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalacheCodecamp Romania
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureIndicThreads
 

Semelhante a 5050 dev nation (20)

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
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
 
Fifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty MinutesFifty New Features of Java EE 7 in Fifty Minutes
Fifty New Features of Java EE 7 in Fifty Minutes
 
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 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
 
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
 
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 @ 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
 
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 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
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
 
Java EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexusJava EE 6 & GlassFish v3 @ DevNexus
Java EE 6 & GlassFish v3 @ DevNexus
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
Java EE 6 & GlassFish v3 at Vancouver JUG, Jan 26, 2010
 
Spark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 WorkshopSpark IT 2011 - Java EE 6 Workshop
Spark IT 2011 - Java EE 6 Workshop
 
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
Java EE 6 & GlassFish v3: Paving the path for the future - Spark IT 2010
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalacheIasi code camp 12 october 2013   jax-rs-jee-ecosystem - catalin mihalache
Iasi code camp 12 october 2013 jax-rs-jee-ecosystem - catalin mihalache
 
Java EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The FutureJava EE 6 : Paving The Path For The Future
Java EE 6 : Paving The Path For The Future
 

Mais 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
 

Mais 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
 

Último

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Último (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

5050 dev nation

  • 2. @arungupta #javaee7 #devnation 50 new features of Java EE 7 in 50 minutes Arun Gupta, @arungupta
  • 4. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5
  • 5. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 CDI 1.1 (JSR 346)
  • 6. @arungupta #javaee7 #devnation #01: CDI: Default enabling Finer scanning control •  Possible values: all, annotated, none! •  Annotated behaves like in Java EE 6 (default)! <beans ... version="1.1" bean-discovery-mode="all">! <alternatives>! <class>org.agoncal.book.MockGenerator</class>! </alternatives>! </beans>!
  • 7. @arungupta #javaee7 #devnation #02: CDI: @Vetoed Veto the processing of the class or package @Vetoed! public class NonProcessedBean {
 ...! }! ! package-info.java @Vetoed! package com.non.processed.package;!
  • 8. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Bean Validation 1.1 (JSR 349)
  • 9. @arungupta #javaee7 #devnation #03: Bean Validation: Method validation public class CardValidator {! ! public CardValidator(@NotNull Algorithm algorithm) {! this.algorithm = algorithm;! }! ! @AssertTrue! public Boolean validate(@NotNull CreditCard creditCard) {! return algorithm.validate(creditCard.getNumber());! }! }! Pre/post conditions on method and constructors
  • 10. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Interceptors 1.2 (JSR 318)
  • 11. @arungupta #javaee7 #devnation #04: Interceptors: 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) ... {! // ...! }! }!
  • 12. @arungupta #javaee7 #devnation #05: Interceptors: @Priority Prioritizing interceptor bindings •  PLATFORM_BEFORE (0), LIBRARY_BEFORE (1000), APPLICATION (2000), LIBRARY_AFTER (3000), PLATFORM_AFTER (4000)! @Interceptor! @Loggable! @Priority(Interceptor.Priority.LIBRARY_BEFORE + 10)! public class LoggingInterceptor {! ! @AroundInvoke! ...! }!
  • 13. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Concurrency Utilities 1.0 (JSR 236)
  • 14. @arungupta #javaee7 #devnation #06: Concurrency: ManagedExecutor •  User threads in Java EE applications •  Support simple and advance concurrency design patterns •  Extend Concurrency Utilities API from Java SE (JSR 166y) –  java.util.concurrent package
  • 15. @arungupta #javaee7 #devnation #06: Concurrency: ManagedExecutor @Resource
 ManagedExecutorService executor;
 ! 
 ManagedExecutorService executor = (ManagedExecutorService) ctx
 .lookup("java:comp/DefaultManagedExecutorService");! Default ManagedExectuor
  • 16. @arungupta #javaee7 #devnation #06: Concurrency: ManagedExecutor <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>! Specify in web.xml
  • 17. @arungupta #javaee7 #devnation #07: Concurrency: ManagedScheduledExecutor •  Managed version of ScheduledExecutorService! •  Submit delayed or periodic tasks @Resource
 ManagedScheduledExecutorService executor;!
  • 18. @arungupta #javaee7 #devnation #07: Concurrency: ManagedScheduledExecutor InitialContext ctx = new InitialContext(); 
 
 ManagedScheduledExecutorService executor = (ManagedScheduledExecutorService)ctx.lookup(
 "java:comp/DefaultManagedScheduledExecutorService");
 ! •  Can be defined in web.xml as well Access using JNDI
  • 19. @arungupta #javaee7 #devnation #07: Concurrency: ManagedScheduledExecutor •  executor.schedule(new MyCallableTask(), 5, TimeUnit.SECONDS);! •  executor.scheduleAtFixedRate(new MyRunnableTask(), 2, 3, TimeUnit.SECONDS);! •  executor.scheduleWithFixedDelay(new MyRunnableTask(), 2, 3, TimeUnit.SECONDS);!
  • 20. @arungupta #javaee7 #devnation #08: Concurrency: ManagedThreadFactory •  Extends ThreadFactory @Resource(name = "DefaultManagedThreadFactory")
 ManagedThreadFactory factory; ManagedThreadFactory factory = (ManagedThreadFactory) ctx.lookup("java:comp/ DefaultManagedThreadFactory");

  • 21. @arungupta #javaee7 #devnation #08: Concurrency: ManagedThreadFactory •  Thread thread = factory.newThread(new MyTask()); •  ((ManageableThread)thread).isShutdown();

  • 22. @arungupta #javaee7 #devnation #09: Concurrency: DynamicProxy •  Create dynamic proxy objects, adds contextual information available for applications running in Java EE environment •  Classloading, JNDI, Security, …
  • 23. @arungupta #javaee7 #devnation #09: Concurrency: DynamicProxy @Resource
 ContextService service;
 
 
 Runnable proxy = service.createContextualProxy(new MyRunnable(), Runnable.class);
 
 
 Future f = executor.submit(proxy);!
  • 24. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JPA 2.1 (JSR 338)
  • 25. @arungupta #javaee7 #devnation #10: JPA: Schema Generation Standardized database schema generation <persistence ... version="2.1">! <persistence-unit ...>! <properties>! <property name="javax.persistence.schema-generation.scripts.action"! value="drop-and-create"/>! <property name="javax.persistence.schema-generation.scripts.create-target" value="create.sql"/>! <property name="javax.persistence.sql-load-script-source" ! value="insert.sql"/>! </properties>! </persistence-unit>!
  • 26. @arungupta #javaee7 #devnation #11: JPA: @Index Defines additional indexes in schema generation @Entity! @Table(indexes = {! @Index(columnList = "ISBN"),! @Index(columnList = "NBOFPAGE")! })! public class Book {! ! @Id @GeneratedValue! private Long id;! private String isbn;! private Integer nbOfPage;! ...! }!
  • 27. @arungupta #javaee7 #devnation #12: JPA: Unsynchronized PC Persistence context is not enlisted in any tx unless explicitly joined @PersistenceContext(synchronization =! SynchronizationType.UNSYNCHRONIZED)! private EntityManager em;! ...! ! em.persist(book);! ! ...! em.joinTransaction();! !
  • 28. @arungupta #javaee7 #devnation #13: JPA: Stored Procedure Calling a stored procedure @Entity! @NamedStoredProcedureQuery(name = "archiveOldBooks", ! procedureName = "sp_archive_books",! parameters = {! @StoredProcedureParameter(name = ”date", mode = IN, ! type = Date.class),! @StoredProcedureParameter(name = "warehouse", mode = IN, ! type = String.class)! })! public class Book {...}!
  • 29. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JTA 1.2 (JSR 907)
  • 30. @arungupta #javaee7 #devnation #14: JTA: @Transactional Transaction management on Managed Beans as CDI interceptor binding @Path("book")! @Transactional(value = Transactional.TxType.REQUIRED,! rollbackOn = {SQLException.class, JMSException.class},! dontRollbackOn = SQLWarning.class)! public class BookRestService {! ! @PersistenceContext! private EntityManager em;! ! @POST! @Consumes(MediaType.APPLICATION_XML)! public Response createBook(Book book) {...}! }!
  • 31. @arungupta #javaee7 #devnation #15: JTA: @TransactionScoped CDI scope whose lifecycle is scoped to the currently active JTA transaction @TransactionScoped! public class BookBean {...}! ! @WebServlet! public class TxServlet extends HttpServlet {! @Inject 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();! }! }!
  • 32. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 EJB 3.2 (JSR 345)
  • 33. @arungupta #javaee7 #devnation #16: EJB: Disable passivation of stateful @Stateful(passivationCapable = false)! public class ShoppingCart {! ...! }! In some cases increases performance, scalability and robustness
  • 34. @arungupta #javaee7 #devnation #17: EJB-Lite: Async + Non-persistent timer @Stateless! public class OrderEJB {! ! @Asynchronous! public void sendEmail (Order order) {! // Very Long task! }! ! @Schedule(hour="2", persistent=false)! public void createDailyReport() {! // ...! }! }! Extended the EJB Lite to include local asynchronous invocations and non-persistent EJB Timer Service
  • 35. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JMS 2.0 (JSR 343)
  • 36. @arungupta #javaee7 #devnation #18: JMS: JMSContext API New simplified API to produce and consume messages @Inject JMSContext ctx;! ! 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);!
  • 37. @arungupta #javaee7 #devnation #19: JMS: Autocloseable Several JMS interfaces implement Autocloseable try (JMSContext ctx = connectionFactory.createContext()) {! ctx.createProducer().send(queue, "Text message sent");! }! ! ...! ! try (JMSContext ctx = connectionFactory.createContext()) {! while (true) {! String s = ctx.createConsumer(queue).receiveBody(String.class);! }! }!
  • 38. @arungupta #javaee7 #devnation #20: JMS: JMSConnectionFactoryDefinition @Stateless! @JMSConnectionFactoryDefinition(! name = "java:app/jms/MyConnectionFactory",! interfaceName = "javax.jms.TopicConnectionFactory")! ! ! ! public class ExpensiveOrderEJB {...}! A JMS ConnectionFactory can be defined using an annotation on a container-managed class
  • 39. @arungupta #javaee7 #devnation #21: JMS: 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 {...}!
  • 40. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Servlet 3.1 (JSR 340)
  • 41. @arungupta #javaee7 #devnation #22: Servlet: Non-blocking I/O public class TestServlet extends HttpServlet
 protected void doGet(HttpServletRequest request,
 HttpServletResponse response) 
 throws IOException, ServletException {
 ServletInputStream input = request.getInputStream();
 byte[] b = new byte[1024];
 int len = -1;
 while ((len = input.read(b)) != -1) {
 . . .
 }
 }
 }!
  • 42. @arungupta #javaee7 #devnation #22: Servlet: Non-blocking I/O •  ServletInputStream! –  public void setReadListener(ReadListener listener);! –  public boolean isFinished();! –  public boolean isReady();! •  ServletOutputStream! –  public setWriteListener(WriteListener listener);! –  public boolean canWrite();! New methods to existing interfaces
  • 43. @arungupta #javaee7 #devnation #22: Servlet: Non-blocking I/O public interface ReadListener extends EventListener {
 public void onDataAvailable();
 pubic void onAllDataRead();
 public void onError();
 }! public interface WriteListener extends EventListener {
 public void onWritePossible();
 public void onError();
 }! New interfaces
  • 44. @arungupta #javaee7 #devnation #22: Servlet: Non-blocking I/O AsyncContext context = request.startAsync();
 ServletInputStream input = request.getInputStream();
 input.setReadListener(
 new MyReadListener(input, context)); ! Only for Asynchronous Servlets
  • 45. @arungupta #javaee7 #devnation #23: Servlet: Protocol Upgrade •  <T extends HttpUpgradeHandler> T HttpServletRequest.upgrade(Class<T> class) throws IOException;
 
 
 ! •  HttpUpgradeHandler! –  init(WebConnection wc);! –  destroy();!
  • 46. @arungupta #javaee7 #devnation #23: Servlet: Protocol Upgrade public interface WebConnection {
 ServletInputStream getInputStream();
 ServletOutputStream getOutputStream();
 }!
  • 47. @arungupta #javaee7 #devnation #24: Servlet: Improved Security <web-app . . . version="3.1"> 
 <web-resource-collection>
 <url-pattern>/account/*</url-pattern> 
 <http-method>GET</http-method>
 </web-resource-collection>
 <auth-contraint>
 . . .
 </auth-contraint>
 </web-app> ! ! Deny an HTTP method request for an uncovered HTTP method
  • 48. @arungupta #javaee7 #devnation #24: Servlet: Improved Security <web-app . . . version="3.1"> 
 <deny-uncovered-http-methods/>
 <web-resource-collection>
 <url-pattern>/account/*</url-pattern> 
 <http-method>GET</http-method>
 </web-resource-collection>
 <auth-contraint>
 . . .
 </auth-contraint> 
 </web-app> ! ! Deny an HTTP method request for an uncovered HTTP method
  • 49. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Web Socket 1.0 (JSR 356)
  • 50. @arungupta #javaee7 #devnation #25: WebSocket: Annotated server endpoint •  Enables full-duplex bi-directional communication over single TCP connection @javax.websocket.server.ServerEndpoint("/chat")
 public class ChatServer {
 
 @OnMessage
 public String chat(String name, Session session) {
 for (Session peer : client.getOpenSessions()) {! peer.getBasicRemote().sendObject(message);! }
 }
 }!
  • 51. @arungupta #javaee7 #devnation #26: WebSocket: Lifecycle callbacks @javax.websocket.OnOpen
 public void open(Session s) { . . . }
 
 @javax.websocket.OnClose
 public void close(CloseReason c) { . . . }
 
 @javax.websocket.OnError
 public void error(Throwable t) { . . . }!
  • 52. @arungupta #javaee7 #devnation #27: WebSocket: Annotated client endpoint @javax.websocket.ClientEndpoint
 public class MyClient {
 @javax.websocket.OnOpen
 public void open(Session session) { … }
 
 // Lifecycle callbacks
 }!
  • 53. @arungupta #javaee7 #devnation #27: WebSocket: Annotated client endpoint ContainerProvider
 .getWebSocketContainer()
 .connectToServer(
 MyClient.class, 
 URI.create("ws://. . ."));!
  • 54. @arungupta #javaee7 #devnation #28: WebSocket: Programmatic endpoints public class ChatServer extends Endpoint {
 @Override
 public void onOpen(Session s, EndpointConfig ec) {
 s.addMessageHandler(new MessageHandler.Whole<String>() {
 public void onMessage(String text) { . . . }
 }
 }
 
 @Override
 public void onClose(Session s, CloseReason cr) { . . . }
 
 //. . . 
 }!
  • 55. @arungupta #javaee7 #devnation #28: WebSocket: Programmatic endpoints public class MyApplicationConfig implements ServerApplicationConfig {
 public Set<ServerEndpointConfig> getEndpointConfigs(…) { 
 ServerEndpointConfig.Builder
 .create(MyEndpoint.class, "/websocket”)
 .configurator(new MyConfig())
 .build()
 }
 }!
  • 56. @arungupta #javaee7 #devnation #28: WebSocket: Programmatic endpoints public class MyConfig extends ServerEndpointConfig.Configurator {
 
 public <T> T getEndpointInstance(. . .) { . . . }
 
 public void modifyHandshake(. . .) { . . . }
 
 . . .
 }!
  • 57. @arungupta #javaee7 #devnation #29: WebSocket: Encoder and Decoder @javax.websocket.server.ServerEndpoint(
 value="/chat",
 decoders="MyDecoder.class",
 encoders="MyEncoder.class")
 public class ChatServer {
 
 @OnMessage
 public String chat(ChatMessage name, Session session) {
 . . . 
 }
 }!
  • 58. @arungupta #javaee7 #devnation #29: WebSocket: Encoder and Decoder public class MyDecoder implements Decoder.Text<ChatMessage> {
 public ChatMessage decode(String s) {
 // . . .
 }
 
 public boolean willDecode(String string) {
 // . . .
 }
 
 //. . .
 }
 
 !
  • 59. @arungupta #javaee7 #devnation #29: WebSocket: Encoder and Decoder public class MyEncoder implements Encoder.Text<ChatMessage> {
 
 public String encode(ChatMessage chatMessage) {
 // . . .
 }
 ! // . . .
 }!
  • 60. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Expression Language 3.0 (JSR 341)
  • 61. @arungupta #javaee7 #devnation #30: Expression Langauge: ELProcessor •  Use EL in a stand-alone environment –  Evaluate EL expressions –  Defining a static method as an EL function –  Defining an object instance as an EL name ELProcessor elp = new ELProcessor();
 elp.defineBean("employee", new Employee("Charlie Brown"));
 String name = elp.eval("employee.name");!
  • 62. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JSF 2.2 (JSR 344)
  • 63. @arungupta #javaee7 #devnation #31: JSF: Faces Flow ./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! Package reusable flows in JAR
  • 64. @arungupta #javaee7 #devnation #31: JSF: Faces Flow @Named
 @FlowScoped("flow1")
 public class Flow1Bean implements Serializable {
 }! ! @Produces @FlowDefinition
 public Flow defineFlow(@FlowBuilderParameter FlowBuilder fb) {
 String flowId = "flow1";
 //. . .
 return fb.getFlow();
 }! Package reusable flows in JAR
  • 65. @arungupta #javaee7 #devnation #31: JSF: Faces Flow #{flowScope}: Local flow storage #{facesContext.application.flowHandler.currentFlow}: Returns true if within a flow Package reusable flows in JAR
  • 66. @arungupta #javaee7 #devnation #32: JSF: Resource Library Contract 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! Apply templates in a reusable and interchangeable manner
  • 67. @arungupta #javaee7 #devnation #32: JSF: Resource Library Contract <f:view contracts=”red”>
 <ui:composition template="/template.xhtml">
 . . .
 </ui:composition>
 </f:view>
 ! Apply templates in a reusable and interchangeable manner
  • 68. @arungupta #javaee7 #devnation #33: JSF: Pass-through Attributes <h:inputText type="email" value="#{user.email}"/> 
 ! <input type="text" name="j_idt6:j_idt10"/>! HTML5-Friendly Markup <h:inputText p:type="email" value="#{user.email}"/> 
 
 <input type="email" name="j_idt6:j_idt10"/>! !
  • 69. @arungupta #javaee7 #devnation #34: JSF: File Upload Component <h:form enctype="multipart/form-data">
 <h:inputFile value="#{fileUploadBean.file}"/><br/>
 <h:commandButton value="Upload"/><p/>
 </h:form> ! @Named @RequestScoped 
 public class FileUploadBean {
 private Part file;
 
 //getter and setter
 } !
  • 70. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JAX-RS 2.0 (JSR 339)
  • 71. @arungupta #javaee7 #devnation #35: JAX-RS: Client API Client client = ClientBuilder.newClient();! WebTarget target = client.target("http://www.foo.com/ book");! Invocation invocation = target.request(TEXT_PLAIN).buildGet();! Response response = invocation.invoke();! ! Response response = ClientBuilder.newClient()! .target("http://www.foo.com/book")! .request(MediaType.TEXT_PLAIN)! .get();! ! String body = ClientBuilder.newClient()! .target("http://www.foo.com/book")! .request()! .get(String.class);! New API to consume rest services
  • 72. @arungupta #javaee7 #devnation #36: JAX-RS: Async Client Future<String> 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) {
 . . .
 }! The client API also supports asynchronous invocation
  • 73. @arungupta #javaee7 #devnation #37: JAX-RS: Async Server @Path("/async")! public class AsyncResource {! ! @GET! public void asyncGet(@Suspended AsyncResponse asyncResp) {! ! new Thread(new Runnable() {! ! public void run() {! String result = veryExpensiveOperation();! asyncResp.resume(result);! }! }).start();! }}! Asynchronous request processing on the server
  • 74. @arungupta #javaee7 #devnation #38: JAX-RS: Message Filter •  Filters on client side –  ClientRequestFilter! –  ClientResponseFilter! •  Filters on server side –  ContainerRequestFilter! –  ContainerResponseFilter! Used to process incoming and outgoing request or response headers
  • 75. @arungupta #javaee7 #devnation #38: JAX-RS: Message Filter public class LogginFilter implements ClientRequestFilter {! ! public void filter(ClientRequestContext ctx) throws IOException {! System.out.println(ctx.getMethod());! System.out.println(ctx.getUri());! }! }! Used to process incoming and outgoing request or response headers
  • 76. @arungupta #javaee7 #devnation #39: JAX-RS: Entity Interceptors •  Intercepts inbound entity streams (reads from the “wire”) – ReaderInterceptor! •  Intercepts outbound entity streams (writes to the “wire”) – WriterInterceptor! Marshalling and unmarshalling HTTP message bodies
  • 77. @arungupta #javaee7 #devnation #39: JAX-RS: Entity Interceptors public class GZipInterceptor implements WriterInterceptor {! ! public void aroundWriteTo(WriterInterceptorContext ctx){! OutputStream os = ctx.getOutputStream();! ctx.setOutputStream(new GZIPOutputStream(os));! ctx.proceed();! }! }! Marshalling and unmarshalling HTTP message bodies
  • 78. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JSON-P 1.0 (JSR 353)
  • 79. @arungupta #javaee7 #devnation #40: JSON-P: JSON Builder 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();! Creates an object model (or an array) in memory by adding elements
  • 80. @arungupta #javaee7 #devnation #41: JSON-P: JsonParser 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();! }! }! Event-based parser that can read JSON data from a stream
  • 81. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Batch 1.0 (JSR 352)
  • 82. @arungupta #javaee7 #devnation #42: Batch: Chunk-style Processing Item-oriented Processing Style (primary)
  • 83. @arungupta #javaee7 #devnation #42: Batch: Chunk-style Processing <step id=”sendStatements”>! <chunk item-count=“3”>
 <reader ref=”accountReader”/>! <processor ref=”accountProcessor”/>
 <writer ref=”emailWriter”/>! </step>! …implements ItemReader {
 public Object readItem() {
 // read account using JPA! }! ! …implements ItemProcessor {! public Object processItems(Object account) {
 // read Account, return Statement! }! ! …implements ItemWriter {! public void writeItems(List accounts) {
 // use JavaMail to send email! }! !
  • 84. @arungupta #javaee7 #devnation #43: Batch: Batchlet-style Processing Task-oriented processing style <step id=”transferFile”>! <batchlet ref=“MyFileTransfer” />! </step>! …implements Batchlet {! @Override
 public void process() {
 // Transfer file! }! !
  • 85. @arungupta #javaee7 #devnation #44: Batch: Job/Step/Chunk Listeners <job id="myJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0”>
 <listeners>
 <listener ref="myJobListener"/>
 </listeners>
 <step id="myStep" >
 <listeners>
 <listener ref="myStepListener"/>
 <listener ref="myChunkListener"/>
 <listener ref="myItemReadListener"/>
 <listener ref="myItemProcessorListener"/>
 <listener ref="myItemWriteListener"/>
 </listeners>
 <chunk item-count="3”>. . .</chunk>
 </step>
 </job>! !
  • 86. @arungupta #javaee7 #devnation #44: Batch: Job/Step/Chunk 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!
  • 87. @arungupta #javaee7 #devnation #44: Batch: Job/Step/Chunk Listeners @Named
 public class MyJobListener extends AbstractJobListener {
 
 @Override
 public void beforeJob() throws Exception { . . . }
 
 @Override
 public void afterJob() throws Exception { . . . }
 }!
  • 88. @arungupta #javaee7 #devnation #45: Batch: Partition <step>
 <chunk item-count="3">
 <reader ref="myItemReader">
 <properties>
 <property name="start" value="#{partitionPlan['start']}"/>
 <property name="end" value="#{partitionPlan['end']}"/>
 </properties> 
 </reader>
 . . .
 </chunk>!
  • 89. @arungupta #javaee7 #devnation #45: Batch: Partition <partition>
 <plan partitions="2">
 <properties partition="0">
 <property name="start" value="1"/>
 <property name="end" value="10"/>
 </properties>
 <properties partition="1">
 <property name="start" value="11"/>
 <property name="end" value="20"/>
 </properties>
 </plan>
 </partition>
 </step>!
  • 90. @arungupta #javaee7 #devnation #46: Batch: Creating Workflows <flow id="flow1" next="step3">
 <step id="step1" next="step2"> . . . </step>
 <step id="step2"> . . . </step>
 </flow>
 <step id="step3"> . . . </step>! Flow: Elements that execute together as a unit
  • 91. @arungupta #javaee7 #devnation #46: Batch: Creating Workflows <split id="split1" next=" . . . ">
 <flow id="flow1”>
 <step id="step1”> . . . </step>
 </flow>
 <flow id="flow2”>
 <step id="step2”> . . . </step>
 </flow>
 </split>! Split: Concurrent execution of flows
  • 92. @arungupta #javaee7 #devnation #46: Batch: Creating Workflows <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> ! ! Decision: Customized way of sequencing between steps, flows, splits @Named
 public class MyDecider implements Decider {
 @Override
 public String decide(StepExecution[] ses) throws Exception {
 . . .
 return "DATA_LOADED"; // or "NOT_LOADED"! } ! }!
  • 93. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JavaMail 1.5 (JSR 919)
  • 94. @arungupta #javaee7 #devnation #47: JavaMail @MailSessionDefinition(name = "java:comp/myMailSession",
 properties = {
 "mail.smtp.host=smtp.gmail.com",
 "mail.smtp.ssl.enable=true",
 "mail.smtp.auth=true",
 "mail.transport.protocol=smtp",
 "mail.debug=true"
 })
 
 
 @Resource(lookup = "java:comp/myMailSession")
 Session session;!
  • 95. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 JCA 1.7 (JSR 322)
  • 96. @arungupta #javaee7 #devnation #48: Java Connector Architecture @ConnectionDefinition(
 connection="MyConnection.class",
 connectionImpl="MyConnectionImpl.class",
 connectionFactory="MyConnectionFactory.class",
 connectionFactoryImpl="MyConnectionFactoryImpl.class"
 )
 ! @AdministeredObjectDefinition(
 className="MyQueueImpl.class",
 name="java:comp/MyQueue",
 resourceAdapter="myAdapter",
 )!
  • 97. @arungupta #javaee7 #devnation JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTLBeanValidation1.1 Interceptors1.2 CDI1.1 Concurrency1.0 JPA 2.1 JTA 1.2 EJB 3.2 JMS 2.0 Batch 1.0 JCA 1.7 Java EE 7 JavaMail 1.5 Java EE 7 (JSR 342)
  • 98. @arungupta #javaee7 #devnation #49: Default Resources JNDI name: java:comp/DefaultDataSource Default Data Source @Resource(lookup="java:comp/ DefaultDataSource")
 DataSource myDS;
 ! @Resource
 DataSource myDS; !
  • 99. @arungupta #javaee7 #devnation #49: Default Resources JNDI name: java:comp/ DefaultJMSConnectionFactory
 
 @Resource(lookup="java:comp/ DefaultJMSConnectionFactory”)
 ConnectionFactory myCF; @Resource
 ConnectionFactory myCF;! Default JMS Connection Factory
  • 100. @arungupta #javaee7 #devnation #49: Default Resources JNDI names •  java:comp/DefaultManagedExecutorService! •  java:comp/DefaultManagedScheduledExecutorService! •  java:comp/DefaultManagedThreadFactory! •  java:comp/DefaultContextService! Default Concurrency Utilities Objects
  • 102. @arungupta #javaee7 #devnation References •  github.com/javaee-samples/javaee7-samples •  github.com/javaee-samples/javaee7-hol