View Javadoc

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