org.apache.hivemind.impl
Class RegistryAssemblyImpl

java.lang.Object
  |
  +--org.apache.hivemind.impl.RegistryAssemblyImpl
All Implemented Interfaces:
RegistryAssembly

public class RegistryAssemblyImpl
extends java.lang.Object
implements RegistryAssembly

Implementation of RegistryAssembly.

Author:
Howard Lewis Ship

Constructor Summary
RegistryAssemblyImpl(ErrorHandler errorHandler)
           
 
Method Summary
 void addPostProcessor(java.lang.Runnable postProcessor)
          Adds a Runnable object that will be called after all modules have been parsed.
 void addSchema(java.lang.String schemaId, Schema schema)
          Records a schema that may be referenced elsewhere within a module, or by some other module entirely.
 void enqueueModuleParse(Resource resource, ClassResolver resolver)
          Enqueues another module to be parsed.
 Schema getSchema(java.lang.String schemaId)
          Returns a reference to a schema previously recorded by addSchema(String, Schema).
 boolean moreQueuedModules()
          Returns true if there are yet more queued models to be parsed.
 ModuleDescriptor parseNextQueued(DescriptorParser parser)
          Parses the next enqueued module descripotor and returns it.
 void performPostProcessing()
          Invokes Runnable.run() on each Runnable object previously stored using addPostProcessor(Runnable).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryAssemblyImpl

public RegistryAssemblyImpl(ErrorHandler errorHandler)
Method Detail

addSchema

public void addSchema(java.lang.String schemaId,
                      Schema schema)
Description copied from interface: RegistryAssembly
Records a schema that may be referenced elsewhere within a module, or by some other module entirely.

Specified by:
addSchema in interface RegistryAssembly
Parameters:
schemaId - fully qualified id for the schema.
schema - the Schema to be recorded for later reference

getSchema

public Schema getSchema(java.lang.String schemaId)
Description copied from interface: RegistryAssembly
Returns a reference to a schema previously recorded by RegistryAssembly.addSchema(String, Schema).

Specified by:
getSchema in interface RegistryAssembly
Parameters:
schemaId - fully qualified schema id
Returns:
the schema, or null if no such schema exists

addPostProcessor

public void addPostProcessor(java.lang.Runnable postProcessor)
Description copied from interface: RegistryAssembly
Adds a Runnable object that will be called after all modules have been parsed. This is intended to support support forward references to schemas.

Specified by:
addPostProcessor in interface RegistryAssembly

performPostProcessing

public void performPostProcessing()
Invokes Runnable.run() on each Runnable object previously stored using addPostProcessor(Runnable).


enqueueModuleParse

public void enqueueModuleParse(Resource resource,
                               ClassResolver resolver)
Description copied from interface: RegistryAssembly
Enqueues another module to be parsed.

Specified by:
enqueueModuleParse in interface RegistryAssembly

moreQueuedModules

public boolean moreQueuedModules()
Returns true if there are yet more queued models to be parsed.


parseNextQueued

public ModuleDescriptor parseNextQueued(DescriptorParser parser)
Parses the next enqueued module descripotor and returns it.