org.apache.hivemind.definition.impl
Class ModuleDefinitionImpl

java.lang.Object
  extended by org.apache.hivemind.definition.impl.ModuleDefinitionImpl
All Implemented Interfaces:
ModuleDefinition

public class ModuleDefinitionImpl
extends java.lang.Object
implements ModuleDefinition

Default implementation of ExtensionDefinition.

Author:
Achim Huegen

Constructor Summary
ModuleDefinitionImpl()
           
ModuleDefinitionImpl(java.lang.String id, Location location, ClassResolver resolver, java.lang.String packageName)
           
 
Method Summary
 void addConfigurationParser(java.lang.String qualifiedConfigurationPointId, ConfigurationParserDefinition parser)
          Adds a configuration parser for a configuration point which can be defined in this module or another module.
 void addConfigurationPoint(ConfigurationPointDefinition configurationPoint)
          Adds a configuration point definition to the module.
 void addContribution(java.lang.String qualifiedConfigurationPointId, ContributionDefinition contribution)
          Adds a contribution for a configuration point which can be defined in this module or another module.
 void addDependency(java.lang.String dependsOnModuleId)
          Defines a dependency on another module.
 void addImplementation(java.lang.String qualifiedServicePointId, ImplementationDefinition implementation)
          Adds a implementation for a service point which can be defined in this module or another module.
 void addInterceptor(java.lang.String qualifiedServicePointId, InterceptorDefinition interceptor)
          Adds a interceptor for a service point which can be defined in this module or another module.
 void addServicePoint(ServicePointDefinition servicePoint)
          Adds a service point definition to the module.
 ClassResolver getClassResolver()
           
 java.util.Collection getConfigurationParsers()
           
 ConfigurationPointDefinition getConfigurationPoint(java.lang.String id)
          Returns a configuration point that is identified by its id.
 java.util.Collection getConfigurationPoints()
           
 java.util.Collection getContributions()
           
 java.util.Collection getDependencies()
           
 java.lang.String getId()
           
 java.util.Collection getImplementations()
           
 java.util.Collection getInterceptors()
           
 Location getLocation()
           
 java.lang.String getPackageName()
          Returns the name of the package to search for class names within.
 ServicePointDefinition getServicePoint(java.lang.String id)
          Returns a service point that is identified by its id.
 java.util.Collection getServicePoints()
           
 void setClassResolver(ClassResolver classResolver)
          Sets the ClassResolver used to resolve all classes referenced from elements inside the module.
 void setId(java.lang.String moduleId)
          Sets the id of the module.
 void setLocation(Location location)
          Sets the location of the module.
 void setPackageName(java.lang.String packageName)
          Sets the package name of the module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleDefinitionImpl

public ModuleDefinitionImpl()

ModuleDefinitionImpl

public ModuleDefinitionImpl(java.lang.String id,
                            Location location,
                            ClassResolver resolver,
                            java.lang.String packageName)
Parameters:
id - the id of the module
location - the location of the module
resolver - the ClassResolver used to resolve all classes referenced from elements inside this module.
packageName - name of the package to search for class names within. If null, it defaults to the id
Method Detail

getClassResolver

public ClassResolver getClassResolver()
Specified by:
getClassResolver in interface ModuleDefinition
Returns:
the ClassResolver used to resolve all classes referenced from elements inside this module.
See Also:
ModuleDefinition.getClassResolver()

setClassResolver

public void setClassResolver(ClassResolver classResolver)
Sets the ClassResolver used to resolve all classes referenced from elements inside the module.


getLocation

public Location getLocation()
Specified by:
getLocation in interface ModuleDefinition
Returns:
the location of the module
See Also:
ModuleDefinition.getLocation()

setLocation

public void setLocation(Location location)
Sets the location of the module.


getId

public java.lang.String getId()
Specified by:
getId in interface ModuleDefinition
Returns:
the id of the module. It can contain dots.
See Also:
ModuleDefinition.getId()

setId

public void setId(java.lang.String moduleId)
Sets the id of the module.


getPackageName

public java.lang.String getPackageName()
Description copied from interface: ModuleDefinition
Returns the name of the package to search for class names within. By default, the package name will match the module id.

Specified by:
getPackageName in interface ModuleDefinition
See Also:
ModuleDefinition.getPackageName()

setPackageName

public void setPackageName(java.lang.String packageName)
Sets the package name of the module.


addServicePoint

public void addServicePoint(ServicePointDefinition servicePoint)
Adds a service point definition to the module.

Parameters:
servicePoint - the service point
Throws:
ApplicationRuntimeException - if another service point with the same id has already been defined

getServicePoint

public ServicePointDefinition getServicePoint(java.lang.String id)
Description copied from interface: ModuleDefinition
Returns a service point that is identified by its id.

Specified by:
getServicePoint in interface ModuleDefinition
Parameters:
id - the service point id (unqualified, without module id)
Returns:
the service point definition
See Also:
ModuleDefinition.getServicePoint(java.lang.String)

getServicePoints

public java.util.Collection getServicePoints()
Specified by:
getServicePoints in interface ModuleDefinition
Returns:
all service points defined in this module
See Also:
ModuleDefinition.getServicePoints()

addConfigurationPoint

public void addConfigurationPoint(ConfigurationPointDefinition configurationPoint)
Adds a configuration point definition to the module.

Parameters:
configurationPoint - the configuration point
Throws:
ApplicationRuntimeException - if another configuration point with the same id has already been defined

getConfigurationPoint

public ConfigurationPointDefinition getConfigurationPoint(java.lang.String id)
Description copied from interface: ModuleDefinition
Returns a configuration point that is identified by its id.

Specified by:
getConfigurationPoint in interface ModuleDefinition
Parameters:
id - the configuration point id (unqualified, without module id)
Returns:
the configuration point definition
See Also:
ModuleDefinition.getConfigurationPoint(java.lang.String)

getConfigurationPoints

public java.util.Collection getConfigurationPoints()
Specified by:
getConfigurationPoints in interface ModuleDefinition
Returns:
all configuration points defined in this module
See Also:
ModuleDefinition.getConfigurationPoints()

getDependencies

public java.util.Collection getDependencies()
Specified by:
getDependencies in interface ModuleDefinition
Returns:
the ids of all modules this module depends on
See Also:
ModuleDefinition.getDependencies()

addDependency

public void addDependency(java.lang.String dependsOnModuleId)
Defines a dependency on another module. The presence of that module is checked during registry construction.

Parameters:
dependsOnModuleId - the id of the module this module depends on

addImplementation

public void addImplementation(java.lang.String qualifiedServicePointId,
                              ImplementationDefinition implementation)
Adds a implementation for a service point which can be defined in this module or another module.

Parameters:
qualifiedServicePointId - the fully qualified service point id
implementation - the implementation definition

addInterceptor

public void addInterceptor(java.lang.String qualifiedServicePointId,
                           InterceptorDefinition interceptor)
Adds a interceptor for a service point which can be defined in this module or another module.

Parameters:
qualifiedServicePointId - the fully qualified service point id
interceptor - the interceptor definition

addContribution

public void addContribution(java.lang.String qualifiedConfigurationPointId,
                            ContributionDefinition contribution)
Adds a contribution for a configuration point which can be defined in this module or another module.

Parameters:
qualifiedConfigurationPointId - the fully qualified configuration point id
contribution - the contribution definition

addConfigurationParser

public void addConfigurationParser(java.lang.String qualifiedConfigurationPointId,
                                   ConfigurationParserDefinition parser)
Adds a configuration parser for a configuration point which can be defined in this module or another module.

Parameters:
qualifiedConfigurationPointId - the fully qualified configuration point id
parser - the parser definition

getContributions

public java.util.Collection getContributions()
Specified by:
getContributions in interface ModuleDefinition
Returns:
all contributions contained in this module.
See Also:
ModuleDefinition.getContributions()

getImplementations

public java.util.Collection getImplementations()
Specified by:
getImplementations in interface ModuleDefinition
Returns:
all implementations contained in this module
See Also:
ModuleDefinition.getImplementations()

getInterceptors

public java.util.Collection getInterceptors()
Specified by:
getInterceptors in interface ModuleDefinition
Returns:
all interceptors contained in this module
See Also:
ModuleDefinition.getInterceptors()

getConfigurationParsers

public java.util.Collection getConfigurationParsers()
Specified by:
getConfigurationParsers in interface ModuleDefinition
Returns:
all parsers contained in this module
See Also:
ModuleDefinition.getConfigurationParsers()


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