▶Book Description
Middleware is the infrastructure in software based applications that enables businesses to solve problems, operate more efficiently, and make money. As the use of middleware extends beyond a single application, the importance of having it written by experts increases substantially. This book will help you become an expert in developing middleware for a variety of applications.
The book starts off by exploring the latest Java EE 8 APIs with newer features and managing dependencies with CDI 2.0. You will learn to implement object-to-relational mapping using JPA 2.1 and validate data using bean validation. You will also work with different types of EJB to develop business logic, and with design RESTful APIs by utilizing different HTTP methods and activating JAX-RS features in enterprise applications. You will learn to secure your middleware with Java Security 1.0 and implement various authentication techniques, such as OAuth authentication. In the concluding chapters, you will use various test technologies, such as JUnit and Mockito, to test applications, and Docker to deploy your enterprise applications.
By the end of the book, you will be proficient in developing robust, effective, and distributed middleware for your business.
▶What You Will Learn
⦁ Implement the latest Java EE 8 APIs and manage dependencies with CDI 2.0
⦁ Perform CRUD operations and access databases with JPA 2.1
⦁ Use bean validation API 2.0 to validate data
⦁ Develop business logic with EJB 3.2
⦁ Incorporate the REST architecture and RESTful API design patterns
⦁ Perform serialization and deserialization on JSON documents using JSON-B
⦁ Utilize JMS for messaging and queuing models and securing applications
⦁ Test applications using JUnit and Mockito and deploy them using Docker
▶Key Features
⦁ Explore EJBs to build middleware solutions for enterprise and distributed applications
⦁ Understand middleware designs such as event-based and message-driven web services
⦁ Learn to design and maintain large-scale systems and vendor disputes
▶Who This Book Is For
Enterprise architects, designers, developers, and programmers who are interested in learning how to build robust middleware solutions for enterprise software will find this book useful. Prior knowledge of Java EE is essential
▶What this book covers
⦁ Chapter 1, Delving into Java EE 8, explores the Java EE 88 APIs and the awesome new features added since the previous version. Moreover, it shows you what software and tools we will use throughout the chapters of this book, and how to download, install, and use them.
⦁ Chapter 2, Dependency Injection Using CDI 2.0, teaches you about the dependency management problem and how the CDI API provides a complete and easy-to-use framework to manage your enterprise-level dependencies.
⦁ Chapter 3, Accessing the Database with JPA 2.1, allows you to manipulate the most important part of enterprise applications—.the database. The Java Persistence API provides a mature solution for accessing your data, eliminating the gap between your relational database model and application object-oriented models by implementing the object-to-relational mappings technique.
⦁ Chapter 4, Validating Data with Bean Validation 2.0, explores how to handle a common and important aspect of your enterprise application, data validation. With the bean validation API, you will be able to add all your validation rules using declarative methods, and without any verbose coding.
⦁ Chapter 5, Exposing Web Services with JAX-RS 2.1, assists you in learning about the most important API to go with your application into the cloud, JAX-RS. With JAX-RS, you will expose your business functions as RESTful services to be consumed by other applications in the cloud, including your application itself.
⦁ Chapter 6, Manipulating JSON with JSON-B 1.0, demonstrates how to serialize/deserialize JSON data, and how to customize the format and the output for your returned JSON from RESTful services.
⦁ Chapter 7, Communicating with Different Systems with JMS 2.0, outlines the difference between point-to-point (p2p) and publish-subscribe model architectures, and how you can implement both of them using JMS. You will learn how to write message-driven beans to handle messages, and you will also learn how to use programmatic communication with JMS to obtain new messages from external systems.
⦁ Chapter 8, Sending Mails with JavaMail 1.6, showcases the method to send mails from inside your middleware solution to your end users, using the JavaMail API. You will learn how to provide configuration for your SMTP server, how to include HTML in your mail, and how to include inline images inside.
⦁ Chapter 9, Securing an Application with Java Security 1.0, familiarizes you with providing user credentials and authorities from the database and how to use the different authentication mechanisms provided by the API. In addition, you will learn how to implement an OAuth system in your web services, similar to the ones used by popular services like Facebook and GitHub, providing a widely used standard for obtaining access credentials to your system. With OAuth, you can later extend your authentication mechanism to log in using external, systems such as Facebook and GitHub.
⦁ Chapter 10, Making Interactive Applications with WebSockets 1.1, presents the Web Sockets technology, how it works, and how it's used to build user-interactive real-time applications. You will learn how to build WebSockets endpoints using WebSockets 1.1 API, how to handle a live connection lifecycle method, and how to maintain client state.
⦁ Chapter 11, Writing Business Logic with EJB 3.2, explains the concept of Enterprise JavaBeans, why you should wrap your business logic inside them, and what services it provides to code. You learn about the different types of Enterprise JavaBeans and in which contexts you should use each one of them.