View Javadoc
1   package org.codehaus.plexus;
2   
3   import java.net.URL;
4   import java.util.List;
5   import java.util.Map;
6   
7   import org.codehaus.plexus.classworlds.ClassWorld;
8   import org.codehaus.plexus.classworlds.realm.ClassRealm;
9   import org.codehaus.plexus.component.discovery.ComponentDiscoverer;
10  import org.codehaus.plexus.component.discovery.ComponentDiscovererManager;
11  import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
12  import org.codehaus.plexus.component.factory.ComponentFactoryManager;
13  import org.codehaus.plexus.component.repository.ComponentRepository;
14  import org.codehaus.plexus.configuration.source.ConfigurationSource;
15  import org.codehaus.plexus.container.initialization.ContainerInitializationPhase;
16  import org.codehaus.plexus.lifecycle.LifecycleHandler;
17  import org.codehaus.plexus.lifecycle.LifecycleHandlerManager;
18  
19  /**
20   * @author Jason van Zyl
21   */
22  public interface ContainerConfiguration {
23      ContainerConfiguration setName(String name);
24  
25      String getName();
26  
27      ContainerConfiguration setContext(Map<Object, Object> context);
28  
29      Map<Object, Object> getContext();
30  
31      ContainerConfiguration setClassWorld(ClassWorld classWorld);
32  
33      ClassWorld getClassWorld();
34  
35      ContainerConfiguration setRealm(ClassRealm realm);
36  
37      ClassRealm getRealm();
38  
39      //
40      // Configuration
41      //
42      ContainerConfiguration setContainerConfiguration(String configuration);
43  
44      String getContainerConfiguration();
45  
46      ContainerConfiguration setContainerConfigurationURL(URL configuration);
47  
48      URL getContainerConfigurationURL();
49  
50      // Programmatic Container Initialization and Setup
51  
52      // Much of this setup and initialization can be completely hidden. It's probably not likely
53      // someone will need to change these core components, but rather adding things like different
54      // factories, and component managers.
55  
56      // Container initialization phases
57  
58      ContainerInitializationPhase[] getInitializationPhases();
59  
60      // Component lookup manager
61  
62      // Component discoverer manager
63  
64      ContainerConfiguration addComponentDiscoverer(ComponentDiscoverer componentDiscoverer);
65  
66      ContainerConfiguration addComponentDiscoveryListener(ComponentDiscoveryListener componentDiscoveryListener);
67  
68      ContainerConfiguration setComponentDiscovererManager(ComponentDiscovererManager componentDiscovererManager);
69  
70      ComponentDiscovererManager getComponentDiscovererManager();
71  
72      // Component factory manager
73  
74      ContainerConfiguration setComponentFactoryManager(ComponentFactoryManager componentFactoryManager);
75  
76      ComponentFactoryManager getComponentFactoryManager();
77  
78      // Component manager manager
79  
80      // Component repository
81  
82      ContainerConfiguration setComponentRepository(ComponentRepository componentRepository);
83  
84      ComponentRepository getComponentRepository();
85  
86      // Component composer
87  
88      // Lifecycle handler manager
89  
90      ContainerConfiguration addLifecycleHandler(LifecycleHandler lifecycleHandler);
91  
92      ContainerConfiguration setLifecycleHandlerManager(LifecycleHandlerManager lifecycleHandlerManager);
93  
94      LifecycleHandlerManager getLifecycleHandlerManager();
95  
96      // Configuration Sources
97  
98      ContainerConfiguration setConfigurationSource(ConfigurationSource configurationSource);
99  
100     ConfigurationSource getConfigurationSource();
101 
102     ContainerConfiguration addComponentDiscoverer(Class<?> componentDiscoverer);
103 
104     ContainerConfiguration addComponentDiscoveryListener(Class<?> componentDiscoveryListener);
105 
106     List<Class> getComponentDiscoverers();
107 
108     List<Class> getComponentDiscoveryListeners();
109 }