KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: EventObjectTransformer.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.impl.MuleMessage;
14 import org.mule.umo.transformer.TransformerException;
15
16 import java.util.EventObject JavaDoc;
17
18 /**
19  * <code>EventObjectTransformer</code> converts a
20  * <code>java.util.EventObject</code> into a <code>MuleMessage</code>. This
21  * transformer is used by the MuleProxyListener to marshall events into something
22  * that Mule understands.
23  *
24  * @see MuleProxyListener
25  * @see MuleMessage
26  * @see EventObject
27  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
28  * @version $Revision: 3798 $
29  */

30
31 public class EventObjectTransformer extends AbstractEventTransformer
32 {
33     /**
34      * Serial version
35      */

36     private static final long serialVersionUID = -4724017409704797007L;
37
38     public EventObjectTransformer()
39     {
40         registerSourceType(EventObject JavaDoc.class);
41     }
42
43     public Object JavaDoc doTransform(Object JavaDoc src, String JavaDoc encoding) throws TransformerException
44     {
45         EventObject JavaDoc event = (EventObject JavaDoc)src;
46         return new MuleMessage(event.getSource());
47     }
48 }
49
Popular Tags