1   /*
2    * $Id: BananaFactory.java 11517 2008-03-31 21:34:19Z dirk.olmes $
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.mule.api.lifecycle.InitialisationCallback;
14  import org.mule.api.lifecycle.InitialisationException;
15  import org.mule.api.object.ObjectFactory;
16  
17  /**
18   * <code>BananaFactory</code> is a test factory that creates Bananas
19   */
20  public class BananaFactory implements ObjectFactory
21  {
22      public void initialise() throws InitialisationException
23      {
24          // nothing to do
25      }
26      
27      public void dispose()
28      {
29          // nothing to do
30      }
31  
32      public Object getInstance() throws Exception
33      {
34          return new Banana();
35      }
36  
37      public Class getObjectClass()
38      {
39          return Banana.class;
40      }
41  
42      public void addObjectInitialisationCallback(InitialisationCallback callback)
43      {
44          throw new UnsupportedOperationException();
45      }
46  
47      public boolean isSingleton()
48      {
49          return false;
50      }
51  }