Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractEventTransformer |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: AbstractEventTransformer.java 7976 2007-08-21 14:26:13Z dirk.olmes $ | |
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 CPAL v1.0 | |
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; | |
19 | ||
20 | /** | |
21 | * <code>AbstractEventTransformer</code> adds support for adding method details to | |
22 | * the result message. | |
23 | */ | |
24 | ||
25 | public abstract class AbstractEventTransformer extends AbstractTransformer | |
26 | { | |
27 | protected AbstractEventTransformer() | |
28 | 0 | { |
29 | 0 | setReturnClass(UMOMessage.class); |
30 | 0 | } |
31 | ||
32 | public UMOMessage transform(Object src, Method method) throws TransformerException | |
33 | { | |
34 | 0 | UMOMessage message = (UMOMessage)transform(src); |
35 | 0 | message.setProperty(MuleProperties.MULE_METHOD_PROPERTY, method.getName()); |
36 | 0 | return message; |
37 | } | |
38 | } |