Axis2 Pillars : [ flows, phases, handlers, and modules ]



Flows

Flow is the collection of phases in the Axis2 architecture. There are two flows Axis2 engine has two flows based on the message invocation patterns, 
  1. In-Flow - which is invoked when the engine receives a message
  2. Out-Flow - which is invoked on engine sends the message. 
These flows are not in object or structure on real implementations.  The order in which the phases should be put together to form a flow can be configured in axis2.xml configuration.

Phases

Axis2 engine invokes in the phases which they are placed in flow. 

Axis2 have predefined phases . They also configured in the configuration file axis2.xml

Phases in Flows
PREDEFINED PHASES
The Phases are deined on the <phaseOrder> element in axis2.xml

User also can add user defined pahses on axis2.xml , but it should be after the post dispatch phase. The example user defined configuration is as follows,




Phase Rules

The main idea of phase rules is to correctly locate a handler relatively to one another inside a phase.

Characterizing a phase rule can be based on one more of the following properties that will be discussed below:

  • Phase name: Name of the phase that the handler must place
  • Phase first (phaseFirst): The first handler of the phase
  • Phase Last (phaseLast): The last handler of the phase
  • Before (before): Should be positioned before a given handler
  • After (after): Should be positioned after a given handler
  • Before and after: Should placed between given two handlers

Handlers

They are small unit invocations , when the phases is invoked. Each handlers within the phase will be invoked. 

An example for handler is :
AddressingInHandler is places in the predispatch phase in in-flow - it deals with the incoming addressing headers in request. 
AddressingOutHeader is places in the message out phase in out-flow and it prepare out going response message headers and addresses.




Module

Collection of handlers with its configurations are so called modules. Modules enable the user of Axis2 to adding new handlers and phases on their desire. 

when configuring the module user add the module to the pedefined phase of Axis2 Engine. 

First for the all handlers axis2_handler interface needs to be implemented. This means the following signature need to be implemented.

Once the handler is implemented, the module need to implement to API calls as follows




engine looking the above implemented functions when loading and unloading the module. Once the above works are ready then they are compiled with the shared library. In order to use the module configuration file is also required. The following is the sample configuration file WS-Addressing scenario.


Module Handlers into Phases


Comments

Popular posts from this blog

Missionaries & Canibal Problem in AI using Pro Log

Hide the navigation bar in jHipster Angular 2

Spring Boot - No Need to Restart the Development Server for Each Time