Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Create and Deploy Java EE 8 Apps on Docker and Kubernetes
Rating: 4.2 out of 5(52 ratings)
540 students

Create and Deploy Java EE 8 Apps on Docker and Kubernetes

Learn how to build, package, and deploy your Java EE 8 applications on Docker and Kubernetes
Last updated 7/2018
English

What you'll learn

  • Implement domain business logic using core Java EE components
  • Realize HTTP communication using JAX-RS
  • Configure enterprise applications using standard APIs
  • Package, distribute, and run applications in Docker containers
  • Install and configure containerized Java EE application servers
  • Deploy enterprise applications as Kubernetes pods, deployments, and services
  • Configure containerized and orchestrated applications

Course content

2 sections64 lectures6h 5m total length
  • The Course Overview3:52

    This video will give you an overview about the course.

  • Implementing domain business logic in Java EE8:59

    The video shows how to implement business domain logic in Java EE and plain Java. It covers how Java EE encourages business-oriented solutions. Basic Java EE APIs is introduced.

    • Define business domain classes, their properties and relations in plain Java
    • Define a business boundary which implements the use cases
    • Delegate complex business logic to injected beans 
  • EJBs and CDI managed beans6:34

    The video shows the differences between the EJB and CDI APIs. It covers when to use which and what needs to be done in order to setup the managed beans.

    • Comprehend the main differences between EJBs and CDI managed beans
    • Comprehend the similarities in the usage of EJBs and CDI managed beans
    • Setup a basic beans.xml to configure CDI for injection of all beans 
  • CDI producers2:55

    The video shows CDI producers, their power and how to define and use them.

    • Inject a component that is not a managed bean or that needs more flexibility
    • Define CDI producer methods or producer fields
    • Comprehend the similarity in using and injecting beans and produced values 
  • Qualifiers3:31

    The video shows the necessity of and how to define and use CDI qualifiers. It covers how to define custom qualifier annotations.

    • Identify that an injected value cannot be identified unambiguously
    • Bind CDI producers to injection points using qualifiers
    • Define custom qualifier annotations that allow type-safety 
  • Scopes4:59

    The video explains the different scopes or managed beans. It covers both EJB and CDI, their differences and similarities.

    • Comprehend the EJB stateless, stateful and singleton scope
    • Injecting CDI managed beans without scope definitions results in the dependent scope
    • Define CDI scopes on the bean or producer definitions to modify the bean’s scope and life cycle 
  • Events4:45

    The video explains how to model and implement domain events using CDI. CDI comes with a powerful eventing mechanism which allows to decouple event creation from event handling.

    • Define business-motivated domain events as plain Java classes
    • Inject and fire the event during the business process execution using CDI
    • Define an event handling mechanism that processes the fired events 
  • JAX-RS resources7:05

    This video shows how to define JAX-RS resources that make an Java EE application accessible via HTTP. It covers how JAX-RS applications are bootstrapped and how Java types are translated into HTTP payloads.

    • Set up the JAX-RS application by configuring the base application path
    • Define a JAX-RS resources, a facade to the business boundary using the JAX-RS annotations
    • Produce and accept the HTTP payloads in the desired content types. JAX-RS will automatically marshal the Java types 
  • Integrating JSON-B2:02

    This video shows how to declaratively marshal Java types to JSON definitions and back. It covers how JAX-RS integrates with JSON-B definitions out of the box.

    • Customize the default Java type to/from JSON mapping via JSON-B annotations
    • Use JSON-B to marshal Java types by defining JAX-RS resources to produce or accept JSON
    • Declaratively enhance or change the Java type definitions if required 
  • Integrating JSON-P4:37

    This video shows how to programmatically marshal Java types to JSON definitions and back using JSON-P. It covers how JAX-RS integrates with JSON-P.

    • Identify JSON mappings that are not sufficiently covered by JSON-B
    • Define JSON structure creation programmatically using the JSON-P builder API
    • Integrate JSON-P types with JAX-RS resources for both request and response bodies. 
  • Custom HTTP responses6:11

    This video shows how to send custom HTTP responses with JAX-RS. Examples for custom responses are HTTP status codes or header fields.

    • Use the Response type from JAX-RS to build custom HTTP responses.
    • Send different status codes if the default statuses don’t match your requirements
    • Use the UriInfo context object to build URIs that point to your resources 
  • Validating communication5:19

    This video shows how to validate HTTP messages using Bean Validation and JAX-RS. It covers how to define custom validation constraints that match the application business logic.

    • Use the @Valid annotation to instruct JAX-RS to validate Java objects
    • Define Bean Validation annotations on the Java types that need to be validated
    • Define custom validation constraint annotations to implement custom validation logic 
  • Exception handling5:25

    This video shows how to handle exception that occur within our application in JAX-RS.

    • Implement the ExceptionMapper type with the custom exception mapping logic
    • Define the ExceptionMapper for a specific exception and activate it via @Provider
    • Define a ConstraintViolationExceptionMapper to map a failed validation to a custom HTTP response 
  • Mapping domain entities with JPA6:05

    This video shows how JPA is used to map domain entities to the database. It covers how to bootstrap JPA for enterprise applications and how to declaratively define persistence mappings.

    • Define a persistence.xml mapping file and a one or more persistence units for your application
    • Map domain entities using JPA annotations such as @Entity
    • Use the EntityManager type to persist and acquire persisted entities 
  • Entity relations7:04

    This video shows how to define entity relations that are part of the business domain. It covers which JPA definitions are required to specify the relation mapping in the database tables.

    • Define the relation to enum values using @Enumerated
    • Define the relation to other entities using @OneToOne, @OneToMany, @ManyToOne and @ManyToMany
    • Define join columns and their properties via the annotation properties 
  • Datasources2:42

    This video shows how to define and use application server datasources. The datasources are used to access relational databases.

    • Use the default datasource of the application server if only one database is required
    • Define persistence units with datasource JDNI names for multiple databases
    • Specify the datasource properties in the application server configuration 
  • Transactions5:07

    This video shows how to use technical transaction that handle database queries. It covers how exceptions that occur during the active transaction are handled.

    • Use the default EJB mechanism that starts technical transactions for business methods
    • Use the transaction type definition to control the logical flow of transactions
    • Define rollback behaviors for specific exception types 
  • Interceptors3:16

    This video shows how to define and bind interceptors. Interceptors are used to interrupt the execution of methods and inject custom logic.

    • Define an Interceptor class and bind it to a business method using @Interceptors
    • Implement the custom interception logic in the interceptor method
    • Inject and use managed beans in the interceptor class 
  • Binding custom interceptors5:48

    This video shows how custom interceptors are bound and activated via custom interceptor binding annotations. This approach minimizes coupling in our application.

    • Define an interceptor binding annotation with @InterceptorBinding
    • Annotate the interceptor and the business method or bean with the interceptor binding
    • Activate the bound interceptor via beans.xml or a specified priority 
  • Configuring Java EE applications5:40

    This video shows how to configure Java Enterprise application via CDI. It covers how CDI producers fulfill to define custom configuration requirements. The example configuration load the configured values from an application properties file.

    • Identify and inject configured values into managed beans
    • Define CDI producer methods that lookup and expose configuration values
    • Specify custom qualifiers to further qualify the desired configuration values 
  • Caching6:22

    This video shows how and when to use caching. It covers how to build a simple yet effective custom cache and includes an outlook to the JCache API.

    • Identify and evaluate the requirements for caching first
    • Define custom caches via application scoped or singleton beans
    • Use JCache or vendor-specific solutions if custom implementations are not sufficient or become too complex 
  • Logging7:10

    This video shows how and when to include logging in enterprise applications. It covers the shortcomings of traditional logging, which other solutions are reasonable and possible.

    • Identify and evaluate the motivation for logging and look for potential different solutions
    • Identify and simplify log invocations using custom log facades
    • Log errors that can not be recovered from using the custom log facade 
  • Asynchronous EJBs4:28

    This video shows how to define asynchronous EJB methods. It covers the possibilities and implications of asynchronous execution within EJBs.

    • Annotate EJB business methods with @Asynchronous to invoke them asynchronously
    • Define Future return types if a direct result is required
    • Beware of scopes of managed beans in asynchronous methods 
  • Asynchronous CDI events3:15

    This video shows how to define and fire asynchronous CDI events with both asynchronous EJB methods and CDI definitions.

    • Use asynchronous EJB methods to handle CDI events asynchronously
    • Define and fire CDI events using the fireAsync method
    • Observe events that are fired via the fireAsync method with @ObservesAsync 
  • Managed threads3:48

    This video shows what container-managed threads are, what the threading requirements for enterprise applications are and which Java EE functionalities support developers. It covers the required APIs to use container-managed threads.

    • Acquire and use the ManagedExecutorService to execute functionality within its own thread
    • Avoid using application-managed threads or functionality that starts own threads, such as parallel streams
    • Use CompletableFutures with the acquired ManagedExecutorService to implement more complex functionality 
  • Timers4:35

    This video shows how to define application timers via EJBs and CDI managed beans. It covers which APIs to use to define timers and scheduled jobs.

    • Use the @Schedule annotation to define cron-like method invocations
    • Beware of bean scopes when defining application timers
    • Acquire and use the ManagedScheduledExecutorService to define scheduled jobs on CDI managed beans 
  • Asynchronous JAX-RS resources7:03

    This video shows the motivations behind asynchronous JAX-RS resources and how to make use of them. It covers common use cases for this functionality.

    • Define a @Suspended AsyncResponse to suspend the HTTP request thread
    • Acquire and use the ManagedExecutorService to execute the business logic
    • Alternatively, use asynchronous EJB methods or define JAX-RS resources with a CompletionStage return type 
  • Accessing HTTP using JAX-RS8:46

    This video shows how to access HTTP resources using the JAX-RS client. It covers how web targets are defined and used to send requests and read responses from and to Java types, respectively.

    • Create an instance of the JAX-RS client using the ClientBuilder functionality
    • Define a WebTarget that accesses the HTTP resources
    • Use the invocation builder functionality to invoke targets and read responses 
  • Extended client usage4:33

    This video shows how to use the JAX-RS client to retrieve collection resources and automatically map them to corresponding Java collection types. It also covers path templates.

    • Use the JSON-P JsonArray type to conveniently map JSON collection responses
    • Use JAX-RS’es GenericType to retrieve Java collection response types
    • Use the path template functionality of WebTargets to define and resolve path variables 
  • Making HTTP clients resilient5:10

    This video shows how to handle client exceptions and potential errors. It also covers how to make client invocations more resilient by defining different type of timeouts.

    • Beware of potential runtime exceptions that can occur on client invocations
    • Potentially use Interceptors to catch client exceptions
    • Define connection and read timeouts to make HTTP invocations resilient 
  • Asynchronous, reactive clients7:26

    This video shows how to use the asynchronous and reactive JAX-RS client functionality. It covers how to use the CompletableFuture type in client invocations and the rx invocation builder.

    • Use CompletableFutures to manually wrap client invocations into separate execution paths
    • Use JAX-RS’es rx invocation builder to conveniently receive a CompletionStage return type
    • Combine the CompletionStage or CompletableFuture types to compute the desired results 
  • Implementing SSE resources with JAX-RS8:26

    This video shows how to use the JAX-RS API to define and implement Server-Sent Events (SSE) resources. It covers the required JAX-RS types and APIs.

    • Define SSE JAX-RS resource methods using the SSE Java types
    • Use the Sse, SseBroadcaster and SseEventSink types to send SSE messages to connected clients
    • Manually resend events using the last event ID, if required 
  • Server-sent event clients3:58

    This video shows how to consume Server-Sent Events (SSE) resources both on the command line and by using the JAX-RS SSE client. It also cover the last event ID HTTP header that controls which data is being resent.

    • Use the SseEventSource type to access SSE resources from web targets
    • Register an event consumer that will be invoked on arriving events
    • Open the connection to the created SseEventSource 
  • Implementing WebSocket server endpoints6:45

    This video shows how to use the Java EE’s WebSocket API to define server endpoints. It also covers how to define MessageDecoders and Encoders.

    • Define a ServerEndpoint that will be invoked for WebSocket connections
    • Define corresponding MessageDecoders and Encoders for the message Java types
    • Use the bidirectional remote object to respond to messages 
  • Accessing WebSocket endpoints5:41

    This video shows how to access WebSocket endpoints by the WebSocket API. It also covers how client connections are bootstrapped.

    • Define a ClientEndpoint that will be invoked for WebSocket connections
    • Define corresponding MessageDecoders and Encoders for the message Java types
    • Programmatically create a client to initialize the WebSocket connection 
  • Test Your Knowledge

Requirements

  • Familiarity with Java is assumed.

Description

Java EE provides a standard set of specifications that can be used to develop standardized applications, independent of the vendor. Enterprise applications do not change that often, and hence we need a robust platform such as Java EE to ensure sustainability. A lot of enterprises migrate their runtime environments to platforms that are based on Docker and Kubernetes. Container technologies, in combination with orchestration, provide significant advantages in the way companies deploy and operate their enterprise software.

This comprehensive 2-in-1 course teaches you how to develop enterprise applications using the Java Enterprise platform and modern APIs. It covers each and every concept of the Java EE platform with the help of practical examples making it easy for you to understand and implement in your own applications. You will also learn to package and deploy Java EE 8 applications on Docker and Kubernetes.

This training program includes 2 complete courses, carefully chosen to give you the most comprehensive training possible.

The first course, Learning Java EE 8, course starts off by exploring the core Java EE components. You will then learn about HTTP endpoints. You will also learn how to map domain entities with JPA. Next, you will understand how interceptors realize technical cross-cutting concerns. You will learn to access external systems. Finally, you will learn about the asynchronous communication protocol.

The second course, Containerizing Java EE 8 Apps Using Docker and Kubernetes, begins with a practical approach to show you how you can use Docker in Java EE 8 and how to troubleshoot containers. You will then learn learn how to run Java EE in containers. You will also learn to configure containerized applications. Next, you will learn to orchestrate containers using Kubernetes. Finally, you’ll be able to integrate Java EE applications into Docker and Kubernetes.

By the end of this Learning Path, you'll be able to build, package, and deploy your Java EE 8 applications on Docker and Kubernetes.

Meet Your Expert(s):

We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth:

  • Sebastian Daschner is a Java freelancer working as a consultant, author, and a trainer. He is enthusiastic about programming and Java (EE). He is the author of the book Architecting Modern Java EE Applications. He participates in the JCP, helping to form the future standards of Java EE such as serving in the JAX-RS, JSON-P, and Config Expert Groups, and collaborating on various open source projects. For his contributions to the Java community and ecosystem, he was recognized as a Java Champion, Oracle Developer Champion, and double 2016 JavaOneRockstar. He is a regular speaker at international IT conferences such as JavaLand, JavaOne, or Jfokus.

Who this course is for:

  • This learning path targets software developers and architects who face the opportunity and challenge of creating and moving enterprise applications to modern, containerized environments. Developers who want to learn the nuts and bolts of putting applications into containers will also benefit from this course.