KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > samples > loanbroker > esb > transformers > LoanQuoteRequestToCreditProfileArgs


1 /*
2  * $Id: LoanQuoteRequestToCreditProfileArgs.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.samples.loanbroker.esb.transformers;
12
13 import org.mule.samples.loanbroker.esb.message.LoanQuoteRequest;
14 import org.mule.transformers.AbstractTransformer;
15 import org.mule.umo.transformer.TransformerException;
16
17 /**
18  * Extracts the customer information from the request into an array of arguments used
19  * to invoke the Credit Agency Session bean
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24 public class LoanQuoteRequestToCreditProfileArgs extends AbstractTransformer
25 {
26     /**
27      * Serial version
28      */

29     private static final long serialVersionUID = -1371055512935227423L;
30
31     public LoanQuoteRequestToCreditProfileArgs()
32     {
33         registerSourceType(LoanQuoteRequest.class);
34     }
35
36     public Object JavaDoc doTransform(Object JavaDoc src, String JavaDoc encoding) throws TransformerException
37     {
38
39         LoanQuoteRequest request = (LoanQuoteRequest)src;
40         Object JavaDoc[] args = new Object JavaDoc[2];
41         args[0] = request.getCustomerRequest().getCustomer().getName();
42         args[1] = new Integer JavaDoc(request.getCustomerRequest().getCustomer().getSsn());
43         return args;
44     }
45 }
46
Popular Tags