View Javadoc

1   /*
2    * $Id: BananaFactory.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.mule.api.MuleContext;
14  import org.mule.api.lifecycle.InitialisationCallback;
15  import org.mule.api.lifecycle.InitialisationException;
16  import org.mule.api.object.ObjectFactory;
17  
18  /**
19   * <code>BananaFactory</code> is a test factory that creates Bananas
20   */
21  public class BananaFactory implements ObjectFactory
22  {
23      public void initialise() throws InitialisationException
24      {
25          // nothing to do
26      }
27      
28      public void dispose()
29      {
30          // nothing to do
31      }
32  
33      public Object getInstance(MuleContext muleContext) throws Exception
34      {
35          return new Banana();
36      }
37  
38      public Class<?> getObjectClass()
39      {
40          return Banana.class;
41      }
42  
43      public void addObjectInitialisationCallback(InitialisationCallback callback)
44      {
45          throw new UnsupportedOperationException();
46      }
47  
48      public boolean isSingleton()
49      {
50          return false;
51      }
52  
53      public boolean isExternallyManagedLifecycle()
54      {
55          return false;
56      }
57  
58      public boolean isAutoWireObject()
59      {
60          return false;
61      }
62  }