1 package org.codehaus.plexus.personality.plexus.lifecycle.phase;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.codehaus.plexus.classworlds.realm.ClassRealm;
20 import org.codehaus.plexus.component.manager.ComponentManager;
21 import org.codehaus.plexus.configuration.PlexusConfigurationException;
22 import org.codehaus.plexus.lifecycle.phase.AbstractPhase;
23
24 public class ConfigurablePhase extends AbstractPhase {
25 public void execute(Object object, ComponentManager manager, ClassRealm lookupRealm)
26 throws PhaseExecutionException {
27 if (object instanceof Configurable) {
28 try {
29 ((Configurable) object)
30 .configure(manager.getComponentDescriptor().getConfiguration());
31 } catch (PlexusConfigurationException e) {
32 throw new PhaseExecutionException("Error occurred during phase execution", e);
33 }
34 }
35 }
36 }