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      String getId();
26  
27      /**
28       * @param phase {@link Phase}
29       */
30      void addBeginSegment(Phase phase);
31  
32      /**
33       * @param phase {@link Phase}
34       */
35      void addEndSegment(Phase phase);
36  
37      /**
38       * @param component The component.
39       * @param manager The {@link ComponentManager}
40       * @throws PhaseExecutionException in case of an error.
41       * @deprecated
42       */
43      void start(Object component, ComponentManager manager) throws PhaseExecutionException;
44  
45      /**
46       * @param component The component.
47       * @param manager The {@link ComponentManager}
48       * @param realm The {@link ClassRealm}.
49       * @throws PhaseExecutionException in case of an error.
50       */
51      void start(Object component, ComponentManager manager, ClassRealm realm) throws PhaseExecutionException;
52  
53      /**
54       * @param component The component.
55       * @param manager The {@link ComponentManager}
56       * @throws PhaseExecutionException in case of an error.
57       * @deprecated
58       */
59      void end(Object component, ComponentManager manager) throws PhaseExecutionException;
60  
61      /**
62       *
63       * @param component The component.
64       * @param manager The {@link ComponentManager}
65       * @param componentContextRealm the realm used to create the component, which may not be the component's realm; this
66       *            component could have requirements that were satisfied using components from this realm. It could be
67       *            used to lookup the same manager components that were used to start the component.
68       * @throws PhaseExecutionException in case of an error.
69       */
70      void end(Object component, ComponentManager manager, ClassRealm componentContextRealm)
71              throws PhaseExecutionException;
72  
73      /**
74       * initialize.
75       */
76      void initialize();
77  }