Package org.xwiki.component.manager
Interface CompatibilityComponentManager
-
public interface CompatibilityComponentManager
Add a backward compatibility layer to theComponentManager
class.- Since:
- 4.1M1
- Version:
- $Id: af29b918e29d882c2ea7b1ecf2c29b1df3cb89f9 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description <T> ComponentDescriptor<T>
getComponentDescriptor(Class<T> role, String hint)
Deprecated.since 4.0M1 use#getComponentDescriptor(Type, String)
instead<T> boolean
hasComponent(Class<T> role)
Deprecated.since 4.0M1 use#hasComponent(Type)
instead<T> boolean
hasComponent(Class<T> role, String hint)
Deprecated.since 4.0M1 use#hasComponent(Type, String)
instead<T> T
lookup(Class<T> role)
Deprecated.since 4.0M1 use#getInstance(java.lang.reflect.Type)
instead<T> T
lookup(Class<T> role, String hint)
Deprecated.since 4.0M1 use#getInstance(java.lang.reflect.Type, String)
instead<T> List<T>
lookupList(Class<T> role)
Deprecated.since 4.0M1 use#getInstanceList(java.lang.reflect.Type)
instead<T> Map<String,T>
lookupMap(Class<T> role)
Deprecated.since 4.0M1 use#getInstanceMap(java.lang.reflect.Type)
instead<T> void
unregisterComponent(Class<T> role, String hint)
Deprecated.since 4.0M1 use#unregisterComponent(Type, String)
instead
-
-
-
Method Detail
-
lookup
@Deprecated <T> T lookup(Class<T> role) throws ComponentLookupException
Deprecated.since 4.0M1 use#getInstance(java.lang.reflect.Type)
insteadFind a component instance that implements that passed interface class. If the component has a singleton lifecycle then this method always return the same instance.- Type Parameters:
T
- the component role type- Parameters:
role
- the class (aka role) that the component implements- Returns:
- the component instance
- Throws:
ComponentLookupException
- in case the component cannot be found
-
lookup
@Deprecated <T> T lookup(Class<T> role, String hint) throws ComponentLookupException
Deprecated.since 4.0M1 use#getInstance(java.lang.reflect.Type, String)
insteadFind a component instance that implements that passed interface class. If the component has a singleton lifecycle then this method always return the same instance.- Type Parameters:
T
- the component role type- Parameters:
role
- the class (aka role) that the component implementshint
- the hint that differentiates a component implementation from another one (each component is registered with a hint; the "default" hint being the default)- Returns:
- the component instance
- Throws:
ComponentLookupException
- in case the component cannot be found
-
lookupList
@Deprecated <T> List<T> lookupList(Class<T> role) throws ComponentLookupException
Deprecated.since 4.0M1 use#getInstanceList(java.lang.reflect.Type)
insteadFind all the components implementing the provided role.- Type Parameters:
T
- the type of the components role- Parameters:
role
- the class of the components role- Returns:
- the components
- Throws:
ComponentLookupException
- if any error happen during component search
-
lookupMap
@Deprecated <T> Map<String,T> lookupMap(Class<T> role) throws ComponentLookupException
Deprecated.since 4.0M1 use#getInstanceMap(java.lang.reflect.Type)
insteadFind all the components implementing the provided role and organize then in aMap
with role hint as key.- Type Parameters:
T
- the type of the components role- Parameters:
role
- the class of the components role- Returns:
- the components
- Throws:
ComponentLookupException
- if any error happen during component search
-
hasComponent
@Deprecated <T> boolean hasComponent(Class<T> role)
Deprecated.since 4.0M1 use#hasComponent(Type)
instead- Type Parameters:
T
- the component role type- Parameters:
role
- the class (aka role) that the component implements- Returns:
- true if the component is registered or false otherwise
-
hasComponent
@Deprecated <T> boolean hasComponent(Class<T> role, String hint)
Deprecated.since 4.0M1 use#hasComponent(Type, String)
instead- Type Parameters:
T
- the component role type- Parameters:
role
- the class (aka role) that the component implementshint
- the hint that differentiates a component implementation from another one (each component is registered with a hint; the "default" hint being the default)- Returns:
- true if the component is registered for the passed hint or false otherwise
-
unregisterComponent
@Deprecated <T> void unregisterComponent(Class<T> role, String hint)
Deprecated.since 4.0M1 use#unregisterComponent(Type, String)
insteadRemove a component from the component repository dynamically.- Type Parameters:
T
- the component role type- Parameters:
role
- the role identifying the componenthint
- the hint identifying the component- Since:
- 2.0M2
-
getComponentDescriptor
@Deprecated <T> ComponentDescriptor<T> getComponentDescriptor(Class<T> role, String hint)
Deprecated.since 4.0M1 use#getComponentDescriptor(Type, String)
instead- Type Parameters:
T
- the component role type- Parameters:
role
- the role identifying the componenthint
- the hint identifying the component- Returns:
- the descriptor for the component matching the passed parameter or null if this component doesn't exist
- Since:
- 2.0M1
-
-