org.springframework.osgi.blueprint.container
Class SpringBlueprintContainer

java.lang.Object
  extended by org.springframework.osgi.blueprint.container.SpringBlueprintContainer
All Implemented Interfaces:
BlueprintContainer

public class SpringBlueprintContainer
extends Object
implements BlueprintContainer

Default BlueprintContainer implementation. Wraps a Spring's ConfigurableListableBeanFactory to the BlueprintContainer interface. Note: This class does not fully implements the Blueprint contract: for example it does not fire any of the Blueprint events nor performs exception handling - these concerned are left to the Blueprint extender.

Author:
Adrian Colyer, Costin Leau

Constructor Summary
SpringBlueprintContainer(ConfigurableApplicationContext applicationContext)
           
 
Method Summary
 Set<String> getComponentIds()
          Returns the set of component ids managed by this Blueprint Container.
 Object getComponentInstance(String name)
          Return the component instance for the specified component id.
 ComponentMetadata getComponentMetadata(String name)
          Return the Component Metadata object for the component with the specified component id.
 Collection<?> getMetadata(Class type)
          Return all ComponentMetadata objects of the specified Component Metadata type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringBlueprintContainer

public SpringBlueprintContainer(ConfigurableApplicationContext applicationContext)
Method Detail

getComponentInstance

public Object getComponentInstance(String name)
                            throws NoSuchComponentException
Description copied from interface: BlueprintContainer
Return the component instance for the specified component id. If the component's manager has not yet been activated, calling this operation will atomically activate it. If the component has singleton scope, the activation will cause the component instance to be created and initialized. If the component has prototype scope, then each call to this method will return a new component instance.

Specified by:
getComponentInstance in interface BlueprintContainer
Parameters:
name - The component id for the requested component instance.
Returns:
A component instance for the component with the specified component id.
Throws:
NoSuchComponentException - If no component with the specified component id is managed by this Blueprint Container.

getComponentMetadata

public ComponentMetadata getComponentMetadata(String name)
                                       throws NoSuchComponentException
Description copied from interface: BlueprintContainer
Return the Component Metadata object for the component with the specified component id.

Specified by:
getComponentMetadata in interface BlueprintContainer
Parameters:
name - The component id for the requested Component Metadata.
Returns:
The Component Metadata object for the component with the specified component id.
Throws:
NoSuchComponentException - If no component with the specified component id is managed by this Blueprint Container.

getComponentIds

public Set<String> getComponentIds()
Description copied from interface: BlueprintContainer
Returns the set of component ids managed by this Blueprint Container.

Specified by:
getComponentIds in interface BlueprintContainer
Returns:
An immutable Set of Strings, containing the ids of all of the components managed within this Blueprint Container.

getMetadata

public Collection<?> getMetadata(Class type)
Description copied from interface: BlueprintContainer
Return all ComponentMetadata objects of the specified Component Metadata type. The supported Component Metadata types are ComponentMetadata (which returns the Component Metadata for all defined manager types), BeanMetadata , ServiceReferenceMetadata (which returns both ReferenceMetadata and ReferenceListMetadata objects), and ServiceMetadata. The collection will include all Component Metadata objects of the requested type, including components that are declared inline.

Specified by:
getMetadata in interface BlueprintContainer
Parameters:
type - The super type or type of the requested Component Metadata objects.
Returns:
An immutable collection of Component Metadata objects of the specified type.


Copyright © 2006-2011 Spring Framework. All Rights Reserved.