org.osesb.msgrouting.test.deployabletestpackage2
Class CreditRatingSOAPClientPipelineStage

java.lang.Object
  extended by org.osesb.messagepipeline.PipelineStage
      extended by org.osesb.messagepipeline.builtinstages.SOAPPipelineStage
          extended by org.osesb.messagepipeline.builtinstages.SOAPClientPipelineStage_2
              extended by org.osesb.msgrouting.test.deployabletestpackage2.CreditRatingSOAPClientPipelineStage

public class CreditRatingSOAPClientPipelineStage
extends SOAPClientPipelineStage_2

CreditRatingSOAPClientPipelineStage extends SOAPClientPipelineStage_2 and 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.

The service method signature is: public int getCreditRating() throws Exception;

getCreditRating() generates a random number between 0 and 5 for the credit rating. If the random credit rating is 0, then getCreditRating() throws an Exception indicating that the getCreditRating() service could not determine a credit rating.


Field Summary
 
Fields inherited from class org.osesb.messagepipeline.builtinstages.SOAPPipelineStage
jaxrpcClient, jaxrpcClientPoolKey
 
Fields inherited from class org.osesb.messagepipeline.PipelineStage
log, messagePipelineContext, nextStage, parentMessagePipeline, pipelineStageConfiguration, previousStage, thisClassName
 
Constructor Summary
CreditRatingSOAPClientPipelineStage(MessagePipeline parentMessagePipeline, PipelineStageConfiguration pipelineStageConfiguration)
          Creates a new instance of CreditRatingSOAPClientPipelineStage.
 
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.builtinstages.SOAPClientPipelineStage_2
commit, rollback
 
Methods inherited from class org.osesb.messagepipeline.builtinstages.SOAPPipelineStage
beingDroppedFromPool, constructEAIMessageFromSOAPResponse, getJAXRPCClient, loadJAXRPCClientSupportClass, stageProcessingComplete, stageProcessingStarting
 
Methods inherited from class org.osesb.messagepipeline.PipelineStage
getMessagePipelineContext, getNextStage, getParentMessagePipeline, getPipelineStageConfiguration, getPreviousStage, handlePipelineException, handlePipelineException, logMessage, propagate, setNextStage, setOutputMessage, setPreviousStage, setResultMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreditRatingSOAPClientPipelineStage

public CreditRatingSOAPClientPipelineStage(MessagePipeline parentMessagePipeline,
                                           PipelineStageConfiguration pipelineStageConfiguration)
                                    throws java.lang.Exception
Creates a new instance of CreditRatingSOAPClientPipelineStage.

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.
Method Detail

runStage

public boolean runStage(EAIMessage eaiMessage)
                 throws PipelineStageException
Run PipelineStage logic.

runStage() does not use or modify the current MessagePipline message.

  1. Invoke 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.
  2. Retrieve the new credit rating from the MessagePipelineContext.
  3. Set a MessagePipelineContext variable for a subsequent XMLUpdaterPipelineStage named 'AddCreditRatingElementPipelineStage' that updates the loanApplicationXMLMessage.

Overrides:
runStage in class SOAPClientPipelineStage_2
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