View Javadoc

1   /*
2    * $Id: BananaFactory.java 22409 2011-07-14 05:14:27Z dirk.olmes $
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      @Override
24      public void initialise() throws InitialisationException
25      {
26          // nothing to do
27      }
28  
29      @Override
30      public void dispose()
31      {
32          // nothing to do
33      }
34  
35      @Override
36      public Object getInstance(MuleContext muleContext) throws Exception
37      {
38          return new Banana();
39      }
40  
41      @Override
42      public Class<?> getObjectClass()
43      {
44          return Banana.class;
45      }
46  
47      @Override
48      public void addObjectInitialisationCallback(InitialisationCallback callback)
49      {
50          throw new UnsupportedOperationException();
51      }
52  
53      @Override
54      public boolean isSingleton()
55      {
56          return false;
57      }
58  
59      @Override
60      public boolean isExternallyManagedLifecycle()
61      {
62          return false;
63      }
64  
65      @Override
66      public boolean isAutoWireObject()
67      {
68          return false;
69      }
70  }