KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > extras > client > AbstractEventTransformer


1 /*
2  * $Id: AbstractEventTransformer.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.extras.client;
12
13 import org.mule.config.MuleProperties;
14 import org.mule.transformers.AbstractTransformer;
15 import org.mule.umo.UMOMessage;
16 import org.mule.umo.transformer.TransformerException;
17
18 import java.lang.reflect.Method JavaDoc;
19
20 /**
21  * <code>AbstractEventTransformer</code> adds support for adding method details to
22  * the result message.
23  *
24  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
25  * @version $Revision: 3798 $
26  */

27
28 public abstract class AbstractEventTransformer extends AbstractTransformer
29 {
30     protected AbstractEventTransformer()
31     {
32         setReturnClass(UMOMessage.class);
33     }
34
35     public UMOMessage transform(Object JavaDoc src, Method JavaDoc method) throws TransformerException
36     {
37         UMOMessage message = (UMOMessage)transform(src);
38         message.setProperty(MuleProperties.MULE_METHOD_PROPERTY, method.getName());
39         return message;
40     }
41 }
42
Popular Tags