View Javadoc
1   package org.codehaus.plexus.lifecycle;
2   
3   /*
4    * Copyright 2001-2006 Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import org.codehaus.plexus.classworlds.realm.ClassRealm;
20  import org.codehaus.plexus.component.manager.ComponentManager;
21  import org.codehaus.plexus.lifecycle.phase.Phase;
22  import org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException;
23  
24  public interface LifecycleHandler
25  {
26      String getId();
27  
28      void addBeginSegment( Phase phase );
29  
30      void addEndSegment( Phase phase );
31  
32      /**
33       * @deprecated
34       */
35      void start( Object component, ComponentManager manager )
36          throws PhaseExecutionException;
37  
38      void start( Object component, ComponentManager manager, ClassRealm realm )
39          throws PhaseExecutionException;
40  
41      /**
42       * @deprecated
43       */
44      void end( Object component, ComponentManager manager )
45          throws PhaseExecutionException;
46  
47      /**
48       *
49       * @param component
50       * @param manager
51       * @param componentContextRealm the realm used to create the component, which may not be the component's realm; this
52       *            component could have requirements that were satisfied using components from this realm. It could be
53       *            used to lookup the same manager components that were used to start the component.
54       * @throws PhaseExecutionException
55       */
56      void end( Object component, ComponentManager manager, ClassRealm componentContextRealm )
57          throws PhaseExecutionException;
58  
59      void initialize();
60  }