1   /*
2    * $Id: Banana.java 10787 2008-02-12 18:51:50Z dfeist $
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.tck.testmodels.fruit;
12  
13  import java.util.EventObject;
14  
15  import org.apache.commons.logging.Log;
16  import org.apache.commons.logging.LogFactory;
17  
18  public class Banana implements Fruit
19  {
20      /**
21       * Serial version
22       */
23      private static final long serialVersionUID = -1371515374040436874L;
24  
25      /**
26       * logger used by this class
27       */
28      private static final Log logger = LogFactory.getLog(Banana.class);
29  
30      private boolean peeled = false;
31      private boolean bitten = false;
32  
33      public void peel()
34      {
35          peeled = true;
36      }
37  
38      public void peelEvent(EventObject e)
39      {
40          logger.debug("Banana got peel event in peelEvent(EventObject)! MuleEvent says: "
41                          + e.getSource().toString());
42          peel();
43      }
44  
45      public boolean isPeeled()
46      {
47          return peeled;
48      }
49  
50      public void bite()
51      {
52          bitten = true;
53      }
54  
55      public boolean isBitten()
56      {
57          return bitten;
58      }
59  }