View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.tck.testmodels.fruit;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.lifecycle.InitialisationCallback;
11  import org.mule.api.lifecycle.InitialisationException;
12  import org.mule.api.object.ObjectFactory;
13  
14  /**
15   * <code>BananaFactory</code> is a test factory that creates Bananas
16   */
17  public class BananaFactory implements ObjectFactory
18  {
19      public void initialise() throws InitialisationException
20      {
21          // nothing to do
22      }
23      
24      public void dispose()
25      {
26          // nothing to do
27      }
28  
29      public Object getInstance(MuleContext muleContext) throws Exception
30      {
31          return new Banana();
32      }
33  
34      public Class<?> getObjectClass()
35      {
36          return Banana.class;
37      }
38  
39      public void addObjectInitialisationCallback(InitialisationCallback callback)
40      {
41          throw new UnsupportedOperationException();
42      }
43  
44      public boolean isSingleton()
45      {
46          return false;
47      }
48  
49      public boolean isExternallyManagedLifecycle()
50      {
51          return false;
52      }
53  
54      public boolean isAutoWireObject()
55      {
56          return false;
57      }
58  }