KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > tck > testmodels > fruit > Kiwi


1 /*
2  * $Id: Kiwi.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.tck.testmodels.fruit;
12
13 import org.mule.umo.UMOEventContext;
14
15 /**
16  * A test object not implementing Callable, but having a matching method accepting
17  * UMOEventContext.
18  */

19 public class Kiwi implements Fruit
20 {
21     /**
22      * Serial version
23      */

24     private static final long serialVersionUID = -1468423665948468954L;
25
26     private boolean bitten;
27
28     public void handle(UMOEventContext eventContext) throws Exception JavaDoc
29     {
30         final Object JavaDoc payload = eventContext.getTransformedMessage();
31         if (payload instanceof FruitLover)
32         {
33             this.bite();
34         }
35     }
36
37     public void bite()
38     {
39         this.bitten = true;
40     }
41
42     public boolean isBitten()
43     {
44         return this.bitten;
45     }
46 }
47
Popular Tags