Introduction to Wildfly 8 - Marchioni

2,132 views

Published on

Le slide di Francesco Marchioni presentate a Codemotion Roma 2014

Published in: Technology, Education
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,132
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
54
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Introduction to Wildfly 8 - Marchioni

  1. 1. ROME 11-12 april 2014ROME 11-12 april 2014 Talk title: WildFly 8 Introduction f.marchioni@mastertheboss.com Francesco Marchioni
  2. 2. ROME 11-12 april 2014 - Francesco Marchioni Francesco Marchioni  Owner of mastertheboss.com  Book author @ PacktPublishing @ ItBuzzpress
  3. 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. 4. ROME 11-12 april 2014 Why «WildFly» ??  Reduce overlapping caused by the «JBoss» brand  Differentiate the licensed version from the Community version
  5. 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. 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
  7. 7. ROME 11-12 april 2014 WildFly Java EE 7 API CDI Extensions JSF 2.2 JSP 2.3 EL 3.0 JAX-WS 2.2 JAX-RS 2.0 JSON 1.0 WebSocket 1.0 Servlet 3.1 CDI 1.1 Interceptors 1.2 JTA 1.2 Common Annotations 1.1 Concurrency 1.0 Managed Beans 1.0 EJB 3.2 JPA 2.1 JMS 2.0 JCA 1.7 Batch 1.0
  8. 8. ROME 11-12 april 2014 Batch API <job id="MyJob"> <step id="BatchProcessor" next="cleanup"> <chunk checkpoint-policy="item" item-count="10"> <reader ref="MyItemReader"></reader> <processor ref="MyItemProcessor"></processor> <writer ref="MyItemWriter"></writer> </chunk> </step> <step id="cleanup"> <batchlet ref="CleanUp"></batchlet> </step> </job> Chunk Step Batchlet
  9. 9. ROME 11-12 april 2014 Web sockets API @ServerEndpoint("/echo") public class ExampleWebSocket { @OnMessage public String onMessage(String message) { return “Hello “+message; } }
  10. 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. 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. 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. 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. 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. 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. 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
  17. 17. ROME 11-12 april 2014 Patching [standalone@localhost:9990 /] patch apply /path/to-patch/patch.zip [standalone@localhost:9990 /] shutdown -- restart=true
  18. 18. ROME 11-12 april 2014 Role Base Access Control In JBoss AS 7 every user is a SuperUser Lack of granularity
  19. 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. 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. 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. 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. 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. 24. ROME 11-12 april 2014 - Francesco Marchioni WildFly books http://www.itbuzzpress.com
  25. 25. ROME 11-12 april 2014 - Speaker’s name Questions ??

×