org.apache.directory.server.schema.registries
Class AbstractSchemaLoader

java.lang.Object
  extended by org.apache.directory.server.schema.registries.AbstractSchemaLoader
All Implemented Interfaces:
SchemaLoader
Direct Known Subclasses:
BootstrapSchemaLoader, PartitionSchemaLoader

public abstract class AbstractSchemaLoader
extends java.lang.Object
implements SchemaLoader

An abstract class with a utility method and setListener() implemented.

Version:
$Rev$
Author:
Apache Directory Project

Field Summary
protected  SchemaLoaderListener listener
           
 
Constructor Summary
AbstractSchemaLoader()
           
 
Method Summary
protected  void loadDepsFirst(Schema rootAncestor, java.util.Stack<java.lang.String> beenthere, java.util.Map<java.lang.String,Schema> notLoaded, Schema schema, Registries registries, java.util.Properties props)
          Recursive method which loads schema's with their dependent schemas first and tracks what schemas it has seen so the recursion does not go out of control with depenency cycle detection.
protected  void notifyListenerOrRegistries(Schema schema, Registries registries)
           
 void setListener(SchemaLoaderListener listener)
          Sets listener used to notify of newly loaded schemas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.schema.registries.SchemaLoader
getSchema, getSchema, load, loadWithDependencies, loadWithDependencies
 

Field Detail

listener

protected SchemaLoaderListener listener
Constructor Detail

AbstractSchemaLoader

public AbstractSchemaLoader()
Method Detail

setListener

public void setListener(SchemaLoaderListener listener)
Description copied from interface: SchemaLoader
Sets listener used to notify of newly loaded schemas.

Specified by:
setListener in interface SchemaLoader
Parameters:
listener - the listener to notify (only one is enough for us)

notifyListenerOrRegistries

protected final void notifyListenerOrRegistries(Schema schema,
                                                Registries registries)

loadDepsFirst

protected final void loadDepsFirst(Schema rootAncestor,
                                   java.util.Stack<java.lang.String> beenthere,
                                   java.util.Map<java.lang.String,Schema> notLoaded,
                                   Schema schema,
                                   Registries registries,
                                   java.util.Properties props)
                            throws java.lang.Exception
Recursive method which loads schema's with their dependent schemas first and tracks what schemas it has seen so the recursion does not go out of control with depenency cycle detection.

Parameters:
rootAncestor - the triggering schema load request: the root ancestor of dependency chain
beenthere - stack of schema names we have visited and have yet to load
notLoaded - hash of schemas keyed by name which have yet to be loaded
schema - the current schema we are attempting to load
registries - the set of registries to use while loading
props - to use while trying to resolve other schemas
Throws:
javax.naming.NamingException - if there is a cycle detected and/or another failure results while loading, producing and or registering schema objects
java.lang.Exception


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