org.apache.geronimo.blueprint.namespace
Class NamespaceHandlerRegistryImpl

java.lang.Object
  extended by org.apache.geronimo.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: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
Author:
Apache Geronimo Project

Nested Class Summary
static class NamespaceHandlerRegistryImpl.LRUMap<K,V>
           
 
Nested classes/interfaces inherited from interface org.apache.geronimo.blueprint.container.NamespaceHandlerRegistry
NamespaceHandlerRegistry.Listener
 
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 addListener(NamespaceHandlerRegistry.Listener listener)
          Add a new Listener to be called when namespace handlers are registerd or unregistered
 void destroy()
          Destroy this registry
 NamespaceHandler getNamespaceHandler(URI uri)
          Retrieve the NamespaceHandler for the specified URI
 Schema getSchema(Set<URI> namespaces)
          Obtain a schema to validate the XML for the given list of namespaces
 void modifiedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void registerHandler(NamespaceHandler handler, Map properties)
           
 void removedService(org.osgi.framework.ServiceReference reference, Object service)
           
 void removeListener(NamespaceHandlerRegistry.Listener listener)
          Remove a previously registered Listener
protected  void removeSchemasFor(List<URI> namespaces)
           
 void unregisterHandler(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(NamespaceHandler handler,
                            Map properties)

unregisterHandler

public void unregisterHandler(NamespaceHandler handler,
                              Map properties)

getNamespaceHandler

public NamespaceHandler getNamespaceHandler(URI uri)
Description copied from interface: NamespaceHandlerRegistry
Retrieve the NamespaceHandler for the specified URI

Specified by:
getNamespaceHandler in interface NamespaceHandlerRegistry
Parameters:
uri - the namespace identifying the namespace handler
Returns:
the registered NamespaceHandler or null if none has been registered for the given namespace

destroy

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

Specified by:
destroy in interface NamespaceHandlerRegistry

addListener

public void addListener(NamespaceHandlerRegistry.Listener listener)
Description copied from interface: NamespaceHandlerRegistry
Add a new Listener to be called when namespace handlers are registerd or unregistered

Specified by:
addListener in interface NamespaceHandlerRegistry
Parameters:
listener - the listener to register

removeListener

public void removeListener(NamespaceHandlerRegistry.Listener listener)
Description copied from interface: NamespaceHandlerRegistry
Remove a previously registered Listener

Specified by:
removeListener in interface NamespaceHandlerRegistry
Parameters:
listener - the listener to unregister

getSchema

public Schema getSchema(Set<URI> namespaces)
                 throws IOException,
                        SAXException
Description copied from interface: NamespaceHandlerRegistry
Obtain a schema to validate the XML for the given list of namespaces

Specified by:
getSchema in interface NamespaceHandlerRegistry
Returns:
Throws:
IOException
SAXException

removeSchemasFor

protected void removeSchemasFor(List<URI> namespaces)


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