View Javadoc

1   /*
2    * $Id: FloridaSunnyOrangeFactoryBean.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 org.springframework.beans.factory.FactoryBean;
14  
15  /**
16   * A Spring FactoryBean implementation for unit testing.
17   */
18  public class FloridaSunnyOrangeFactoryBean implements FactoryBean
19  {
20      Integer segments = new Integer(10);
21      Double radius = new Double(4.34);
22      
23      public Object getObject() throws Exception
24      {
25          return new Orange(segments, radius, "Florida Sunny");
26      }
27  
28      public Class getObjectType()
29      {
30          return Orange.class;
31      }
32  
33      public boolean isSingleton()
34      {
35          return false;
36      }
37  
38      public Double getRadius()
39      {
40          return radius;
41      }
42  
43      public void setRadius(Double radius)
44      {
45          this.radius = radius;
46      }
47  
48      public Integer getSegments()
49      {
50          return segments;
51      }
52  
53      public void setSegments(Integer segments)
54      {
55          this.segments = segments;
56      }
57  }