Package org.codehaus.plexus
Class DefaultPlexusContainer
- java.lang.Object
-
- org.codehaus.plexus.DefaultPlexusContainer
-
- All Implemented Interfaces:
MutablePlexusContainer
,PlexusContainer
public final class DefaultPlexusContainer extends Object implements MutablePlexusContainer
PlexusContainer
shim that delegates to a Plexus-aware GuiceInjector
.
-
-
Constructor Summary
Constructors Constructor Description DefaultPlexusContainer()
DefaultPlexusContainer(ContainerConfiguration configuration)
DefaultPlexusContainer(ContainerConfiguration configuration, com.google.inject.Module... customModules)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponent(Object component, String role)
<T> void
addComponent(T component, Class<?> role, String hint)
<T> void
addComponentDescriptor(ComponentDescriptor<T> descriptor)
com.google.inject.Injector
addPlexusInjector(List<? extends PlexusBeanModule> beanModules, com.google.inject.Module... customModules)
org.codehaus.plexus.classworlds.realm.ClassRealm
createChildRealm(String id)
List<ComponentDescriptor<?>>
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
List<ComponentDescriptor<?>>
discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm, com.google.inject.Module... customModules)
void
dispose()
org.codehaus.plexus.classworlds.ClassWorld
getClassWorld()
<T> ComponentDescriptor<T>
getComponentDescriptor(Class<T> type, String role, String hint)
ComponentDescriptor<?>
getComponentDescriptor(String role, String hint)
<T> List<ComponentDescriptor<T>>
getComponentDescriptorList(Class<T> type, String role)
List
getComponentDescriptorList(String role)
<T> Map<String,ComponentDescriptor<T>>
getComponentDescriptorMap(Class<T> type, String role)
Map
getComponentDescriptorMap(String role)
org.codehaus.plexus.classworlds.realm.ClassRealm
getContainerRealm()
Context
getContext()
Logger
getLogger()
LoggerManager
getLoggerManager()
org.codehaus.plexus.classworlds.realm.ClassRealm
getLookupRealm()
boolean
hasComponent(Class role)
boolean
hasComponent(Class role, String hint)
boolean
hasComponent(Class type, String role, String hint)
boolean
hasComponent(String role)
boolean
hasComponent(String role, String hint)
<T> T
lookup(Class<T> role)
<T> T
lookup(Class<T> role, String hint)
<T> T
lookup(Class<T> type, String role, String hint)
Object
lookup(String role)
Object
lookup(String role, String hint)
<T> List<T>
lookupList(Class<T> role)
List<Object>
lookupList(String role)
<T> Map<String,T>
lookupMap(Class<T> role)
Map<String,Object>
lookupMap(String role)
void
release(Object component)
void
releaseAll(List<?> components)
void
releaseAll(Map<String,?> components)
void
setLoggerManager(LoggerManager loggerManager)
org.codehaus.plexus.classworlds.realm.ClassRealm
setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
-
-
-
Constructor Detail
-
DefaultPlexusContainer
public DefaultPlexusContainer() throws PlexusContainerException
- Throws:
PlexusContainerException
-
DefaultPlexusContainer
public DefaultPlexusContainer(ContainerConfiguration configuration) throws PlexusContainerException
- Throws:
PlexusContainerException
-
DefaultPlexusContainer
public DefaultPlexusContainer(ContainerConfiguration configuration, com.google.inject.Module... customModules) throws PlexusContainerException
- Throws:
PlexusContainerException
-
-
Method Detail
-
getContext
public Context getContext()
- Specified by:
getContext
in interfacePlexusContainer
-
lookup
public Object lookup(String role) throws ComponentLookupException
- Specified by:
lookup
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookup
public Object lookup(String role, String hint) throws ComponentLookupException
- Specified by:
lookup
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookup
public <T> T lookup(Class<T> role) throws ComponentLookupException
- Specified by:
lookup
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookup
public <T> T lookup(Class<T> role, String hint) throws ComponentLookupException
- Specified by:
lookup
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookup
public <T> T lookup(Class<T> type, String role, String hint) throws ComponentLookupException
- Specified by:
lookup
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookupList
public List<Object> lookupList(String role) throws ComponentLookupException
- Specified by:
lookupList
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookupList
public <T> List<T> lookupList(Class<T> role) throws ComponentLookupException
- Specified by:
lookupList
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookupMap
public Map<String,Object> lookupMap(String role) throws ComponentLookupException
- Specified by:
lookupMap
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
lookupMap
public <T> Map<String,T> lookupMap(Class<T> role) throws ComponentLookupException
- Specified by:
lookupMap
in interfacePlexusContainer
- Throws:
ComponentLookupException
-
hasComponent
public boolean hasComponent(String role)
- Specified by:
hasComponent
in interfacePlexusContainer
-
hasComponent
public boolean hasComponent(String role, String hint)
- Specified by:
hasComponent
in interfacePlexusContainer
-
hasComponent
public boolean hasComponent(Class role)
- Specified by:
hasComponent
in interfacePlexusContainer
-
hasComponent
public boolean hasComponent(Class role, String hint)
- Specified by:
hasComponent
in interfacePlexusContainer
-
hasComponent
public boolean hasComponent(Class type, String role, String hint)
- Specified by:
hasComponent
in interfacePlexusContainer
-
addComponent
public void addComponent(Object component, String role)
- Specified by:
addComponent
in interfacePlexusContainer
-
addComponent
public <T> void addComponent(T component, Class<?> role, String hint)
- Specified by:
addComponent
in interfacePlexusContainer
-
addComponentDescriptor
public <T> void addComponentDescriptor(ComponentDescriptor<T> descriptor)
- Specified by:
addComponentDescriptor
in interfacePlexusContainer
-
getComponentDescriptor
public ComponentDescriptor<?> getComponentDescriptor(String role, String hint)
- Specified by:
getComponentDescriptor
in interfacePlexusContainer
-
getComponentDescriptor
public <T> ComponentDescriptor<T> getComponentDescriptor(Class<T> type, String role, String hint)
- Specified by:
getComponentDescriptor
in interfacePlexusContainer
-
getComponentDescriptorList
public List getComponentDescriptorList(String role)
- Specified by:
getComponentDescriptorList
in interfacePlexusContainer
-
getComponentDescriptorList
public <T> List<ComponentDescriptor<T>> getComponentDescriptorList(Class<T> type, String role)
- Specified by:
getComponentDescriptorList
in interfacePlexusContainer
-
getComponentDescriptorMap
public Map getComponentDescriptorMap(String role)
- Specified by:
getComponentDescriptorMap
in interfacePlexusContainer
-
getComponentDescriptorMap
public <T> Map<String,ComponentDescriptor<T>> getComponentDescriptorMap(Class<T> type, String role)
- Specified by:
getComponentDescriptorMap
in interfacePlexusContainer
-
discoverComponents
public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
- Specified by:
discoverComponents
in interfacePlexusContainer
-
discoverComponents
public List<ComponentDescriptor<?>> discoverComponents(org.codehaus.plexus.classworlds.realm.ClassRealm realm, com.google.inject.Module... customModules)
-
addPlexusInjector
public com.google.inject.Injector addPlexusInjector(List<? extends PlexusBeanModule> beanModules, com.google.inject.Module... customModules)
-
getClassWorld
public org.codehaus.plexus.classworlds.ClassWorld getClassWorld()
- Specified by:
getClassWorld
in interfaceMutablePlexusContainer
-
getContainerRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getContainerRealm()
- Specified by:
getContainerRealm
in interfacePlexusContainer
-
setLookupRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm setLookupRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
- Specified by:
setLookupRealm
in interfacePlexusContainer
-
getLookupRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getLookupRealm()
- Specified by:
getLookupRealm
in interfacePlexusContainer
-
createChildRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm createChildRealm(String id)
- Specified by:
createChildRealm
in interfacePlexusContainer
-
getLoggerManager
public LoggerManager getLoggerManager()
- Specified by:
getLoggerManager
in interfaceMutablePlexusContainer
-
setLoggerManager
@Inject(optional=true) public void setLoggerManager(LoggerManager loggerManager)
- Specified by:
setLoggerManager
in interfaceMutablePlexusContainer
-
getLogger
public Logger getLogger()
- Specified by:
getLogger
in interfaceMutablePlexusContainer
-
release
public void release(Object component)
- Specified by:
release
in interfacePlexusContainer
-
releaseAll
public void releaseAll(Map<String,?> components)
- Specified by:
releaseAll
in interfacePlexusContainer
-
releaseAll
public void releaseAll(List<?> components)
- Specified by:
releaseAll
in interfacePlexusContainer
-
dispose
public void dispose()
- Specified by:
dispose
in interfacePlexusContainer
-
-