Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.model
Interface ComponentManager

All Known Implementing Classes:
ComponentManagerImpl

public interface ComponentManager

Author:
Bogdan Stefanescu, Florent Guillaume

Method Summary
 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.
 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.
<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.
 boolean isRegistered(ComponentName name)
          Checks whether or not a component with the given name was registered.
 void register(RegistrationInfo ri)
          Handles the registration of the given registration info.
 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 ri)
          Handles the unregistration of the given registration info.
 

Method Detail

addComponentListener

void addComponentListener(ComponentListener listener)
Adds a component listener.

Does nothing if the given listener is already registered.

Parameters:
listener - the component listener to add

removeComponentListener

void removeComponentListener(ComponentListener listener)
Removes a component listener.

Does nothing if the given listener is not registered.

Parameters:
listener - the component listener to remove

register

void register(RegistrationInfo ri)
Handles the registration of the given registration info.

This 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.

Parameters:
ri - the registration info

unregister

void unregister(RegistrationInfo ri)
Handles the unregistration of the given registration info.

This is called by the main registry when the object is unregistered.

If true is returned, the object will be removed from the main registry.

Parameters:
ri - the registration info

unregister

void unregister(ComponentName name)
Unregisters a component given its name.

Parameters:
name - the component name

getRegistrationInfo

RegistrationInfo getRegistrationInfo(ComponentName name)
Gets the component if there is one having the given name.

Parameters:
name - the component name
Returns:
the component if any was registered with that name, null otherwise

getComponent

ComponentInstance getComponent(ComponentName name)
Gets object instance managed by the named component.

Parameters:
name - the object name
Returns:
the object instance if any. may be null

isRegistered

boolean isRegistered(ComponentName name)
Checks whether or not a component with the given name was registered.

Parameters:
name - the object name
Returns:
true if an object with the given name was registered, false otherwise

getRegistrations

Collection<RegistrationInfo> getRegistrations()
Gets the registered components.

Returns:
a read-only collection of components

getPendingRegistrations

Map<ComponentName,Set<ComponentName>> getPendingRegistrations()
Gets the pending registrations and their dependencies.

Returns:
the pending registrations

getActivatingRegistrations

Collection<ComponentName> getActivatingRegistrations()
Gets the pending extensions by component.

Returns:
the pending extensions

size

int size()
Gets the number of registered objects in this registry.

Returns:
the number of registered objects

shutdown

void shutdown()
Shuts down the component registry.

This unregisters all objects registered in this registry.


getService

<T> T getService(Class<T> serviceClass)
Gets the service of type serviceClass if such a service was declared by a resolved runtime component.

If the component is not yet activated it will be prior to return the service.

Type Parameters:
T - the service type
Parameters:
serviceClass - the service class
Returns:
the service object

getServices

String[] getServices()
Get the list of all registered service names An empty array is returned if no registered services are found.

Returns:
an array of registered service.

getComponentProvidingService

ComponentInstance getComponentProvidingService(Class<?> serviceClass)
Gets the component that provides the given service.

Parameters:
serviceClass - the service class
Returns:
the component or null if none

getBlacklist

Set<String> getBlacklist()

setBlacklist

void setBlacklist(Set<String> blacklist)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.