public class ComponentManagerImpl extends Object implements ComponentManager
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
blacklist |
protected Map<ComponentName,Set<Extension>> |
pendingExtensions |
protected ComponentRegistry |
reg |
| Constructor and Description |
|---|
ComponentManagerImpl(RuntimeService runtime) |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentListener(ComponentListener listener)
Adds a component listener.
|
Collection<ComponentName> |
getActivatingRegistrations()
Gets the pending extensions by component.
|
Set<String> |
getBlacklist() |
ComponentInstance |
getComponent(ComponentName name)
Gets object instance managed by the named component.
|
ComponentInstance |
getComponentProvidingService(Class<?> serviceClass)
Gets the component that provides the given service.
|
Collection<ComponentName> |
getNeededRegistrations() |
Collection<Extension> |
getPendingExtensions(ComponentName name) |
Map<ComponentName,Set<ComponentName>> |
getPendingRegistrations()
Gets the pending registrations and their dependencies.
|
RegistrationInfo |
getRegistrationInfo(ComponentName name)
Gets the component if there is one having the given name.
|
Collection<RegistrationInfo> |
getRegistrations()
Gets the registered components.
|
protected Collection<ComponentName> |
getRegistrations(int state) |
<T> T |
getService(Class<T> serviceClass)
Gets the service of type serviceClass if such a service was declared by a resolved runtime component.
|
String[] |
getServices()
Get the list of all registered service names An empty array is returned if no registered services are found.
|
Collection<ComponentName> |
getStartFailureRegistrations()
Gets the components that fail on applicationStarted notification
|
protected static void |
handleError(String message,
Exception e) |
boolean |
isRegistered(ComponentName name)
Checks whether or not a component with the given name was registered.
|
static void |
loadContributions(RegistrationInfoImpl ri,
Extension xt) |
void |
register(RegistrationInfo regInfo)
Handles the registration of the given registration info.
|
void |
registerExtension(Extension extension) |
void |
registerServices(RegistrationInfoImpl ri) |
void |
removeComponentListener(ComponentListener listener)
Removes a component listener.
|
void |
setBlacklist(Set<String> blacklist) |
void |
shutdown()
Shuts down the component registry.
|
int |
size()
Gets the number of registered objects in this registry.
|
void |
unregister(ComponentName name)
Unregisters a component given its name.
|
void |
unregister(RegistrationInfo regInfo)
Handles the unregistration of the given registration info.
|
void |
unregisterExtension(Extension extension) |
void |
unregisterServices(RegistrationInfoImpl ri) |
protected final Map<ComponentName,Set<Extension>> pendingExtensions
protected ComponentRegistry reg
public ComponentManagerImpl(RuntimeService runtime)
public Collection<RegistrationInfo> getRegistrations()
ComponentManagergetRegistrations in interface ComponentManagerpublic Map<ComponentName,Set<ComponentName>> getPendingRegistrations()
ComponentManagergetPendingRegistrations in interface ComponentManagerpublic Collection<ComponentName> getNeededRegistrations()
public Collection<Extension> getPendingExtensions(ComponentName name)
public RegistrationInfo getRegistrationInfo(ComponentName name)
ComponentManagergetRegistrationInfo in interface ComponentManagername - the component namepublic boolean isRegistered(ComponentName name)
ComponentManagerisRegistered in interface ComponentManagername - the object namepublic int size()
ComponentManagersize in interface ComponentManagerpublic ComponentInstance getComponent(ComponentName name)
ComponentManagergetComponent in interface ComponentManagername - the object namepublic void shutdown()
ComponentManagerThis unregisters all objects registered in this registry.
shutdown in interface ComponentManagerpublic Set<String> getBlacklist()
getBlacklist in interface ComponentManagerpublic void setBlacklist(Set<String> blacklist)
setBlacklist in interface ComponentManagerpublic void register(RegistrationInfo regInfo)
ComponentManagerThis is called by the main registry when all dependencies of this registration info were solved and the object can be registered.
If true is returned, the object will be added to the main registry under the name given in RegistrationInfo.
register in interface ComponentManagerregInfo - the registration infopublic void unregister(RegistrationInfo regInfo)
ComponentManagerThis is called by the main registry when the object is unregistered.
If true is returned, the object will be removed from the main registry.
unregister in interface ComponentManagerregInfo - the registration infopublic void unregister(ComponentName name)
ComponentManagerunregister in interface ComponentManagername - the component namepublic void addComponentListener(ComponentListener listener)
ComponentManagerDoes nothing if the given listener is already registered.
addComponentListener in interface ComponentManagerlistener - the component listener to addpublic void removeComponentListener(ComponentListener listener)
ComponentManagerDoes nothing if the given listener is not registered.
removeComponentListener in interface ComponentManagerlistener - the component listener to removepublic ComponentInstance getComponentProvidingService(Class<?> serviceClass)
ComponentManagergetComponentProvidingService in interface ComponentManagerserviceClass - the service classpublic <T> T getService(Class<T> serviceClass)
ComponentManagerIf the component is not yet activated it will be prior to return the service.
getService in interface ComponentManagerT - the service typeserviceClass - the service classpublic Collection<ComponentName> getActivatingRegistrations()
ComponentManagergetActivatingRegistrations in interface ComponentManagerpublic Collection<ComponentName> getStartFailureRegistrations()
ComponentManagergetStartFailureRegistrations in interface ComponentManagerprotected Collection<ComponentName> getRegistrations(int state)
public void registerExtension(Extension extension)
public void unregisterExtension(Extension extension)
public static void loadContributions(RegistrationInfoImpl ri, Extension xt)
public void registerServices(RegistrationInfoImpl ri)
public void unregisterServices(RegistrationInfoImpl ri)
public String[] getServices()
ComponentManagergetServices in interface ComponentManagerprotected static void handleError(String message, Exception e)
Copyright © 2016 Nuxeo SA. All rights reserved.