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.component;
8   
9   import org.mule.api.MuleContext;
10  import org.mule.api.MuleException;
11  import org.mule.api.component.JavaComponent;
12  import org.mule.api.component.LifecycleAdapter;
13  import org.mule.api.component.LifecycleAdapterFactory;
14  import org.mule.api.construct.FlowConstruct;
15  import org.mule.api.model.EntryPointResolverSet;
16  
17  /**
18   * <code>DefaultComponentLifecycleAdapterFactory</code> creates a DefaultComponentLifecycleAdapter.  Users can
19   * implement their own LifeCycleAdapter factories to control lifecycle events on their services such
20   * as introduce other lifecycle events that are controlled by external changes.
21   *
22   * @see org.mule.api.component.LifecycleAdapter
23   * @see org.mule.api.component.LifecycleAdapterFactory
24   * @see org.mule.component.DefaultComponentLifecycleAdapter
25   * @see org.mule.component.DefaultComponentLifecycleAdapterFactory
26   */
27  public class DefaultComponentLifecycleAdapterFactory implements LifecycleAdapterFactory
28  {
29  
30      public LifecycleAdapter create(Object pojoService,
31                                     JavaComponent component,
32                                     FlowConstruct flowConstruct,
33                                     EntryPointResolverSet resolver,
34                                     MuleContext muleContext) throws MuleException
35      {
36          return new DefaultComponentLifecycleAdapter(pojoService, component, flowConstruct, resolver, muleContext);
37      }
38  
39  }