org.apache.hivemind.impl
Class ModuleImpl

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.hivemind.impl.ModuleImpl
All Implemented Interfaces:
Module, Locatable, LocationHolder

public final class ModuleImpl
extends BaseLocatable
implements Module

Implementation of Module.

Author:
Howard Lewis Ship

Constructor Summary
ModuleImpl()
           
 
Method Summary
 boolean containsService(java.lang.Class serviceInterface)
          Returns true if a single service exists which implements the specified service interface and is visible to this module.
 ClassResolver getClassResolver()
          Returns the resource resolver for this module.
 java.lang.Object getConfiguration(java.lang.String extensionPointId)
          Returns the container for the specified configuration point.
 ErrorHandler getErrorHandler()
          Returns the ErrorHandler for this Registry.
 java.util.Locale getLocale()
           
 Messages getMessages()
          Returns an object that can provide and format localized messages for this module.
 java.lang.String getModuleId()
          Returns the unique identifier for this module.
 RegistryInfrastructure getRegistry()
           
 java.lang.Object getService(java.lang.Class serviceInterface)
          Finds a service that implements the provided interface.
 java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface)
          Looks up the ServicePoint (throwing an exception if not found) and invokes ServicePoint.getService(Class).
 ServiceModelFactory getServiceModelFactory(java.lang.String name)
           
 ServicePoint getServicePoint(java.lang.String serviceId)
          Returns the identified service extension point.
 java.lang.Class resolveType(java.lang.String type)
          Returns the class matching the type.
 void setClassResolver(ClassResolver resolver)
           
 void setModuleId(java.lang.String string)
           
 void setPackageName(java.lang.String packageName)
           
 void setRegistry(RegistryInfrastructure registry)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

ModuleImpl

public ModuleImpl()
Method Detail

getConfiguration

public java.lang.Object getConfiguration(java.lang.String extensionPointId)
Description copied from interface: Module
Returns the container for the specified configuration point.

Specified by:
getConfiguration in interface Module
Parameters:
extensionPointId - an unqualified id for a configuration within this module, or a fully qualified id for a configuration in this or any other module

getModuleId

public java.lang.String getModuleId()
Description copied from interface: Module
Returns the unique identifier for this module.

Specified by:
getModuleId in interface Module

setPackageName

public void setPackageName(java.lang.String packageName)
Since:
1.1

containsService

public boolean containsService(java.lang.Class serviceInterface)
Description copied from interface: Module
Returns true if a single service exists which implements the specified service interface and is visible to this module.

Specified by:
containsService in interface Module
Returns:
true if a single visible service for the specified service interface exists

getService

public java.lang.Object getService(java.lang.String serviceId,
                                   java.lang.Class serviceInterface)
Description copied from interface: Module
Looks up the ServicePoint (throwing an exception if not found) and invokes ServicePoint.getService(Class).

Specified by:
getService in interface Module
Parameters:
serviceId - an unqualified id for a service within this module, or a fully qualified id for a service in this or any other module
serviceInterface - type the result will be cast to

getService

public java.lang.Object getService(java.lang.Class serviceInterface)
Description copied from interface: Module
Finds a service that implements the provided interface. Exactly one such service may exist or an exception is thrown.

Specified by:
getService in interface Module
Parameters:
serviceInterface - used to locate the service

setModuleId

public void setModuleId(java.lang.String string)

setRegistry

public void setRegistry(RegistryInfrastructure registry)

setClassResolver

public void setClassResolver(ClassResolver resolver)

getClassResolver

public ClassResolver getClassResolver()
Description copied from interface: Module
Returns the resource resolver for this module. The resource resolver is used to locate classes by name (using the correct classloader).

Specified by:
getClassResolver in interface Module

getMessages

public Messages getMessages()
Description copied from interface: Module
Returns an object that can provide and format localized messages for this module. The messages come from a properties file, hivemodule.properties (localized) stored with the HiveMind deployment descriptor in the META-INF folder.

Specified by:
getMessages in interface Module

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getServicePoint

public ServicePoint getServicePoint(java.lang.String serviceId)
Description copied from interface: Module
Returns the identified service extension point.

Specified by:
getServicePoint in interface Module
Parameters:
serviceId - an unqualified id for a service within this module, or a fully qualified id for a service in this or any other module

getServiceModelFactory

public ServiceModelFactory getServiceModelFactory(java.lang.String name)
Specified by:
getServiceModelFactory in interface Module
See Also:
RegistryInfrastructure.getServiceModelFactory(String)

getLocale

public java.util.Locale getLocale()
Specified by:
getLocale in interface Module
See Also:
Registry.getLocale()

getErrorHandler

public ErrorHandler getErrorHandler()
Description copied from interface: Module
Returns the ErrorHandler for this Registry.

Specified by:
getErrorHandler in interface Module

resolveType

public java.lang.Class resolveType(java.lang.String type)
Description copied from interface: Module
Returns the class matching the type. First, attempts to resolve the type exactly as is. If that fails, resolves the type within the module's defined package.

Specified by:
resolveType in interface Module
Parameters:
type - the Java type to convert into a class. May be a primitive type, or an array of objects or primitives.
Returns:
the corresponding Class object.

getRegistry

public RegistryInfrastructure getRegistry()
Specified by:
getRegistry in interface Module
Returns:
the registry infrastructure interface
See Also:
Module.getRegistry()


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