org.apache.aries.blueprint.namespace
Class NamespaceHandlerRegistryImpl

java.lang.Object
  extended by org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl
All Implemented Interfaces:
NamespaceHandlerRegistry, org.osgi.util.tracker.ServiceTrackerCustomizer

public class NamespaceHandlerRegistryImpl
extends Object
implements NamespaceHandlerRegistry, org.osgi.util.tracker.ServiceTrackerCustomizer

Default implementation of the NamespaceHandlerRegistry. This registry will track NamespaceHandler objects in the OSGi registry and make them available, calling listeners when handlers are registered or unregistered.

Version:
$Rev: 1350821 $, $Date: 2012-06-15 23:17:45 +0100 (Fri, 15 Jun 2012) $

Nested Class Summary
static class NamespaceHandlerRegistryImpl.LRUMap<K,V>
           
protected  class NamespaceHandlerRegistryImpl.NamespaceHandlerSetImpl
           
 
Field Summary
static URI BLUEPRINT_NAMESPACE
           
static String NAMESPACE
           
 
Constructor Summary
NamespaceHandlerRegistryImpl(org.osgi.framework.BundleContext bundleContext)
           
 
Method Summary
 Object addingService(org.osgi.framework.ServiceReference reference)
           
 void destroy()
          Destroy this registry
protected static Map<URI,org.apache.aries.blueprint.NamespaceHandler> findHandlers(Map<URI,Set<org.apache.aries.blueprint.NamespaceHandler>> allHandlers, Set<URI> namespaces, org.osgi.framework.Bundle bundle)
           
 org.apache.aries.blueprint.parser.NamespaceHandlerSet getNamespaceHandlers(Set<URI> uris, org.osgi.framework.Bundle bundle)
          Retrieve the NamespaceHandler for the specified URI.
 Schema getSchema(Map<URI,org.apache.aries.blueprint.NamespaceHandler> handlers)
           
 void modifiedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void registerHandler(org.apache.aries.blueprint.NamespaceHandler handler, Map properties)
           
 void removedService(org.osgi.framework.ServiceReference reference, Object service)
           
protected  void removeSchemasFor(org.apache.aries.blueprint.NamespaceHandler handler)
           
 void unregisterHandler(org.apache.aries.blueprint.NamespaceHandler handler, Map properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLUEPRINT_NAMESPACE

public static final URI BLUEPRINT_NAMESPACE

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values
Constructor Detail

NamespaceHandlerRegistryImpl

public NamespaceHandlerRegistryImpl(org.osgi.framework.BundleContext bundleContext)
Method Detail

addingService

public Object addingService(org.osgi.framework.ServiceReference reference)
Specified by:
addingService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

modifiedService

public void modifiedService(org.osgi.framework.ServiceReference reference,
                            Object service)
Specified by:
modifiedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

removedService

public void removedService(org.osgi.framework.ServiceReference reference,
                           Object service)
Specified by:
removedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

registerHandler

public void registerHandler(org.apache.aries.blueprint.NamespaceHandler handler,
                            Map properties)

unregisterHandler

public void unregisterHandler(org.apache.aries.blueprint.NamespaceHandler handler,
                              Map properties)

getNamespaceHandlers

public org.apache.aries.blueprint.parser.NamespaceHandlerSet getNamespaceHandlers(Set<URI> uris,
                                                                                  org.osgi.framework.Bundle bundle)
Description copied from interface: NamespaceHandlerRegistry
Retrieve the NamespaceHandler for the specified URI. Make sure

Specified by:
getNamespaceHandlers in interface NamespaceHandlerRegistry
Parameters:
uris - the namespace identifying the namespace handler
bundle - the blueprint bundle to be checked for class space consistency
Returns:
a set of registered NamespaceHandlers compatible with the class space of the given bundle

destroy

public void destroy()
Description copied from interface: NamespaceHandlerRegistry
Destroy this registry

Specified by:
destroy in interface NamespaceHandlerRegistry

getSchema

public Schema getSchema(Map<URI,org.apache.aries.blueprint.NamespaceHandler> handlers)
                 throws IOException,
                        SAXException
Throws:
IOException
SAXException

removeSchemasFor

protected void removeSchemasFor(org.apache.aries.blueprint.NamespaceHandler handler)

findHandlers

protected static Map<URI,org.apache.aries.blueprint.NamespaceHandler> findHandlers(Map<URI,Set<org.apache.aries.blueprint.NamespaceHandler>> allHandlers,
                                                                                   Set<URI> namespaces,
                                                                                   org.osgi.framework.Bundle bundle)


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