Petals-SE-POJO 2.0.x

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (5)

View Page History
The POJO can invoke any 'sub-service' during its processing by synchronous invocations using the {{jbiListener}} instance.
If the POJO service must reply with a message {{OUT}} or {{FAULT}}, according to the MEP, the method must build and set the message to the current exchange.
Then, the method musts return {{true}} to delegate the effective send back of the response or acknowledgment (according to the MEP) to the CDK.
The exceptions should be handled properly during the processing of the method, and set accordingly as error or fault to the exchange.
However, mishandled exceptions will be handled by the CDK as generic exceptions.
The method can create any 'sub-exchange' and send then asynchronously, with the asynchronous context as parameter.
Then the {{onExchange(Exchange exchange)}} returns {{false}}, as the response or the acknowledgment of the original exchange is not yet ready to be sent back.
Any asynchronous response from the 'sub-exchange' comes basck in the {{onAsyncExchange(Exchange subExchange, AsyncContext asyncContext)}} method. During the process of this method, the 'sub-exchange' must be handled according to the MEP, and the returns {{true}} of the method let the CDK send the 'sub-exchange' to the partner.
Once all 'sub-exchanges' are received, the 'original' exchange can be retrieve from the asynchronous context and the response or acknowledgement send back explicitly.

h3. Service Unit descriptor

The POJO JBI descriptor must contain a {{Provides}} section for each POJO to expose in the JBI bus.

AN example of the POJO SU:
\\
{table-plus}

|| Parameter || Description || Default || Required ||
| class-name | The name of the Java class to expose as a service. | {center}\-{center} | {center}Yes{center} |
{include:0 CDK Parameter scope}
{include:0 CDK Component Interceptor configuration}

{column}
{column:width=25%}