org.apache.aries.blueprint.container
Class BlueprintContainerImpl

java.lang.Object
  extended by org.apache.aries.blueprint.container.BlueprintContainerImpl
All Implemented Interfaces:
java.lang.Runnable, NamespaceHandlerRegistry.Listener, SatisfiableRecipe.SatisfactionListener, ExtendedBlueprintContainer, BlueprintContainer

public class BlueprintContainerImpl
extends java.lang.Object
implements ExtendedBlueprintContainer, NamespaceHandlerRegistry.Listener, java.lang.Runnable, SatisfiableRecipe.SatisfactionListener

TODO: javadoc

Version:
$Rev: 1042195 $, $Date: 2010-12-04 14:57:01 +0000 (Sat, 04 Dec 2010) $

Constructor Summary
BlueprintContainerImpl(org.osgi.framework.BundleContext bundleContext, org.osgi.framework.Bundle extenderBundle, BlueprintListener eventDispatcher, NamespaceHandlerRegistry handlers, java.util.concurrent.ScheduledExecutorService executors, java.util.List<java.lang.Object> pathList)
           
 
Method Summary
 void destroy()
           
 java.security.AccessControlContext getAccessControlContext()
           
 org.osgi.framework.BundleContext getBundleContext()
           
 ComponentDefinitionRegistryImpl getComponentDefinitionRegistry()
           
 java.util.Set<java.lang.String> getComponentIds()
          Returns the set of component ids managed by this Blueprint Container.
 java.lang.Object getComponentInstance(java.lang.String id)
          Return the component instance for the specified component id.
 ComponentMetadata getComponentMetadata(java.lang.String id)
          Return the Component Metadata object for the component with the specified component id.
 Converter getConverter()
           
 BlueprintListener getEventDispatcher()
           
 org.osgi.framework.Bundle getExtenderBundle()
           
<T extends ComponentMetadata>
java.util.Collection<T>
getMetadata(java.lang.Class<T> clazz)
          Return all ComponentMetadata objects of the specified Component Metadata type.
<T extends Processor>
java.util.List<T>
getProcessors(java.lang.Class<T> clazz)
           
 BlueprintRepository getRepository()
           
 java.lang.Object getService(org.osgi.framework.ServiceReference reference)
           
 java.lang.Class loadClass(java.lang.String name)
           
 void namespaceHandlerRegistered(java.net.URI uri)
          Called when a NamespaceHandler has been registered for the specified URI.
 void namespaceHandlerUnregistered(java.net.URI uri)
          Called when a NamespaceHandler has been unregistered for the specified URI.
 void notifySatisfaction(SatisfiableRecipe satisfiable)
           
protected  void quiesce()
           
 org.osgi.framework.ServiceRegistration registerService(java.lang.String[] classes, java.lang.Object service, java.util.Dictionary properties)
           
 void reload()
           
 void run()
           
 void schedule()
           
protected  void unregisterServices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlueprintContainerImpl

public BlueprintContainerImpl(org.osgi.framework.BundleContext bundleContext,
                              org.osgi.framework.Bundle extenderBundle,
                              BlueprintListener eventDispatcher,
                              NamespaceHandlerRegistry handlers,
                              java.util.concurrent.ScheduledExecutorService executors,
                              java.util.List<java.lang.Object> pathList)
Method Detail

getExtenderBundle

public org.osgi.framework.Bundle getExtenderBundle()
Specified by:
getExtenderBundle in interface ExtendedBlueprintContainer

getProcessors

public <T extends Processor> java.util.List<T> getProcessors(java.lang.Class<T> clazz)
Specified by:
getProcessors in interface ExtendedBlueprintContainer

getEventDispatcher

public BlueprintListener getEventDispatcher()
Specified by:
getEventDispatcher in interface ExtendedBlueprintContainer

schedule

public void schedule()

reload

public void reload()
Specified by:
reload in interface ExtendedBlueprintContainer

run

public void run()
Specified by:
run in interface java.lang.Runnable

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Specified by:
loadClass in interface ExtendedBlueprintContainer
Throws:
java.lang.ClassNotFoundException

registerService

public org.osgi.framework.ServiceRegistration registerService(java.lang.String[] classes,
                                                              java.lang.Object service,
                                                              java.util.Dictionary properties)
Specified by:
registerService in interface ExtendedBlueprintContainer

getService

public java.lang.Object getService(org.osgi.framework.ServiceReference reference)
Specified by:
getService in interface ExtendedBlueprintContainer

getAccessControlContext

public java.security.AccessControlContext getAccessControlContext()
Specified by:
getAccessControlContext in interface ExtendedBlueprintContainer

getRepository

public BlueprintRepository getRepository()
Specified by:
getRepository in interface ExtendedBlueprintContainer

notifySatisfaction

public void notifySatisfaction(SatisfiableRecipe satisfiable)
Specified by:
notifySatisfaction in interface SatisfiableRecipe.SatisfactionListener

unregisterServices

protected void unregisterServices()

getComponentIds

public java.util.Set<java.lang.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.

getComponentInstance

public java.lang.Object getComponentInstance(java.lang.String id)
                                      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:
id - 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(java.lang.String id)
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:
id - The component id for the requested Component Metadata.
Returns:
The Component Metadata object for the component with the specified component id.

getMetadata

public <T extends ComponentMetadata> java.util.Collection<T> getMetadata(java.lang.Class<T> clazz)
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:
clazz - The super type or type of the requested Component Metadata objects.
Returns:
An immutable collection of Component Metadata objects of the specified type.

getConverter

public Converter getConverter()
Specified by:
getConverter in interface ExtendedBlueprintContainer

getComponentDefinitionRegistry

public ComponentDefinitionRegistryImpl getComponentDefinitionRegistry()
Specified by:
getComponentDefinitionRegistry in interface ExtendedBlueprintContainer

getBundleContext

public org.osgi.framework.BundleContext getBundleContext()
Specified by:
getBundleContext in interface ExtendedBlueprintContainer

destroy

public void destroy()

quiesce

protected void quiesce()

namespaceHandlerRegistered

public void namespaceHandlerRegistered(java.net.URI uri)
Description copied from interface: NamespaceHandlerRegistry.Listener
Called when a NamespaceHandler has been registered for the specified URI.

Specified by:
namespaceHandlerRegistered in interface NamespaceHandlerRegistry.Listener
Parameters:
uri - the URI of the newly registered namespace handler

namespaceHandlerUnregistered

public void namespaceHandlerUnregistered(java.net.URI uri)
Description copied from interface: NamespaceHandlerRegistry.Listener
Called when a NamespaceHandler has been unregistered for the specified URI.

Specified by:
namespaceHandlerUnregistered in interface NamespaceHandlerRegistry.Listener
Parameters:
uri - the URI of the newly unregistered namespace handler


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.