org.drools.smf
Class DefaultSemanticsRepository

java.lang.Object
  |
  +--org.drools.smf.DefaultSemanticsRepository
All Implemented Interfaces:
SemanticsRepository

public final class DefaultSemanticsRepository
extends java.lang.Object
implements SemanticsRepository

Default SemanticsRepository which uses discovery to autoload semantic modules.

Any semantic module that conforms to the SMF contract will be discovered and autoloaded upon first access of the DefaultSemanticsRepository.

To be discovered, the module should be in a jar with a module descriptor located at /META-INF/drools-semantics.properties.

Version:
$Id: DefaultSemanticsRepository.java,v 1.1.1.1 2003/12/30 21:19:59 bob Exp $
Author:
bob mcwhirter

Method Summary
static SemanticsRepository getInstance()
          Retrieve the singleton instance.
 SemanticModule[] getSemanticModules()
          Retieve all SemanticModules.
protected  void init()
          Initialize and perform discovery.
 SemanticModule lookupSemanticModule(java.lang.String uri)
          Lookup a SemanticModule by URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static SemanticsRepository getInstance()
                                       throws java.lang.Exception
Retrieve the singleton instance.

Returns:
The singleton instance.
Throws:
java.lang.Exception - If an error occurs while performing discovery and loading of the semantic modules.

init

protected void init()
             throws java.lang.Exception
Initialize and perform discovery.

Throws:
java.lang.Exception - If an error occurs while performing discovery and loading of the semantic modules.

lookupSemanticModule

public SemanticModule lookupSemanticModule(java.lang.String uri)
                                    throws NoSuchSemanticModuleException
Description copied from interface: SemanticsRepository
Lookup a SemanticModule by URI.

Specified by:
lookupSemanticModule in interface SemanticsRepository
Parameters:
uri - The URI.
Returns:
The bound SemanticModule.
Throws:
NoSuchSemanticModuleException - If no module is bound to the URI.
See Also:
SemanticsRepository

getSemanticModules

public SemanticModule[] getSemanticModules()
Description copied from interface: SemanticsRepository
Retieve all SemanticModules.

Specified by:
getSemanticModules in interface SemanticsRepository
Returns:
All semantic modules.
See Also:
SemanticsRepository