org.osesb.msgrouting.test.deployabletestpackage2
Class CreditRatingFlowControlPipelineStage
java.lang.Object
org.osesb.messagepipeline.PipelineStage
org.osesb.messagepipeline.builtinstages.FlowControlPipelineStage
org.osesb.msgrouting.test.deployabletestpackage2.CreditRatingFlowControlPipelineStage
public class CreditRatingFlowControlPipelineStage
- extends FlowControlPipelineStage
CreditRatingFlowControlPipelineStage is a FlowControlPipelineStage that configures
a single MessagePipeline to run if the customer credit rating was not defined in the
customer table of the JDBCTEST database. In this case, the MessagePipelineContext
variable named 'customerCreditRating' will be 0.
The creditRating MessagePipeline is a side branch of the main processLoanApplication
MessagePipeline that invokes a credit rating service to obtain a new credit rating
and then updates the loanApplicationXMLMessage and the customer database with the
new credit rating.
Before returning control to the main processLoanApplication MessagePipeline,
CreditRatingFlowControlPipelineStage sets the current EAIMessage for the
processLoanApplication to the XML message with the updated credit rating.
The creditRatingMessagePipeline includes the following PipelineStages:
- CreditRatingSOAPClientPipelineStage, which is a SOAPClientPipelineStage that invokes
the creditRating service, which is implemented by org.osesb.transporthandlers.test.deployabletestpackage2.soaptransporthandler.ejb20.ProcessLoanApplicationBusinessServiceBean
in the transport-handlers module. The creditRating service returns a new credit rating
for a customer. creditRatingSOAPClientPipelineStage extends SOAPClientPipelineStage_2 in order
to put the new customer credit rating on the MessagePipelineContext for a subsequent
XMLUpdaterPipelineStage that updates the loanApplicationXMLMessage.
- A XMLUpdaterPipelineStage that adds the new customer credit rating to the loanApplicationXMLMessage.
- A XMLToDatabaseUpdatePipelineStage that adds the new customer credit rating to the customer
table in the JDBCTEST database.
|
Method Summary |
static void |
main(java.lang.String[] args)
main() For testing and sandboxing. |
boolean |
runStage(EAIMessage eaiMessage)
Run PipelineStage logic. |
| Methods inherited from class org.osesb.messagepipeline.PipelineStage |
beingDroppedFromPool, commit, getMessagePipelineContext, getNextStage, getParentMessagePipeline, getPipelineStageConfiguration, getPreviousStage, handlePipelineException, handlePipelineException, logMessage, propagate, rollback, setNextStage, setOutputMessage, setPreviousStage, setResultMessage, stageProcessingComplete, stageProcessingStarting |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CreditRatingFlowControlPipelineStage
public CreditRatingFlowControlPipelineStage(MessagePipeline parentMessagePipeline,
PipelineStageConfiguration pipelineStageConfiguration)
throws java.lang.Exception
- Creates a new instance of FCEchoMessageWithRandomPipelineStageExceptionPipelineStage.
- Parameters:
parentMessagePipeline - The MessagePipeline that constructed
this PipelineStage.pipelineStageConfiguration - A PipelineStageConfiguration for
this PipelineStage.
- Throws:
java.lang.Exception - if constructed with a null parentMessagePipeline or a
null pipelineStageConfiguration.
runStage
public boolean runStage(EAIMessage eaiMessage)
throws PipelineStageException
- Run PipelineStage logic.
CreditRatingFlowControlPipelineStage is a FlowControlPipelineStage that configures
a MessagePipeline to run if the customer credit rating was not defined in the
customer table of the JDBCTEST database.
The creditRating MessagePipeline is a side branch of the main processLoanApplication
MessagePipeline that invokes a credit rating service to obtain a new credit rating
and then updates the loanApplicationXMLMessage and the customer database with the
new credit rating.
Before returning control to the main processLoanApplication MessagePipeline,
CreditRatingFlowControlPipelineStage sets the current EAIMessage for the
processLoanApplication to the XML message with the updated credit rating.
- Overrides:
runStage in class FlowControlPipelineStage
- Parameters:
eaiMessage - The EAI message, which is the output of the last PipeLineStage that invoked
setOutputMessage(), or, if this is the first PiplelineStage, then this is the EAIMessage
that the MessagePipeline was invoked with.
- Returns:
- true to continue pipeline processing or false to terminate pipeline processing.
- Throws:
a - PipelineStageException if any errors occur.
PipelineStageException
main
public static void main(java.lang.String[] args)
- main() For testing and sandboxing.
- Parameters:
args - commandline arguments