KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: Banana.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.apache.commons.logging.Log;
14 import org.apache.commons.logging.LogFactory;
15
16 import java.util.EventObject JavaDoc;
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 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 JavaDoc e)
39     {
40         logger.debug("Banana got peel event in peelEvent(EventObject)! Event 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 }
60
Popular Tags