1 package org.codehaus.plexus.component.manager;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.util.concurrent.atomic.AtomicLong;
20
21 import org.codehaus.plexus.MutablePlexusContainer;
22 import org.codehaus.plexus.classworlds.realm.ClassRealm;
23 import org.codehaus.plexus.component.factory.ComponentInstantiationException;
24 import org.codehaus.plexus.component.repository.ComponentDescriptor;
25 import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
26 import org.codehaus.plexus.lifecycle.LifecycleHandler;
27 import org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException;
28
29
30
31
32
33
34
35
36
37
38 public interface ComponentManager<T> {
39 String ROLE = ComponentManager.class.getName();
40
41
42
43
44 AtomicLong NEXT_START_ID = new AtomicLong(1);
45
46 int getConnections();
47
48
49
50
51
52 LifecycleHandler getLifecycleHandler();
53
54 void dispose() throws ComponentLifecycleException;
55
56 void release(Object component) throws ComponentLifecycleException;
57
58 T getComponent() throws ComponentInstantiationException, ComponentLifecycleException;
59
60 ComponentDescriptor<T> getComponentDescriptor();
61
62 Class<? extends T> getType();
63
64 String getRole();
65
66 String getRoleHint();
67
68 MutablePlexusContainer getContainer();
69
70 void dissociateComponentRealm(ClassRealm realm) throws ComponentLifecycleException;
71
72 ClassRealm getRealm();
73
74 void start(Object component) throws PhaseExecutionException;
75
76
77
78
79
80 long getStartId();
81 }