This document summarizes a talk on the WildFly 8 application server. It discusses the history of Java EE and how WildFly was created to differentiate the open source and licensed versions of JBoss. Key features of WildFly 8 covered include support for Java EE 7, a new Undertow web server, simplified clustering, and role-based access control. Application programming interfaces new to Java EE 7 like the batch API, web sockets API, and concurrency API are demonstrated.
Apidays New York 2024 - The value of a flexible API Management solution for O...
Introduction to Wildfly 8 - Marchioni
1. ROME 11-12 april 2014ROME 11-12 april 2014
Talk title: WildFly 8 Introduction
f.marchioni@mastertheboss.com
Francesco Marchioni
2. ROME 11-12 april 2014 - Francesco Marchioni
Francesco Marchioni
Owner of mastertheboss.com
Book author @ PacktPublishing @ ItBuzzpress
3. ROME 11-12 april 2014 - Francesco Marchioni
A bit of history
J2EE 1.4
Certification
JEE 1.5
Certification
JEE 1.6
Certification
JEE 1.7
Certification
4. ROME 11-12 april 2014
Why «WildFly» ??
Reduce overlapping caused by the
«JBoss» brand
Differentiate the licensed version from
the Community version
5. ROME 11-12 april 2014
WildFly new features
Java EE 7 support
New Web server architecture (Undertow)
System Administrator friendly (only 1 port used
for management)
Role Base Access Control and auditing
Patch management
Simplified clustering
6. ROME 11-12 april 2014
Java EE 7 Highlights
JSR-352 Batch API for Java platform
JSR-236 Concurrency API for Java EE
applications
JSR-353 Java API for JSON Processing (JSON-P)
JSR-356 Web Sockets API
JSR-342 JMS 2.0 API
JSR-330 JAX-RS 2.0
9. ROME 11-12 april 2014
Web sockets API
@ServerEndpoint("/echo")
public class ExampleWebSocket {
@OnMessage
public String onMessage(String message) {
return “Hello “+message;
}
}
10. ROME 11-12 april 2014
Web Sockets JS Client
<script type="text/javascript">
function WebSocketTest()
{
// Let us open a web socket
var ws = new WebSocket("ws://localhost:8080/WebApp/echo");
ws.onopen = function()
{
// Web Socket is connected, send data using send()
ws.send("Message to send");
alert("Message is sent...");
};
ws.onmessage = function (evt)
{
var received_msg = evt.data;
alert("Message is received...");
};
ws.onclose = function()
{
// websocket is closed.
alert("Connection is closed...");
};
}
}
</script>
11. ROME 11-12 april 2014
Concurrency API
@Resource(name = "DefaultManagedExecutorService")
ManagedExecutorService executor;
executor.execute(new MySimpleTask1());
public class MySimpleTask1 implements Runnable {
public void run() {
System.out.println("Thread started.");
}
}
12. ROME 11-12 april 2014
JMS 2.0 API
@Stateless
public class MessageSender {
@Inject
JMSContext context;
@Resource(mappedName=“java:jboss/jms/queue/exampleQueue”)
private Queue queue;
public void sendMessage(String message) {
context.createProducer().send(queue, message);
}
}
14:28
13. ROME 11-12 april 2014
Undertow Web server
• Lightweight Web Server : core JAR size < 1 MB - Runtime < 4 MB
• Supports HTTP Upgrade to allow multiple protocols multiplexing over HTTP
• Supports Servlet 3.1
• Runnable as Embeddable or Standalone
• Modular architecture built on Handlers which can be chained
14. ROME 11-12 april 2014
Undertow Web server
public class HelloWorldServer {
public static void main(final String[] args) {
Undertow server = Undertow.builder()
.addHttpListener(8080, "localhost")
.setHandler(new HttpHandler() {
@Override
public void handleRequest(final HttpServerExchange exchange) throws
Exception {
exchange.getResponseHeaders().put(Headers.CONTENT_TYPE,
"text/plain");
exchange.getResponseSender().send("Hello World");
} }).build();
server.start();
}
}
15. ROME 11-12 april 2014
Server Port Reduction
Port 9990 Administration
Port 8080 HTTP + HTTP upgrade
Port 9999 Native management
Port 4447 Remoting
Removed
16. ROME 11-12 april 2014
Patching
Patching allows updating libraries and
configuration files
Patches distributed as a zip file
containing libraries and metadata
Installed using the Command Line
Interface
Patches can be rolled back and
invalidated by other patches
18. ROME 11-12 april 2014
Role Base Access Control
In JBoss AS 7 every user is a SuperUser
Lack of granularity
19. ROME 11-12 april 2014
Role Base Access Control
Administrative Users can be mapped to Roles
Roles = set of Permissions
Permissions:
Actions (access, read/write config and runtime)
Set of Constraints:
Sensitive resource
Sensitive data
Application Resource
Auditing
20. ROME 11-12 april 2014
Role Base Access Control
Roles:
Monitor: read non-sensitive resources
Operator: Monitor + start/stop servers and resources
Deployer: Operator + Deploy application and resources
Maintainer: Deployer + Configure applications and resources
Administrator: Mantainer + System Configuration
Auditor: Mantainer + Audit logging
SuperUser: Everything
21. ROME 11-12 april 2014
Role Base Access Control
Scoped Roles:
A role that is Server Group scoped
restricts the permissions of that role to
one or more Domain Server Groups.
22. ROME 11-12 april 2014
Role Base Access Control
Host Scoped Roles:
A role that is bound to one Domain
Host
Restricts the permissions of that role
only to that Host.
23. ROME 11-12 april 2014
Clustering Enhancements
New Stateful SB Clustering implementation
@Clustered annotation deprecated
EJB
Cache<K, V>
cache;
EJB.jar
Cache<K, V>
cache;
JBoss AS 7 WildFly 8
24. ROME 11-12 april 2014 - Francesco Marchioni
WildFly books
http://www.itbuzzpress.com