This repository has been archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
PlexusContainer.java
107 lines (72 loc) · 3.6 KB
/
PlexusContainer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*******************************************************************************
* Copyright (c) 2010-present Sonatype, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Stuart McCulloch (Sonatype, Inc.) - initial API and implementation
*
* Minimal facade required to be binary-compatible with legacy Plexus API
*******************************************************************************/
package org.codehaus.plexus;
import java.util.List;
import java.util.Map;
import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.codehaus.plexus.component.composition.CycleDetectedInComponentGraphException;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import org.codehaus.plexus.context.Context;
public interface PlexusContainer
{
Context getContext();
Object lookup( String role )
throws ComponentLookupException;
Object lookup( String role, String hint )
throws ComponentLookupException;
<T> T lookup( Class<T> role )
throws ComponentLookupException;
<T> T lookup( Class<T> role, String hint )
throws ComponentLookupException;
<T> T lookup( Class<T> type, String role, String hint )
throws ComponentLookupException;
List<Object> lookupList( String role )
throws ComponentLookupException;
<T> List<T> lookupList( Class<T> role )
throws ComponentLookupException;
Map<String, Object> lookupMap( String role )
throws ComponentLookupException;
<T> Map<String, T> lookupMap( Class<T> role )
throws ComponentLookupException;
boolean hasComponent( String role );
boolean hasComponent( String role, String hint );
boolean hasComponent( Class<?> role );
boolean hasComponent( Class<?> role, String hint );
boolean hasComponent( Class<?> type, String role, String hint );
void addComponent( Object component, String role );
<T> void addComponent( T component, Class<?> role, String hint );
<T> void addComponentDescriptor( ComponentDescriptor<T> descriptor )
throws CycleDetectedInComponentGraphException;
ComponentDescriptor<?> getComponentDescriptor( String role, String hint );
<T> ComponentDescriptor<T> getComponentDescriptor( Class<T> type, String role, String hint );
List<ComponentDescriptor<?>> getComponentDescriptorList( String role );
<T> List<ComponentDescriptor<T>> getComponentDescriptorList( Class<T> type, String role );
Map<String, ComponentDescriptor<?>> getComponentDescriptorMap( String role );
<T> Map<String, ComponentDescriptor<T>> getComponentDescriptorMap( Class<T> type, String role );
List<ComponentDescriptor<?>> discoverComponents( ClassRealm classRealm )
throws PlexusConfigurationException;
ClassRealm getContainerRealm();
ClassRealm setLookupRealm( ClassRealm realm );
ClassRealm getLookupRealm();
ClassRealm createChildRealm( String id );
void release( Object component )
throws ComponentLifecycleException;
void releaseAll( Map<String, ?> components )
throws ComponentLifecycleException;
void releaseAll( List<?> components )
throws ComponentLifecycleException;
void dispose();
}