[JAVA] Introduction to Ratpack (2)-Architecture

Ratpack introductory series

  1. Introduction to Ratpack (1) --What is Ratpack
  2. Introduction to Ratpack (2) --Architecture
  3. Introduction to Ratpack (3) --Hello world detailed explanation
  4. Introduction to Ratpack (4) --Routing & Static Content
  5. Introduction to Ratpack (5) --Json & Registry
  6. Introduction to Ratpack (6) --Promise
  7. Introduction to Ratpack (7) --Guice & Spring
  8. Introduction to Ratpack (8) --Session
  9. Introduction to Ratpack (9) --Thymeleaf

Ratpack architecture

Here's an overview of the main Ratpack classes. Will be added at any time.

RatpackServer

A basic class for starting a server.

ServerConfig

A class that organizes settings (ports, etc.) related to the server.

Service

An interface that provides hooks in the life cycle of a Ratpack server. Note that there is an interface with the same name that is @Deprecated.

Registry

A class used to pass information between Handlers. ... it doesn't seem to be very important to write this, but the server itself also gets each dependency through Registry (server registry in the official manual). Therefore, each function such as Handler itself and Renderer is acquired through Registry, which is an important class that supports the flexibility of Ratpack.

An extension (https://ratpack.io/manual/current/guice.html) using Google Guice is available.

Action

It is a general-purpose functional interface for setting and so on. For example, RatpackServer.start () takes ʻAction as an argument, andRatpackServerSpec.handlers () takes ʻAction <Chain> as an argument.

Chain

A class that groups multiple handlers together. It also routes each handler.

Handler

A functional interface with a handle (Context) method that models receiving a request and returning a response. Is it something like the Java EE HttpServlet as an image? We will create a response by describing the process in the passed Context.

Context

A class that provides the "context" that accompanies each Handler call. Information such as HTTP requests is also held by this object. By calling Context.render (Object), the contents of the returned response will be created.

Promise

A class that supports asynchronous processing. Similar to JavaScript Promise. A detailed commentary article will be created.

Operation

This version does not return the value of Promise.

Blocking

A utility class for creating Promise and ʻOperation`. It is used when doing blocking IO.

Session

You need ratpack-session. This class supports sessions in Ratpack communication. Get it from Registry.get ().

BaseDir A class used to serve static assets.

Recommended Posts

Introduction to Ratpack (2)-Architecture
Introduction to Ratpack (8)-Session
Introduction to Ratpack (6) --Promise
Introduction to Ratpack (7) --Guice & Spring
Introduction to Ratpack (1) --What is Ratpack?
Introduction to Ruby 2
Introduction to SWING
Introduction to web3j
Introduction to Micronaut 1 ~ Introduction ~
[Java] Introduction to Java
Introduction to java
Introduction to Doma
Introduction to Ratpack (3) --hello world detailed explanation
Introduction to Ratpack (Extra Edition) --Ratpack written in Kotlin
Introduction to JAR files
Introduction to RSpec 1. Test, RSpec
Introduction to bit operation
Introduction to PlayFramework 2.7 ① Overview
Introduction to Android Layout
Introduction to Practical Programming
Introduction to javadoc command
Introduction to jar command
Introduction to lambda expression
Introduction to java command
Introduction to RSpec 2. RSpec setup
Introduction to Keycloak development
Introduction to javac command
Introduction to Design Patterns (Builder)
Introduction to RSpec 5. Controller specs
Introduction to RSpec 6. System specifications
Introduction to Android application development
Introduction to RSpec 3. Model specs
Introduction to Metabase ~ Environment Construction ~
(Dot installation) Introduction to Java8_Impression
Introduction to Design Patterns (Composite)
Introduction to Micronaut 2 ~ Unit test ~
Introduction to JUnit (study memo)
Introduction to Spring Boot ① ~ DI ~
[Java] Introduction to lambda expressions
Introduction to Apache Beam (2) ~ ParDo ~
[Ruby] Introduction to Ruby Error statement
Introduction to EHRbase 2-REST API
Introduction to design patterns Prototype
GitHub Actions Introduction to self-made actions
[Java] Introduction to Stream API
Introduction to Design Patterns (Iterator)
Introduction to Spring Boot Part 1
XVim2 introduction memo to Xcode12.3
Introduction to RSpec-Everyday Rails Summary-
Introduction to Design Patterns (Strategy)
[Introduction to rock-paper-scissors games] Java
Introduction to Linux Container / Docker (Part 1)
Introduction to swift practice output Chapter5
[Introduction to Java] About lambda expressions
Introduction to algorithms in java-cumulative sum
[Introduction to Java] About Stream API
Introduction to Functional Programming (Java, Javascript)
Introduction to Ruby processing system self-made
Introduction to Design Patterns (Factory Method)
Introduction to Linux Container / Docker (Part 2)
Introduction to Design Patterns (Abstract Factory)