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.module.guice;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.tck.testmodels.fruit.Banana;
11  import org.mule.tck.testmodels.fruit.BananaFactory;
12  
13  import com.google.inject.Inject;
14  
15  /**
16   * Oooh er missus!
17   */
18  public class BananaInjectionService implements BananaServiceInterface
19  {
20      @Inject
21      private BananaFactory factory;
22  
23      @Inject
24      private MuleContext muleContext;
25  
26      public Banana doSomething(Object data) throws Exception
27      {
28          return (Banana)factory.getInstance(muleContext);
29      }
30  }