Xitrum internals

1,645 views
1,491 views

Published on

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

No Downloads
Views
Total views
1,645
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Xitrum internals

  1. 1. Xitrum Internals 3.0
  2. 2. Handler architecture based on Netty 4 Request (Inbound) Response (Outbound) ServerSsl Aggregates HttpObjects (headers and contents) to make Xitrum HandlerEnv; all Xitrum handlers work with HandlerEnv Request2Env ChunkedWrite NoPipelining Env2Response SetCORS BasicAuth OPTIONSResponse PublicFileServer FixiOS6SafariPOST PublicResourceServer Serves resource files in classpath (and JAR files) HttpResponseEncoder BaseUrlRemover Serves static files in public directory HttpRequestDecoder XSendFile UriParser XSendResource MethodOverrider Selects and calls action (see next slide) Converts Xitrum HandlerEnv to Netty’s FullHttpResponse Shortcut may happen (action will not be called at Dispatcher) ResponseCacher Dispatcher BadClientSilencer Catches all errors These 4 handlers are provided by Netty; the others are created by Xitrum Action#execute respondText, respondVi ew, respondFile, respondBinary etc.
  3. 3. Routing • Route collection: At startup, Xitrum automatically collects all routes specified by annotations @GET(“hello”), @POST(“hi”) etc. • Routing: At “Dispatcher” (see previous slide), the an instance of the specified action class is created and its “execute” method is called.

×