org.sakaiproject.component.adaptor
Class ComponentManagerAdaptor

java.lang.Object
  extended byorg.sakaiproject.component.adaptor.ComponentManagerAdaptor
All Implemented Interfaces:
ComponentManager

public class ComponentManagerAdaptor
extends Object
implements ComponentManager

ComponentManagerAdaptor implements the Sakai1 ComponentManager interface as a (read-only) adaptor to Sakai2's ComponentManager API.

Version:
$Revision: 632 $
Author:
University of Michigan, Sakai Software Development Team

Field Summary
 
Fields inherited from interface org.sakaiproject.service.framework.component.ComponentManager
LIFESTYLE_MANY, LIFESTYLE_SINGLE, LIFESTYLE_UNKNOWN
 
Constructor Summary
ComponentManagerAdaptor()
           
 
Method Summary
 boolean contains(Class iface)
          Check if this interface Class has a registered component.
 boolean contains(String ifaceName)
          Check if this interface Class name has a registered component.
 void destroy()
          Final cleanup.
 Object get(Class iface)
          Find a component that is registered to provide this interface.
 Object get(String ifaceName)
          Find a component that is registered to provide this interface.
 int getLifestyle(Class iface)
          Access the lifestyle code for the component implementing this interface.
 Set getLocalRegisteredInterfaces()
          Get all interfaces registered in just this component manager.
 Set getRegisteredInterfaces()
          Get all interfaces registered in the component manager hierarchy.
 void init()
          Final initialization, once all dependencies are set.
 boolean isReady()
          Check if the component manager is ready with all expected registrations to start service components.
 void loadComponent(Class iface, Object component)
          Load a single already created component for this interface class as a singleton.
 void loadComponent(String ifaceName, Object component)
          Load a single already created component for this interface class as a singleton.
 void loadXmlFile(String filename)
          Load a set of component definitions from this file.
 void loadXmlStream(InputStream stream)
          Load a set of component definitions from this XML input stream.
 ComponentManager nestComponentManager()
          Create a new component manager nested in this component manager, extending the definitions of this component manager.
 void setReady(boolean ready)
          Set the readiness of the hierarchy
 void unload()
          Unload registrations and release any constructed instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentManagerAdaptor

public ComponentManagerAdaptor()
Method Detail

init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Final cleanup.


get

public Object get(Class iface)
Description copied from interface: ComponentManager
Find a component that is registered to provide this interface.

Specified by:
get in interface ComponentManager
Parameters:
iface - The interface Class.
Returns:
a component instance, or null if not found.

get

public Object get(String ifaceName)
Description copied from interface: ComponentManager
Find a component that is registered to provide this interface.

Specified by:
get in interface ComponentManager
Parameters:
ifaceName - The fully qualified interface Class name.
Returns:
a component instance, or null if not found.

contains

public boolean contains(Class iface)
Description copied from interface: ComponentManager
Check if this interface Class has a registered component.

Specified by:
contains in interface ComponentManager
Parameters:
iface - The interface Class.
Returns:
true if this interface Class has a registered component, false if not.

contains

public boolean contains(String ifaceName)
Description copied from interface: ComponentManager
Check if this interface Class name has a registered component.

Specified by:
contains in interface ComponentManager
Parameters:
ifaceName - The fully qualified interface Class name.
Returns:
true if this interface has a registered component, false if not.

getLifestyle

public int getLifestyle(Class iface)
Description copied from interface: ComponentManager
Access the lifestyle code for the component implementing this interface.

Specified by:
getLifestyle in interface ComponentManager
Parameters:
iface - The interface class.
Returns:
the lifestyle code for the component implementing this interface.
See Also:
ComponentManager.LIFESTYLE_UNKNOWN, ComponentManager.LIFESTYLE_SINGLE, ComponentManager.LIFESTYLE_MANY

getRegisteredInterfaces

public Set getRegisteredInterfaces()
Description copied from interface: ComponentManager
Get all interfaces registered in the component manager hierarchy.

Specified by:
getRegisteredInterfaces in interface ComponentManager
Returns:
A Set (String class name) of all interfaces registered in the component manager.

getLocalRegisteredInterfaces

public Set getLocalRegisteredInterfaces()
Description copied from interface: ComponentManager
Get all interfaces registered in just this component manager.

Specified by:
getLocalRegisteredInterfaces in interface ComponentManager
Returns:
A Set (String class name) of all interfaces registered in the component manager.

unload

public void unload()
Description copied from interface: ComponentManager
Unload registrations and release any constructed instances.

Specified by:
unload in interface ComponentManager

loadXmlFile

public void loadXmlFile(String filename)
Description copied from interface: ComponentManager
Load a set of component definitions from this file.

Specified by:
loadXmlFile in interface ComponentManager
Parameters:
filename - The name of the file containing the component definition XML.

loadXmlStream

public void loadXmlStream(InputStream stream)
Description copied from interface: ComponentManager
Load a set of component definitions from this XML input stream.

Specified by:
loadXmlStream in interface ComponentManager
Parameters:
stream - The input stream containing the component definition XML.

loadComponent

public void loadComponent(Class iface,
                          Object component)
Description copied from interface: ComponentManager
Load a single already created component for this interface class as a singleton.

Specified by:
loadComponent in interface ComponentManager
Parameters:
iface - The interface class.
component - The alread created component.

loadComponent

public void loadComponent(String ifaceName,
                          Object component)
Description copied from interface: ComponentManager
Load a single already created component for this interface class as a singleton.

Specified by:
loadComponent in interface ComponentManager
Parameters:
ifaceName - The fully qualified interface Class name.
component - The alread created component.

nestComponentManager

public ComponentManager nestComponentManager()
Description copied from interface: ComponentManager
Create a new component manager nested in this component manager, extending the definitions of this component manager.

Specified by:
nestComponentManager in interface ComponentManager
Returns:
The new component manager.

isReady

public boolean isReady()
Description copied from interface: ComponentManager
Check if the component manager is ready with all expected registrations to start service components.

Specified by:
isReady in interface ComponentManager
Returns:
true if ready, false if not.

setReady

public void setReady(boolean ready)
Description copied from interface: ComponentManager
Set the readiness of the hierarchy

Specified by:
setReady in interface ComponentManager
Parameters:
ready - true if ready, false if not.