public abstract class ChoiceAwarePolicyHandler extends java.lang.Object implements MessageHandler
|Constructor and Description|
|Modifier and Type||Method and Description|
Gives the handler a message and context to operate on.
Select the policy based on the underlying SOAP message and process the message based on the selected one(s).
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean handleMessage(MessageContext context) throws com.digev.fw.exception.GException, MessageFaultException
Gives the handler a message and context to operate on. By returning true, the handler is indicating to the messaging engine that the it should continue the normal messaging flow, including the possible calling of other handlers in a chain.
By returning false, the handler is indicating to the messaging engine that the messaging flow should stop. When the handler is in the Provider role of an exchange, returning false indicates that the messaging engine should immediately respond to the Consumer with the current content of the containing exchange's out or fault message (depending on which exists). In other words it is the responsibility of the handler that returns false to ensure that an out or fault message is correctly set on the exchange that contained the in message.
If the handler throws an exception, the messaging engine will create a fault with the content of the exception and return that to the consumer. Any handlers in the Provider role of an exchange will then be invoked with the newly created fault to perform any necessary fault processing.
When the handler is in the Consumer role of an exchange, returning false just stops the message from being delivered. If the consumer is to be alerted as to why the message would not be delivered, the handler should throw an exception instead.
context- MessageContext holding the message and other information pertinent to the processing of the message, possibly provided by previously called handlers if invoked from a chain.
com.digev.fw.exception.GException- Thrown if the handler encounters an error that does not allow it to server its purpose. If the handler is in the Provider role, the content of the exception will be returned to the consumer in a fault. If the handler is in the Consumer role, the exception is reported to the caller.
MessageFaultException- Thrown if the handler detects a condition in the message that warrants the current handler processing to stop and a fault be returned. This is different than throwing a GException whereby the handler is able to complete its duties but it has detected a problem with the message (a policy violation for example).
protected abstract ChoiceAwareResult selectPoliciesAndHandleMessage(MessageContext context, java.util.List policyChoices) throws com.digev.fw.exception.GException, MessageFaultException
policyChoices- The list of
ChoiceIdentifiers representing the candidate set of policy choices that should be used to process the message
ChoiceAwareResultcontaining a list of
ChoiceIdentifiers that have been selected and used for processing the message, as well as the handler boolean result. This list should be the subset of the candidate list.
Akana, Inc. Copyright (C) 2000-2015, All rights reserved
This software is the confidential and proprietary information of Akana, Inc. and is subject to copyright protection under laws of the United States of America and other countries. The use of this software should be in accordance with the license agreement terms you entered into with Akana, Inc.