SlideShare une entreprise Scribd logo
1  sur  62
Télécharger pour lire hors ligne
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java EE 7 for WebLogic 12c
Developers
An overview of supported APIs in 12.1.3 and other features
Bruno Borges
Principal Product Manager and Java Evangelist
Oracle Latin America
August, 2014
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
• Bruno Borges
– Principal Product Manager, Java Evangelist
– Oracle Latin America
– @brunoborges
– bruno.borges@oracle.com
Speaker
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 4
Java Enterprise Edition Platform
Java EE 7
DEVELOPER
PRODUCTIVITY
Java EE 7
– Batch
– Concurrency
– Simplified JMS
– More annotated POJOs
– Less boilerplate code
– Cohesive integrated platform – WebSockets
– JSON
– Servlet 3.1 NIO
– REST
MEETING
ENTERPRISE
DEMANDS
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 5
Java EE 7 APIs
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0Servlet 3.1
JSF 2.2EL 3.0
JSP
JSTL
BeanValidation1.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
JavaMail 1.5
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
WebLogic Server 12.1.3
Mobile, Developer Productivity
WLS 12.1.3Clients
HTML5
clients
ADF Mobile
Proxies
OTD
Apache
OHS
Web Sockets (JSR 356)
TopLink Data Services
Server-Sent Events
JAX-RS 2.0
WebSocket Emulation
WebSocket
Emulation
JAX-RS 2.0, WebSocket 1.0
JSON Processing API 1.0
JPA 2.1
Server-Sent Events
WebSocket Emulation
JPA-RS
JPA
Change
Notification
Database
JSON Programming API
HTTP/S, JSON/XML
WebSocket, Server-Sent
Events, Long polling
Java EE 7
APIs
Additional
WebLogic
Value-Add
Oracle Confidential – Internal/Restricted/Highly Restricted 6
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 8
APIs supported by WebLogic 12.1.3
Java EE 7 APIs
JAX-RS 2.0
JSON-P 1.0
Web Socket 1.0
JPA 2.1
Enabled by Default
in WebLogic 12.1.3
Deployed as
Shared Library
PRE_CLASSPATH
Adjustment/Patch
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enabling JAX-RS 2.0 in WebLogic 12.1.3
• JAX-RS 2.0
– Defaults to JAX-RS 1.1 (Java EE 6)
– Deploy jax-rs-2.0.war as shared
library
– Reference it from weblogic.xml
in applications
Deployed as Shared Library
<weblogic-web-app>
<library-ref>
<library-name>jax-rs</library-name>
<specification-version>2.0</specification-version>
</library-ref>
</weblogic-web-app>
$> java weblogic.Deployer
-username weblogic -password welcome1 -library –deploy
-targets AdminServer,Cluster1,DynClusterA
$MW_HOME/wlserver/common/deployable-libraries/jax-rs-2.0.war
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Enabling JPA 2.1 in WebLogic 12.1.3
• JPA 2.1
– Defaults to JPA 2.0 (Java EE 6)
– By adjusting PRE_CLASSPATH variable inside commEnv.sh
• Or apply patch 17814796 (MOS; OPatch)
– Application’s persistence.xml descriptor must set JPA version = 2.1
Adjusted PRE_CLASSPATH
PRE_CLASSPATH=$MW_HOME/oracle_common/modules/javax
.persistence_2.1.jar:$MW_HOME/wlserver/modules/com.oracl
e.weblogic.jpa21support_1.0.0.0_2-1.jar
$> opatch apply $PATH_TO_PATCH_17814796
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java Persistence API 2.1
Enhanced version of standard Java API for Object Relational Mapping
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1
• Schema Generation
– javax.persistence.schema-generation.* properties
• Unsynchronized Persistence Contexts
• Bulk update/delete using Criteria
• User-defined functions using FUNCTION
• Stored Procedure Query
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – 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>
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – Unsynchronized Context
• Decide if/when data must be written to the database
@PersistenceContext(synchronization = SynchronizationType.UNSYNCHRONIZED)
private EntityManager em;
...
em.persist(book);
...
em.joinTransaction();
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – Bulk Update/Delete
• Bulk Update
– CriteriaUpdate<Employee> q = cb.createCriteriaUpdate(Employee.class);
Root<Employee> emp = q.from(Employee.class);
.set(e.get(Employee_.salary), cb.prod(e.get(Employee_.salary), 1.1f))
.set(e.get(Employee_.status), "full_time“)
.where(cb.lt(emp.get(Emploee_.salary), 10000));
• Bulk Delete
– CriteriaDelete<PhoneNumber> q = cb.createCriteriaDelete(PhoneNumber.class);
Root<PhoneNumber> p = q.from(PhoneNumber.class);
q.where(cb.equal(p.get(PhoneNumber_.status), "out_of_service");
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – Define Named Stored Procedures
@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 {...}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – Call Named Stored Procedures
StoredProcedureQuery query =
em.createNamedStoredProcedureQuery("ReadAddressById");
query.setParameter("P_ADDRESS_ID", 12345);
List<Address> result = query.getResultList();
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JPA 2.1 – Call SQL Functions from JPQL
SELECT e
FROM Employee e
WHERE FUNCTION(‘isLongTermEmployee’, e.startDate)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSON Processing API 1.0
Standard Java API for processing JSON structures
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSON-P 1.0
• API to parse and generate JSON
• Streaming API
– Low-level, efficient way to parse/generate JSON
– Provides pluggability for parsers/generators
• Object Model API
– Simple, easy-to-use high-level API
– Implemented on top of Streaming API
• Binding JSON to Java objects forthcoming
Standard API for JSON Processing
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSON-P 1.0
"phoneNumber": [
{ "type": "home",
"number": ”408-123-4567” },
{ "type": ”work",
"number": ”408-987-6543” }
]
Example of JSON structure
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSON-P 1.0
JsonGenerator jg = Json.createGenerator(...);
jg.writeStartArray("phoneNumber“)
.writeStartObject()
.write("type", "home“)
.write("number", "408-123-4567“)
.writeEnd()
.writeStartObject()
.write("type", ”work“)
.write("number", "408-987-6543“)
.writeEnd()
.writeEnd();
jg.close();
Example of Object Model API for JSON-P
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSON-P 1.0
{
"firstName": "John", "lastName": "Smith", "age": 25,
"phoneNumber":
[ { "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" } ]
}
Iterator<Event> it = parser.iterator();
Event event = it.next(); // START_OBJECT
event = it.next(); // KEY_NAME
event = it.next(); // VALUE_STRING
String name = parser.getString(); // "John”
Example of Stream API for JSON-P
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JAX-RS 2.0
A Standard Java API to build RESTful services and clients
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JAX-RS – Java API for RESTful Web Services 2.0
• Client API
• Message Filters and Entity Interceptors
• Asynchronous Processing
– Server and Client
• Common Configuration
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Client API for JAX-RS 2.0
// Get instance of Client
Client client = ClientBuilder.newClient();
// Get customer name for the shipped products
String name = client.target(“../orders/{orderId}/customer”)
.resolveTemplate(”orderId", ”10”)
.queryParam(”shipped", ”true”)
.request()
.get(String.class);
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Async Client API for JAX-RS 2.0
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) {...}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Async Server API for JAX-RS 2.0
@Path("/async")
public class AsyncResource {
@GET
public void asyncGet(final @Suspended AsyncResponse asyncResp) {
new Thread(new Runnable() {
public void run() {
String result = veryExpensiveOperation();
asyncResp.resume(result);
}
}).start();
}}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java API for WebSocket 1.0
Developing WebSocket Applications using the Java Standard
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
WebSocket Overview
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
WebSocket Overview
The WebSocket API in HTML5
• Enables use of WebSocket
in HTML5/web applications
• Open/Close connections
• Send/Receive messages
• Fully asynchronous
• Event driven, listen and
respond to events
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
WebSocket Overview
Browser Support for WebSocket API
•Broad base of
support for
WebSocket in
modern browsers
•Firefox 28+,
Chrome 33+, Safari
7+, IE 10+
•Including mobile
browsers http://caniuse.com/#search=websocket
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The WebSocket Protocol (RFC 6455)
Protocol Overview
• Defines handshake and data transfer
• Introduces new URI schemes
– ws-URI = “ws:” “//” host [:port] path [ “?” query ]
– wss-URI = “wss:” “//” host [:port] path [ “?” query ]
– # MUST be escaped as %23 (URI fragments are meaningless)
• Imposes an Origin Security Model
• Supports extensibility
– Tunnel other protocol by supporting sub-protocols, extend protocol features by
supporting extensions
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The WebSocket Protocol
Opening Handshake
WebLogicServer12.1.3
HTTP
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The WebSocket Protocol
Protocol Upgrade
WebLogicServer12.1.3
WebSocket
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The WebSocket Protocol
Keep Alive: Ping and Pong
Ping Frame
Pong Frame
Ping Frame
Pong Frame
WebLogicServer12.1.3
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
The WebSocket Protocol
Closing Handshake
WebLogicServer12.1.3
Close Frame
Data Frame
Data Frame
Data Frame
Close Frame
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Developing WebSocket Applications using the Java Standard
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
• Creating a WebSocket requires a Java class that acts as an Endpoint
– Participate in lifecycle: establish connections with peers, handle errors, close
connections
– Send and receive messages
• Endpoints can be created from:
– Annotation based approach using WebSocket Annotations, @ServerEndpoint
– Programmatic API where Java class extends WebSocket API class
• Endpoints can be defined as:
– Clients which connect to one server only at a time
– Servers which many clients can connect to at any time
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Annotated ServerEndpoint Example
import javax.websocket.OnMessage;
import javax.websocket.server.ServerEndpoint;
@ServerEndpoint("/echo")
public class EchoServer {
@OnMessage
public String echo(String incomingMessage) {
return String.format(
"I got this (%s) message so I am sending it back!”, incomingMessage);
}
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Annotated ServerEndpoint Example
@ServerEndpoint("/echo")
public class EchoServer {
@OnMessage
public void onMessage(Session session, String message) {
session.getOpenSessions()
.forEach(s -> s.getBasicRemote().sendText(message));
}
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Annotated Path Parameter Example
@ServerEndpoint("/users/{username}")
public class UserEndpoint {
@OnMessage
public String handle(String message, @PathParam("username") String user) {
return “message “ + message + “ from user “ + user;
}
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Programmatic Endpoint Example
public class ProgrammaticEchoServer extends Endpoint {
@Override
public void onOpen(final Session session, EndpointConfig endpointConfig) {
mySession.addMessageHandler(new MessageHandler.Whole<String>() {
public void onMessage(String text) {
try {
mySession.getBasicRemote()
.sendText(“I got this (“ + text + “)” + “so I am sending it back !”);
} catch (IOException ioe) { }
}
});
}
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Responding to Lifecycle Events
Annotation Programmatic API
Open Event @OnOpen
public void onOpen(Session session,
EndpointConfig config)
Message
Event
@OnMessage
• Create instance of relevant
javax.websocket.MessageHandler
• Register with Session
Error Event @OnError
public void onError(Session session,
Throwable throwable)
Close Event @OnClose
public void onClose(Session session,
CloseReason reason)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Receiving Message from Peers
• Annotate a suitable method with
@OnMessage
• Implement an appropriate MessageHandler
interface
• Add it to the Session
@OnMessage
Void handleText(String message)
@OnMessage
public void handlePartialText(
String message, boolean isLast)
SimpleHandler implements MessageHandler.Whole<String> {
... }
session.addMessageHandler(
new SimpleHandler());
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Receiving Message from Peer with @OnMessage
Message Type Annotated Method Form
Text
public void handleText(String message)
public void handleReader(Reader r)
public void handleTextPieces(String message, boolean isLast)
Binary
public void handleBinary(ByteBuffer bytebuf)
public void handleStream(InputStream is)
public void handleBinaryPieces(ByteBuffer bytebuf,
boolean isLast)
Any Object public void handleObject(CustomObject co)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Receiving Message Programmatically from Peers
Message Type Message Handler Interface
Text
MessageHandler.Whole<String>
MessageHandler.Whole<Reader>
MessageHandler.Partial<String>
Binary
MessageHandler.Whole<ByteBuffer>
MessageHandler.Partial<ByteBuffer>
MessageHandler.Whole<InputStream>
Any Object
MessageHandler.Whole<CustomObject>
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Programmatic Endpoint Example
public class ProgrammaticEchoServer extends Endpoint {
@Override
public void onOpen(final Session session, EndpointConfig endpointConfig) {
mySession.addMessageHandler(new MessageHandler.Whole<String>() {
public void onMessage(String text) {
try {
mySession.getBasicRemote()
.sendText(“I got this (“ + text + “)” + “so I am sending it back !”);
} catch (IOException ioe) { }
}
});
}
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Asynchronous and Synchronous Sending Modes
Mode Usage Interface and Method
Synchronous
• Most commonly use mode
• Send methods block until transmission
of message is complete
RemoteEndpoint.Basic
void sendText(String message)
Asynchronous
• Send methods return immediately
before transmission
• Future and Callback options for
completion handling
RemoteEndpoint.Async
Future sendText(String message)
void sendText(String message,
SendHandler handler)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Example Encoder
public class AuctionMessageEncoder implements Encoder.Text<AuctionMessage> {
@Override
public String encode(AuctionMessage object) throws EncodeException {
JsonObject json = null;
switch (object.getType()) {
case AuctionMessage.AUCTION_TIME_RESPONSE:
json = Json.createObjectBuilder()
.add("type", object.getType())
.add("communicationId", object.getCommunicationId())
.add("data", (int) object.getData()).build();
break;
}
return json.toString();
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Example Decoder
public class AuctionMessageDecoder implements Decoder.Text<AuctionMessage> {
@Override
public AuctionMessage decode(String s) {
JsonReader jsonReader = Json.createReader(new StringReader(s));
JsonObject json = jsonReader.readObject();
return new AuctionMessage(json.getString("type"),
json.getString("communicationId"), json.getString("data"));
}
@Override
public boolean willDecode(String s) {
return s.contains(AuctionMessage.BID_REQUEST)
|| s.contains(AuctionMessage.AUCTION_LIST_REQUEST)
|| s.contains(AuctionMessage.LOGIN_REQUEST));
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Configuring Encoders and Decoders
• Annotation
• Specify encoder and decoder
values on @ServerEndpoint
• Programmatic
• Add encoder/decoder classes to
ServerEndpointConfig object
@ServerEndpoint(
decoders = { AuctionMessageDecoder.class },
encoders = { AuctionMessageEncoder.class }
)
List<Encoder> encoders = new List<>();
encoders.add(AuctionMessageEncoder.class);
encoders.add(AuctionMessageDecoder.class);
ServerEndpointConfig config =
ServerEndpointConfig.Builder
.create(AuctionEndpoint.class, "/bids”)
.encoders(encoders)
.build();
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
JSR-356: Java API for WebSocket 1.0
Uses Servlet Security model - Example of secured WebSocket in web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure Customer WebSocket Endpoint</web-resource-name>
<url-pattern>/customer/feed</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>CUSTOMERS</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>CUSTOMERS</role-name>
</security-role>
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Tyrus – Reference Implementation
• Official Page
– http://tyrus.java.net
• User Guide (1.8)
– https://tyrus.java.net/documentation/1.8/user-guide.html
• Used by
– GlassFish 4.0+
– WebLogic 12c (12.1.3+)
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
WebSocket Protocol Fallback in WLS 12.1.3
Enabling WebSocket Use Across All Environments
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Configure Web Applications for WebSockets Fallback
Support
• Import orasocket.js in HTML
• Modify web.xml
• No changes required in existing , compatible code!!
<web-app version="3.0">
<context-param>
<description>Enable fallback mechanism</description>
<param-name>com.oracle.tyrus.fallback.enabled</param-name>
<param-value>true</param-value>
</context-param>
</web-app>
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Bonus: Server-sent Events
Feature of Jersey, JAX-RS Reference Implementation
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Server-sent Events
• Part of HTML5 Specification
• Server Push Notifications
– Client opens connection with Server
– Server sends message to Client
– Client can’t send messages to Server
– Connection is maintained opened until either Server or Client closes it
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
SSE Client Side
var url = ‘webresources/items/events’;
var source = new EventSource(url);
source.onmessage = function (event) {
console.log(event.data);
}
source.addEventListener(“size”, function(event) {
console.log(event.name + ‘ ‘ + event.data);
}
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
SSE Server-Side – Implemented with Jersey
private final SseBroadcaster BROADCASTER = new SseBroadcaster();
@GET
@Path("events”)
@Produces(SseFeature.SERVER_SENT_EVENTS)
public EventOutput fruitEvents() {
final EventOutput eventOutput = new EventOutput();
BROADCASTER.add(eventOutput);
return eventOutput;
}
Still pending standard API
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
SSE Server-Side – Implemented with Jersey
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public void addFruit(@FormParam("fruit")String fruit) {
fruitsList.add(fruit);
// Broadcasting an un-named event with the name of the newly added item in data
BROADCASTER.broadcast(new OutboundEvent.Builder().data(String.class, fruit).build());
// Broadcasting a named "add" event with the current size of the items collection in data
BROADCASTER.broadcast(new OutboundEvent.Builder().name("size").data(Integer.class,
fruitsList.size()).build());
}
Still pending standard API
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Differences between WebSockets and SSE
WebSockets Server Sent Events
Over a custom protocol Over simple HTTP
Full Duplex, Bi-directional Server-Push Only, Client->Server is out-of-band (higher
latency)
Native support in most browsers Can be poly-filled to backport
Not straight forward protocol Simpler protocol
Pre-defined message handlers Arbitrary events
Application-specific Built-in support for re-connection and event id
Require server and/or proxy configurations No server or proxy changes required
ArrayBuffer and Blob No support for binary types
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Java EE 7 for WebLogic 12c Developers

Contenu connexe

Tendances

Changes in WebLogic 12.1.3 Every Administrator Must Know
Changes in WebLogic 12.1.3 Every Administrator Must KnowChanges in WebLogic 12.1.3 Every Administrator Must Know
Changes in WebLogic 12.1.3 Every Administrator Must KnowBruno Borges
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishArun Gupta
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialKenny Gryp
 
TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"Ryusuke Kajiyama
 
TWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCTWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCRyusuke Kajiyama
 
WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013Michel Schildmeijer
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 UpdateRyan Cuprak
 
Making MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid InfrastructureMaking MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid InfrastructureIlmar Kerm
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech UpdatesRyusuke Kajiyama
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!Maarten Smeets
 
Oracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesOracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesMichel Schildmeijer
 
Oracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new featuresOracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new featuresMaarten Smeets
 
MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)Ryusuke Kajiyama
 
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...Miguel Araújo
 
Foundation for optimized data center & private cloud
Foundation for optimized data center & private cloudFoundation for optimized data center & private cloud
Foundation for optimized data center & private cloudJS Park
 
Enabling: Optimized Integrations at Amway with Oracle SOA Suite
Enabling: Optimized Integrations at Amway with Oracle SOA SuiteEnabling: Optimized Integrations at Amway with Oracle SOA Suite
Enabling: Optimized Integrations at Amway with Oracle SOA SuiteRevelation Technologies
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replicationsqlhjalp
 
My sql 56_roadmap_april2012
My sql 56_roadmap_april2012My sql 56_roadmap_april2012
My sql 56_roadmap_april2012sqlhjalp
 

Tendances (20)

Changes in WebLogic 12.1.3 Every Administrator Must Know
Changes in WebLogic 12.1.3 Every Administrator Must KnowChanges in WebLogic 12.1.3 Every Administrator Must Know
Changes in WebLogic 12.1.3 Every Administrator Must Know
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"TWJUG August, MySQL JDBC Driver "Connector/J"
TWJUG August, MySQL JDBC Driver "Connector/J"
 
TWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RCTWJUG August, What's new in MySQL 5.7 RC
TWJUG August, What's new in MySQL 5.7 RC
 
WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013WebLogic on ODA - Oracle Open World 2013
WebLogic on ODA - Oracle Open World 2013
 
Java EE 8 Update
Java EE 8 UpdateJava EE 8 Update
Java EE 8 Update
 
Making MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid InfrastructureMaking MySQL highly available using Oracle Grid Infrastructure
Making MySQL highly available using Oracle Grid Infrastructure
 
20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates20140722 Taiwan MySQL User Group Meeting Tech Updates
20140722 Taiwan MySQL User Group Meeting Tech Updates
 
WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!WebLogic Scripting Tool made Cool!
WebLogic Scripting Tool made Cool!
 
Oracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesOracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best Practises
 
Oracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new featuresOracle SOA Suite 12.2.1 new features
Oracle SOA Suite 12.2.1 new features
 
MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)MySQL Cluster as Transactional NoSQL (KVS)
MySQL Cluster as Transactional NoSQL (KVS)
 
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...
MySQL InnoDB Cluster / ReplicaSet - Making Provisioning & Troubleshooting as ...
 
Foundation for optimized data center & private cloud
Foundation for optimized data center & private cloudFoundation for optimized data center & private cloud
Foundation for optimized data center & private cloud
 
Enabling: Optimized Integrations at Amway with Oracle SOA Suite
Enabling: Optimized Integrations at Amway with Oracle SOA SuiteEnabling: Optimized Integrations at Amway with Oracle SOA Suite
Enabling: Optimized Integrations at Amway with Oracle SOA Suite
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replication
 
My sql 56_roadmap_april2012
My sql 56_roadmap_april2012My sql 56_roadmap_april2012
My sql 56_roadmap_april2012
 

Similaire à Java EE 7 for WebLogic 12c Developers

Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Jagadish Prasath
 
OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7Bruno Borges
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Bruno Borges
 
Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Bruno Borges
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in actionAnkara JUG
 
Java EE7
Java EE7Java EE7
Java EE7Jay Lee
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckEdward Burns
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOFglassfish
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesEdward Burns
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Reza Rahman
 
Changes in weblogic12c_every_administrator_must_know-140812141929
Changes in weblogic12c_every_administrator_must_know-140812141929Changes in weblogic12c_every_administrator_must_know-140812141929
Changes in weblogic12c_every_administrator_must_know-140812141929Demodx Demodxz
 
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
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewKris Rice
 
JavaOne2015報告会 in Okinawa
JavaOne2015報告会 in OkinawaJavaOne2015報告会 in Okinawa
JavaOne2015報告会 in OkinawaTakashi Ito
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Oracle Developers
 
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)jeckels
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5Arun Gupta
 

Similaire à Java EE 7 for WebLogic 12c Developers (20)

Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
 
OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7OTN Tour 2013: What's new in java EE 7
OTN Tour 2013: What's new in java EE 7
 
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()
 
Java EE7 in action
Java EE7 in actionJava EE7 in action
Java EE7 in action
 
Java EE7
Java EE7Java EE7
Java EE7
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
Java ee7 1hour
Java ee7 1hourJava ee7 1hour
Java ee7 1hour
 
GlassFish BOF
GlassFish BOFGlassFish BOF
GlassFish BOF
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
Changes in weblogic12c_every_administrator_must_know-140812141929
Changes in weblogic12c_every_administrator_must_know-140812141929Changes in weblogic12c_every_administrator_must_know-140812141929
Changes in weblogic12c_every_administrator_must_know-140812141929
 
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
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
JavaOne2015報告会 in Okinawa
JavaOne2015報告会 in OkinawaJavaOne2015報告会 in Okinawa
JavaOne2015報告会 in Okinawa
 
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
Reactive Java Programming: A new Asynchronous Database Access API by Kuassi M...
 
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
Oracle Coherence Strategy and Roadmap (OpenWorld, September 2014)
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5
 

Plus de Bruno Borges

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesBruno Borges
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on KubernetesBruno Borges
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsBruno Borges
 
Making Sense of Serverless Computing
Making Sense of Serverless ComputingMaking Sense of Serverless Computing
Making Sense of Serverless ComputingBruno Borges
 
Visual Studio Code for Java and Spring Developers
Visual Studio Code for Java and Spring DevelopersVisual Studio Code for Java and Spring Developers
Visual Studio Code for Java and Spring DevelopersBruno Borges
 
Taking Spring Apps for a Spin on Microsoft Azure Cloud
Taking Spring Apps for a Spin on Microsoft Azure CloudTaking Spring Apps for a Spin on Microsoft Azure Cloud
Taking Spring Apps for a Spin on Microsoft Azure CloudBruno Borges
 
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...Bruno Borges
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemBruno Borges
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemBruno Borges
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudBruno Borges
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXBruno Borges
 
Servidores de Aplicação: Por quê ainda precisamos deles?
Servidores de Aplicação: Por quê ainda precisamos deles?Servidores de Aplicação: Por quê ainda precisamos deles?
Servidores de Aplicação: Por quê ainda precisamos deles?Bruno Borges
 
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]Bruno Borges
 
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]Bruno Borges
 
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]Bruno Borges
 
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]Bruno Borges
 
Running Oracle WebLogic on Docker Containers [BOF7537]
Running Oracle WebLogic on Docker Containers [BOF7537]Running Oracle WebLogic on Docker Containers [BOF7537]
Running Oracle WebLogic on Docker Containers [BOF7537]Bruno Borges
 
Lightweight Java in the Cloud
Lightweight Java in the CloudLightweight Java in the Cloud
Lightweight Java in the CloudBruno Borges
 
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFXTweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFXBruno Borges
 
Integrando Oracle BPM com Java EE e WebSockets
Integrando Oracle BPM com Java EE e WebSocketsIntegrando Oracle BPM com Java EE e WebSockets
Integrando Oracle BPM com Java EE e WebSocketsBruno Borges
 

Plus de Bruno Borges (20)

Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on KubernetesSecrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
 
[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes[Outdated] Secrets of Performance Tuning Java on Kubernetes
[Outdated] Secrets of Performance Tuning Java on Kubernetes
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
 
Making Sense of Serverless Computing
Making Sense of Serverless ComputingMaking Sense of Serverless Computing
Making Sense of Serverless Computing
 
Visual Studio Code for Java and Spring Developers
Visual Studio Code for Java and Spring DevelopersVisual Studio Code for Java and Spring Developers
Visual Studio Code for Java and Spring Developers
 
Taking Spring Apps for a Spin on Microsoft Azure Cloud
Taking Spring Apps for a Spin on Microsoft Azure CloudTaking Spring Apps for a Spin on Microsoft Azure Cloud
Taking Spring Apps for a Spin on Microsoft Azure Cloud
 
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
A Look Back at Enterprise Integration Patterns and Their Use into Today's Ser...
 
Melhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na NuvemMelhore o Desenvolvimento do Time com DevOps na Nuvem
Melhore o Desenvolvimento do Time com DevOps na Nuvem
 
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na NuvemTecnologias Oracle em Docker Containers On-premise e na Nuvem
Tecnologias Oracle em Docker Containers On-premise e na Nuvem
 
Java EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The CloudJava EE Arquillian Testing with Docker & The Cloud
Java EE Arquillian Testing with Docker & The Cloud
 
Migrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFXMigrating From Applets to Java Desktop Apps in JavaFX
Migrating From Applets to Java Desktop Apps in JavaFX
 
Servidores de Aplicação: Por quê ainda precisamos deles?
Servidores de Aplicação: Por quê ainda precisamos deles?Servidores de Aplicação: Por quê ainda precisamos deles?
Servidores de Aplicação: Por quê ainda precisamos deles?
 
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
Build and Monitor Cloud PaaS with JVM’s Nashorn JavaScripts [CON1859]
 
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
Cloud Services for Developers: What’s Inside Oracle Cloud for You? [CON1861]
 
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
Booting Up Spring Apps on Lightweight Cloud Services [CON10258]
 
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
Java EE Application Servers: Containerized or Multitenant? Both! [CON7506]
 
Running Oracle WebLogic on Docker Containers [BOF7537]
Running Oracle WebLogic on Docker Containers [BOF7537]Running Oracle WebLogic on Docker Containers [BOF7537]
Running Oracle WebLogic on Docker Containers [BOF7537]
 
Lightweight Java in the Cloud
Lightweight Java in the CloudLightweight Java in the Cloud
Lightweight Java in the Cloud
 
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFXTweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
Tweet for Beer - Beertap Powered by Java Goes IoT, Cloud, and JavaFX
 
Integrando Oracle BPM com Java EE e WebSockets
Integrando Oracle BPM com Java EE e WebSocketsIntegrando Oracle BPM com Java EE e WebSockets
Integrando Oracle BPM com Java EE e WebSockets
 

Java EE 7 for WebLogic 12c Developers

  • 1. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Java EE 7 for WebLogic 12c Developers An overview of supported APIs in 12.1.3 and other features Bruno Borges Principal Product Manager and Java Evangelist Oracle Latin America August, 2014
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Bruno Borges – Principal Product Manager, Java Evangelist – Oracle Latin America – @brunoborges – bruno.borges@oracle.com Speaker
  • 3. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 4 Java Enterprise Edition Platform Java EE 7 DEVELOPER PRODUCTIVITY Java EE 7 – Batch – Concurrency – Simplified JMS – More annotated POJOs – Less boilerplate code – Cohesive integrated platform – WebSockets – JSON – Servlet 3.1 NIO – REST MEETING ENTERPRISE DEMANDS
  • 4. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 5 Java EE 7 APIs JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0Servlet 3.1 JSF 2.2EL 3.0 JSP JSTL BeanValidation1.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 JavaMail 1.5
  • 5. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | WebLogic Server 12.1.3 Mobile, Developer Productivity WLS 12.1.3Clients HTML5 clients ADF Mobile Proxies OTD Apache OHS Web Sockets (JSR 356) TopLink Data Services Server-Sent Events JAX-RS 2.0 WebSocket Emulation WebSocket Emulation JAX-RS 2.0, WebSocket 1.0 JSON Processing API 1.0 JPA 2.1 Server-Sent Events WebSocket Emulation JPA-RS JPA Change Notification Database JSON Programming API HTTP/S, JSON/XML WebSocket, Server-Sent Events, Long polling Java EE 7 APIs Additional WebLogic Value-Add Oracle Confidential – Internal/Restricted/Highly Restricted 6
  • 6. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 8 APIs supported by WebLogic 12.1.3 Java EE 7 APIs JAX-RS 2.0 JSON-P 1.0 Web Socket 1.0 JPA 2.1 Enabled by Default in WebLogic 12.1.3 Deployed as Shared Library PRE_CLASSPATH Adjustment/Patch
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enabling JAX-RS 2.0 in WebLogic 12.1.3 • JAX-RS 2.0 – Defaults to JAX-RS 1.1 (Java EE 6) – Deploy jax-rs-2.0.war as shared library – Reference it from weblogic.xml in applications Deployed as Shared Library <weblogic-web-app> <library-ref> <library-name>jax-rs</library-name> <specification-version>2.0</specification-version> </library-ref> </weblogic-web-app> $> java weblogic.Deployer -username weblogic -password welcome1 -library –deploy -targets AdminServer,Cluster1,DynClusterA $MW_HOME/wlserver/common/deployable-libraries/jax-rs-2.0.war
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Enabling JPA 2.1 in WebLogic 12.1.3 • JPA 2.1 – Defaults to JPA 2.0 (Java EE 6) – By adjusting PRE_CLASSPATH variable inside commEnv.sh • Or apply patch 17814796 (MOS; OPatch) – Application’s persistence.xml descriptor must set JPA version = 2.1 Adjusted PRE_CLASSPATH PRE_CLASSPATH=$MW_HOME/oracle_common/modules/javax .persistence_2.1.jar:$MW_HOME/wlserver/modules/com.oracl e.weblogic.jpa21support_1.0.0.0_2-1.jar $> opatch apply $PATH_TO_PATCH_17814796
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Java Persistence API 2.1 Enhanced version of standard Java API for Object Relational Mapping
  • 10. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 • Schema Generation – javax.persistence.schema-generation.* properties • Unsynchronized Persistence Contexts • Bulk update/delete using Criteria • User-defined functions using FUNCTION • Stored Procedure Query
  • 11. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – 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>
  • 12. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – Unsynchronized Context • Decide if/when data must be written to the database @PersistenceContext(synchronization = SynchronizationType.UNSYNCHRONIZED) private EntityManager em; ... em.persist(book); ... em.joinTransaction();
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – Bulk Update/Delete • Bulk Update – CriteriaUpdate<Employee> q = cb.createCriteriaUpdate(Employee.class); Root<Employee> emp = q.from(Employee.class); .set(e.get(Employee_.salary), cb.prod(e.get(Employee_.salary), 1.1f)) .set(e.get(Employee_.status), "full_time“) .where(cb.lt(emp.get(Emploee_.salary), 10000)); • Bulk Delete – CriteriaDelete<PhoneNumber> q = cb.createCriteriaDelete(PhoneNumber.class); Root<PhoneNumber> p = q.from(PhoneNumber.class); q.where(cb.equal(p.get(PhoneNumber_.status), "out_of_service");
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – Define Named Stored Procedures @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 {...}
  • 15. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – Call Named Stored Procedures StoredProcedureQuery query = em.createNamedStoredProcedureQuery("ReadAddressById"); query.setParameter("P_ADDRESS_ID", 12345); List<Address> result = query.getResultList();
  • 16. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JPA 2.1 – Call SQL Functions from JPQL SELECT e FROM Employee e WHERE FUNCTION(‘isLongTermEmployee’, e.startDate)
  • 17. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON Processing API 1.0 Standard Java API for processing JSON structures
  • 18. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON-P 1.0 • API to parse and generate JSON • Streaming API – Low-level, efficient way to parse/generate JSON – Provides pluggability for parsers/generators • Object Model API – Simple, easy-to-use high-level API – Implemented on top of Streaming API • Binding JSON to Java objects forthcoming Standard API for JSON Processing
  • 19. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON-P 1.0 "phoneNumber": [ { "type": "home", "number": ”408-123-4567” }, { "type": ”work", "number": ”408-987-6543” } ] Example of JSON structure
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON-P 1.0 JsonGenerator jg = Json.createGenerator(...); jg.writeStartArray("phoneNumber“) .writeStartObject() .write("type", "home“) .write("number", "408-123-4567“) .writeEnd() .writeStartObject() .write("type", ”work“) .write("number", "408-987-6543“) .writeEnd() .writeEnd(); jg.close(); Example of Object Model API for JSON-P
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON-P 1.0 { "firstName": "John", "lastName": "Smith", "age": 25, "phoneNumber": [ { "type": "home", "number": "212 555-1234" }, { "type": "fax", "number": "646 555-4567" } ] } Iterator<Event> it = parser.iterator(); Event event = it.next(); // START_OBJECT event = it.next(); // KEY_NAME event = it.next(); // VALUE_STRING String name = parser.getString(); // "John” Example of Stream API for JSON-P
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JAX-RS 2.0 A Standard Java API to build RESTful services and clients
  • 23. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JAX-RS – Java API for RESTful Web Services 2.0 • Client API • Message Filters and Entity Interceptors • Asynchronous Processing – Server and Client • Common Configuration
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Client API for JAX-RS 2.0 // Get instance of Client Client client = ClientBuilder.newClient(); // Get customer name for the shipped products String name = client.target(“../orders/{orderId}/customer”) .resolveTemplate(”orderId", ”10”) .queryParam(”shipped", ”true”) .request() .get(String.class);
  • 25. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Async Client API for JAX-RS 2.0 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) {...}
  • 26. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Async Server API for JAX-RS 2.0 @Path("/async") public class AsyncResource { @GET public void asyncGet(final @Suspended AsyncResponse asyncResp) { new Thread(new Runnable() { public void run() { String result = veryExpensiveOperation(); asyncResp.resume(result); } }).start(); }}
  • 27. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Java API for WebSocket 1.0 Developing WebSocket Applications using the Java Standard
  • 28. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | WebSocket Overview
  • 29. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | WebSocket Overview The WebSocket API in HTML5 • Enables use of WebSocket in HTML5/web applications • Open/Close connections • Send/Receive messages • Fully asynchronous • Event driven, listen and respond to events
  • 30. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | WebSocket Overview Browser Support for WebSocket API •Broad base of support for WebSocket in modern browsers •Firefox 28+, Chrome 33+, Safari 7+, IE 10+ •Including mobile browsers http://caniuse.com/#search=websocket
  • 31. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The WebSocket Protocol (RFC 6455) Protocol Overview • Defines handshake and data transfer • Introduces new URI schemes – ws-URI = “ws:” “//” host [:port] path [ “?” query ] – wss-URI = “wss:” “//” host [:port] path [ “?” query ] – # MUST be escaped as %23 (URI fragments are meaningless) • Imposes an Origin Security Model • Supports extensibility – Tunnel other protocol by supporting sub-protocols, extend protocol features by supporting extensions
  • 32. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The WebSocket Protocol Opening Handshake WebLogicServer12.1.3 HTTP
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The WebSocket Protocol Protocol Upgrade WebLogicServer12.1.3 WebSocket
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The WebSocket Protocol Keep Alive: Ping and Pong Ping Frame Pong Frame Ping Frame Pong Frame WebLogicServer12.1.3
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | The WebSocket Protocol Closing Handshake WebLogicServer12.1.3 Close Frame Data Frame Data Frame Data Frame Close Frame
  • 36. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Developing WebSocket Applications using the Java Standard
  • 37. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 • Creating a WebSocket requires a Java class that acts as an Endpoint – Participate in lifecycle: establish connections with peers, handle errors, close connections – Send and receive messages • Endpoints can be created from: – Annotation based approach using WebSocket Annotations, @ServerEndpoint – Programmatic API where Java class extends WebSocket API class • Endpoints can be defined as: – Clients which connect to one server only at a time – Servers which many clients can connect to at any time
  • 38. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Annotated ServerEndpoint Example import javax.websocket.OnMessage; import javax.websocket.server.ServerEndpoint; @ServerEndpoint("/echo") public class EchoServer { @OnMessage public String echo(String incomingMessage) { return String.format( "I got this (%s) message so I am sending it back!”, incomingMessage); } }
  • 39. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Annotated ServerEndpoint Example @ServerEndpoint("/echo") public class EchoServer { @OnMessage public void onMessage(Session session, String message) { session.getOpenSessions() .forEach(s -> s.getBasicRemote().sendText(message)); } }
  • 40. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Annotated Path Parameter Example @ServerEndpoint("/users/{username}") public class UserEndpoint { @OnMessage public String handle(String message, @PathParam("username") String user) { return “message “ + message + “ from user “ + user; } }
  • 41. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Programmatic Endpoint Example public class ProgrammaticEchoServer extends Endpoint { @Override public void onOpen(final Session session, EndpointConfig endpointConfig) { mySession.addMessageHandler(new MessageHandler.Whole<String>() { public void onMessage(String text) { try { mySession.getBasicRemote() .sendText(“I got this (“ + text + “)” + “so I am sending it back !”); } catch (IOException ioe) { } } }); } }
  • 42. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Responding to Lifecycle Events Annotation Programmatic API Open Event @OnOpen public void onOpen(Session session, EndpointConfig config) Message Event @OnMessage • Create instance of relevant javax.websocket.MessageHandler • Register with Session Error Event @OnError public void onError(Session session, Throwable throwable) Close Event @OnClose public void onClose(Session session, CloseReason reason)
  • 43. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Receiving Message from Peers • Annotate a suitable method with @OnMessage • Implement an appropriate MessageHandler interface • Add it to the Session @OnMessage Void handleText(String message) @OnMessage public void handlePartialText( String message, boolean isLast) SimpleHandler implements MessageHandler.Whole<String> { ... } session.addMessageHandler( new SimpleHandler());
  • 44. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Receiving Message from Peer with @OnMessage Message Type Annotated Method Form Text public void handleText(String message) public void handleReader(Reader r) public void handleTextPieces(String message, boolean isLast) Binary public void handleBinary(ByteBuffer bytebuf) public void handleStream(InputStream is) public void handleBinaryPieces(ByteBuffer bytebuf, boolean isLast) Any Object public void handleObject(CustomObject co)
  • 45. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Receiving Message Programmatically from Peers Message Type Message Handler Interface Text MessageHandler.Whole<String> MessageHandler.Whole<Reader> MessageHandler.Partial<String> Binary MessageHandler.Whole<ByteBuffer> MessageHandler.Partial<ByteBuffer> MessageHandler.Whole<InputStream> Any Object MessageHandler.Whole<CustomObject>
  • 46. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Programmatic Endpoint Example public class ProgrammaticEchoServer extends Endpoint { @Override public void onOpen(final Session session, EndpointConfig endpointConfig) { mySession.addMessageHandler(new MessageHandler.Whole<String>() { public void onMessage(String text) { try { mySession.getBasicRemote() .sendText(“I got this (“ + text + “)” + “so I am sending it back !”); } catch (IOException ioe) { } } }); } }
  • 47. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Asynchronous and Synchronous Sending Modes Mode Usage Interface and Method Synchronous • Most commonly use mode • Send methods block until transmission of message is complete RemoteEndpoint.Basic void sendText(String message) Asynchronous • Send methods return immediately before transmission • Future and Callback options for completion handling RemoteEndpoint.Async Future sendText(String message) void sendText(String message, SendHandler handler)
  • 48. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Example Encoder public class AuctionMessageEncoder implements Encoder.Text<AuctionMessage> { @Override public String encode(AuctionMessage object) throws EncodeException { JsonObject json = null; switch (object.getType()) { case AuctionMessage.AUCTION_TIME_RESPONSE: json = Json.createObjectBuilder() .add("type", object.getType()) .add("communicationId", object.getCommunicationId()) .add("data", (int) object.getData()).build(); break; } return json.toString(); }
  • 49. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Example Decoder public class AuctionMessageDecoder implements Decoder.Text<AuctionMessage> { @Override public AuctionMessage decode(String s) { JsonReader jsonReader = Json.createReader(new StringReader(s)); JsonObject json = jsonReader.readObject(); return new AuctionMessage(json.getString("type"), json.getString("communicationId"), json.getString("data")); } @Override public boolean willDecode(String s) { return s.contains(AuctionMessage.BID_REQUEST) || s.contains(AuctionMessage.AUCTION_LIST_REQUEST) || s.contains(AuctionMessage.LOGIN_REQUEST)); }
  • 50. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Configuring Encoders and Decoders • Annotation • Specify encoder and decoder values on @ServerEndpoint • Programmatic • Add encoder/decoder classes to ServerEndpointConfig object @ServerEndpoint( decoders = { AuctionMessageDecoder.class }, encoders = { AuctionMessageEncoder.class } ) List<Encoder> encoders = new List<>(); encoders.add(AuctionMessageEncoder.class); encoders.add(AuctionMessageDecoder.class); ServerEndpointConfig config = ServerEndpointConfig.Builder .create(AuctionEndpoint.class, "/bids”) .encoders(encoders) .build();
  • 51. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSR-356: Java API for WebSocket 1.0 Uses Servlet Security model - Example of secured WebSocket in web.xml <security-constraint> <web-resource-collection> <web-resource-name>Secure Customer WebSocket Endpoint</web-resource-name> <url-pattern>/customer/feed</url-pattern> <http-method>GET</http-method> </web-resource-collection> <auth-constraint> <role-name>CUSTOMERS</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> </login-config> <security-role> <role-name>CUSTOMERS</role-name> </security-role>
  • 52. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Tyrus – Reference Implementation • Official Page – http://tyrus.java.net • User Guide (1.8) – https://tyrus.java.net/documentation/1.8/user-guide.html • Used by – GlassFish 4.0+ – WebLogic 12c (12.1.3+)
  • 53. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | WebSocket Protocol Fallback in WLS 12.1.3 Enabling WebSocket Use Across All Environments
  • 54. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Configure Web Applications for WebSockets Fallback Support • Import orasocket.js in HTML • Modify web.xml • No changes required in existing , compatible code!! <web-app version="3.0"> <context-param> <description>Enable fallback mechanism</description> <param-name>com.oracle.tyrus.fallback.enabled</param-name> <param-value>true</param-value> </context-param> </web-app>
  • 55. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Bonus: Server-sent Events Feature of Jersey, JAX-RS Reference Implementation
  • 56. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Server-sent Events • Part of HTML5 Specification • Server Push Notifications – Client opens connection with Server – Server sends message to Client – Client can’t send messages to Server – Connection is maintained opened until either Server or Client closes it
  • 57. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SSE Client Side var url = ‘webresources/items/events’; var source = new EventSource(url); source.onmessage = function (event) { console.log(event.data); } source.addEventListener(“size”, function(event) { console.log(event.name + ‘ ‘ + event.data); }
  • 58. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SSE Server-Side – Implemented with Jersey private final SseBroadcaster BROADCASTER = new SseBroadcaster(); @GET @Path("events”) @Produces(SseFeature.SERVER_SENT_EVENTS) public EventOutput fruitEvents() { final EventOutput eventOutput = new EventOutput(); BROADCASTER.add(eventOutput); return eventOutput; } Still pending standard API
  • 59. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SSE Server-Side – Implemented with Jersey @POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void addFruit(@FormParam("fruit")String fruit) { fruitsList.add(fruit); // Broadcasting an un-named event with the name of the newly added item in data BROADCASTER.broadcast(new OutboundEvent.Builder().data(String.class, fruit).build()); // Broadcasting a named "add" event with the current size of the items collection in data BROADCASTER.broadcast(new OutboundEvent.Builder().name("size").data(Integer.class, fruitsList.size()).build()); } Still pending standard API
  • 60. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Differences between WebSockets and SSE WebSockets Server Sent Events Over a custom protocol Over simple HTTP Full Duplex, Bi-directional Server-Push Only, Client->Server is out-of-band (higher latency) Native support in most browsers Can be poly-filled to backport Not straight forward protocol Simpler protocol Pre-defined message handlers Arbitrary events Application-specific Built-in support for re-connection and event id Require server and/or proxy configurations No server or proxy changes required ArrayBuffer and Blob No support for binary types
  • 61. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |