Show Table of Contents
41.2. Implementing a Logical Handler
Overview
Logical handlers implement the
javax.xml.ws.handler.LogicalHandler interface. The LogicalHandler interface, shown in Example 41.1, “LogicalHandler Synopsis” passes a LogicalMessageContext object to the handleMessage() method and the handleFault() method. The context object provides access to the body of the message and to any properties set into the message exchange's context.
Example 41.1. LogicalHandler Synopsis
public interface LogicalHandler extends Handler
{
boolean handleMessage(LogicalMessageContext context);
boolean handleFault(LogicalMessageContext context);
void close(LogicalMessageContext context);
}Procedure
To implement a logical hander you do the following:
- Implement any initialization logic required by the handler.
- Implement the message handling logic.
- Implement the fault handling logic.
- Implement the logic for closing the handler when it is finished.
- Implement any logic for cleaning up the handler's resources before it is destroyed.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.