Nuxeo Enterprise Platform 5.1

org.nuxeo.runtime.model
Interface ComponentManager

All Known Implementing Classes:
ComponentManagerImpl

public interface ComponentManager

Author:
Bogdan Stefanescu

Method Summary
 void addComponentListener(ComponentListener listener)
          Adds a component listener.
 ComponentInstance getComponent(ComponentName name)
          Gets object instance managed by the named component.
 Collection<ComponentName> getPendingRegistrations()
          Gets the list of pending registrations.
 RegistrationInfo getRegistrationInfo(ComponentName name)
          Gets the component if there is one having the given name.
 Collection<RegistrationInfo> getRegistrations()
          Gets the registrated components.
<T> T
getService(Class<T> serviceClass)
          Gets the service of type serviceClass if such a service was declared by a resolved runtime component.
 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 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:
reg - the main registry
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 u nregistered.

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

Parameters:
reg - the main registry
ri - the registration info

unregister

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

Parameters:
name - the component name
Throws:
Exception - if any error occurs

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 registrated components.

Returns:
a read only collection of components

getPendingRegistrations

Collection<ComponentName> getPendingRegistrations()
Gets the list of pending registrations.

Returns:
the pending registrations or an empty collection if none

size

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

Returns:
the number fo 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

Nuxeo Enterprise Platform 5.1

Copyright ? 2007 Nuxeo SAS. All Rights Reserved.