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 java.lang.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: 964701 $, $Date: 2010-07-16 08:23:10 +0100 (Fri, 16 Jul 2010) $

Nested Class Summary
static class NamespaceHandlerRegistryImpl.LRUMap<K,V>
           
protected  class NamespaceHandlerRegistryImpl.NamespaceHandlerSetImpl
           
 
Nested classes/interfaces inherited from interface org.apache.aries.blueprint.container.NamespaceHandlerRegistry
NamespaceHandlerRegistry.Listener, NamespaceHandlerRegistry.NamespaceHandlerSet
 
Field Summary
static java.net.URI BLUEPRINT_NAMESPACE
           
static java.lang.String NAMESPACE
           
 
Constructor Summary
NamespaceHandlerRegistryImpl(org.osgi.framework.BundleContext bundleContext)
           
 
Method Summary
 java.lang.Object addingService(org.osgi.framework.ServiceReference reference)
           
 void destroy()
          Destroy this registry
protected static java.util.Map<java.net.URI,NamespaceHandler> findHandlers(java.util.Map<java.net.URI,java.util.Set<NamespaceHandler>> allHandlers, java.util.Set<java.net.URI> namespaces, org.osgi.framework.Bundle bundle)
           
 NamespaceHandlerRegistry.NamespaceHandlerSet getNamespaceHandlers(java.util.Set<java.net.URI> uris, org.osgi.framework.Bundle bundle)
          Retrieve the NamespaceHandler for the specified URI.
 javax.xml.validation.Schema getSchema(java.util.Map<java.net.URI,NamespaceHandler> handlers)
           
 void modifiedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)
           
 void registerHandler(NamespaceHandler handler, java.util.Map properties)
           
 void removedService(org.osgi.framework.ServiceReference reference, java.lang.Object service)
           
protected  void removeSchemasFor(NamespaceHandler handler)
           
 void unregisterHandler(NamespaceHandler handler, java.util.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 java.net.URI BLUEPRINT_NAMESPACE

NAMESPACE

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

NamespaceHandlerRegistryImpl

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

addingService

public java.lang.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,
                            java.lang.Object service)
Specified by:
modifiedService in interface org.osgi.util.tracker.ServiceTrackerCustomizer

removedService

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

registerHandler

public void registerHandler(NamespaceHandler handler,
                            java.util.Map properties)

unregisterHandler

public void unregisterHandler(NamespaceHandler handler,
                              java.util.Map properties)

getNamespaceHandlers

public NamespaceHandlerRegistry.NamespaceHandlerSet getNamespaceHandlers(java.util.Set<java.net.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 javax.xml.validation.Schema getSchema(java.util.Map<java.net.URI,NamespaceHandler> handlers)
                                      throws java.io.IOException,
                                             org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException

removeSchemasFor

protected void removeSchemasFor(NamespaceHandler handler)

findHandlers

protected static java.util.Map<java.net.URI,NamespaceHandler> findHandlers(java.util.Map<java.net.URI,java.util.Set<NamespaceHandler>> allHandlers,
                                                                           java.util.Set<java.net.URI> namespaces,
                                                                           org.osgi.framework.Bundle bundle)


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