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.construct.FlowConstruct;
13  import org.mule.api.lifecycle.InitialisationException;
14  import org.mule.api.model.EntryPointResolverSet;
15  
16  /**
17   * <code>NullLifecycleAdapter</code> is a lifecycle adaptor implementation that
18   * performs no Mule lifecycle propagation to Mule service component implementations.
19   * This can be used when the service component implementation is looked up from a
20   * container and therefore has it's own lifecycle management.
21   */
22  public class NullLifecycleAdapter extends DefaultComponentLifecycleAdapter
23  {
24  
25      public NullLifecycleAdapter(Object componentObject,
26                                  JavaComponent component,
27                                  FlowConstruct flowConstruct,
28                                  EntryPointResolverSet entryPointResolver,
29                                  MuleContext muleContext) throws MuleException
30      {
31          super(componentObject, component, flowConstruct, entryPointResolver, muleContext);
32      }
33  
34      @Override
35      public void start() throws MuleException
36      {
37          // no-op
38      }
39  
40      @Override
41      public void stop() throws MuleException
42      {
43          // no-op
44      }
45  
46      @Override
47      public void dispose()
48      {
49          // no-op
50      }
51  
52      @Override
53      public boolean isStarted()
54      {
55          return true;
56      }
57  
58      @Override
59      public boolean isDisposed()
60      {
61          return false;
62      }
63  
64      @Override
65      public void initialise() throws InitialisationException
66      {
67          // no-op
68      }
69  
70  }