Context API

Passing request and context information between different layers in applications could be needed in most applications. For example, context information could include:

  • Current User

  • Current System

  • Current Module

  • Current View

  • Current Action

  • Remote Machine/Port

  • App Machine/Port

  • Current Controller

  • Current session information

And others.

In J-Framework, the context information will be automatically populated on each request in JKDefaultFilter and can be accessed using the following code segment.

JKContextFactory.getCurrentContext().getXXX();

Context information is also shared across microservices using the J-Framework-ServiceClient project.