pt.digitalis.dif.dem
Class DEMRegistryImpl

java.lang.Object
  extended by pt.digitalis.dif.dem.DEMRegistryImpl
All Implemented Interfaces:
IDEMRegistry

public class DEMRegistryImpl
extends Object
implements IDEMRegistry

DIF entity model (DEM) Registry class. This class is populated by the code generation module. This module reads the DEM annotations in classpath's classes, generates the appropriate code and populates the Registry. Since only one DEM Registry is needed, the class implements the Singleton pattern. Note to class maintainers: all the attribute accesses - even for setting/removing values - should be made through the supplied inspectors getProviders(), getApplications(), getServices() and getStages(). Accessing directly to the attributes does not guarantee that they are properly initialized. This need is due to the fact that the code generation module inserts the proper attribute initialization code in the aforementioned getters, so accessing through them is the only way to guarantee that they contain the proper data.

Author:
Rodrigo Gonçalves rgoncalves@digitalis.pt, Pedro Viegas pviegas@digitalis.pt
Created on:
2007/04/24

Method Summary
static IApplication addApplication(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Registers an application.
static IEntity addEntity(Entity entityType, pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Registers a provider.
static IProvider addProvider(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Registers a provider.
static IService addService(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Registers a service.
static IStage addStage(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
          Registers a stage.
 IApplication getApplication(String applicationID)
          Returns an application associated with a given ID.
static Map<String,IApplication> getApplications()
          Returns the map of all registered applications.
static IProvider getDefaultProvider()
          Returns the default provider.
static String getDefaultProviderID()
          Returns the default provider id.
 IProvider getProvider(String providerID)
          Returns a provider associated with a given ID.
static Map<String,IProvider> getProviders()
          Returns the map of all registered providers.
static DEMRegistryImpl getRegistry()
          Returns the DEMRegistryImpl instance (Singleton pattern).
 IService getService(String serviceID)
          Returns a service associated with a given ID.
static Map<String,IService> getServices()
          Returns the map of all services registered.
 IStage getStage(String stageID)
          Returns a stage associated with a given ID.
static Map<String,IStage> getStages()
          Returns the map of all stages registered.
static void setDefaultProvider(String providerID)
          Returns the default provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addApplication

public static IApplication addApplication(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
Registers an application.

Parameters:
clazz - the application class to register
Returns:
the added application

addEntity

public static IEntity addEntity(Entity entityType,
                                pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
Registers a provider.

Parameters:
entityType - the entity Type to be added
clazz - the provider class to register
Returns:
the added entity

addProvider

public static IProvider addProvider(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
Registers a provider.

Parameters:
clazz - the provider class to register
Returns:
the added provider

addService

public static IService addService(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
Registers a service.

Parameters:
clazz - the service class to register
Returns:
the added service

addStage

public static IStage addStage(pt.digitalis.utils.bytecode.holders.ClassHolder clazz)
Registers a stage.

Parameters:
clazz - the stage class to register
Returns:
the added stage

getApplications

public static Map<String,IApplication> getApplications()
Returns the map of all registered applications.

Returns:
the map of all registered applications

getDefaultProvider

public static IProvider getDefaultProvider()
Returns the default provider.

Returns:
the default provider

getDefaultProviderID

public static String getDefaultProviderID()
Returns the default provider id.

Returns:
the default provider id

getProviders

public static Map<String,IProvider> getProviders()
Returns the map of all registered providers.

Returns:
the map of all registered providers

getRegistry

public static DEMRegistryImpl getRegistry()
Returns the DEMRegistryImpl instance (Singleton pattern).

Returns:
the registry object

getServices

public static Map<String,IService> getServices()
Returns the map of all services registered.

Returns:
the map of all services registered

getStages

public static Map<String,IStage> getStages()
Returns the map of all stages registered.

Returns:
the map of all stages registered

setDefaultProvider

public static void setDefaultProvider(String providerID)
Returns the default provider.

Parameters:
providerID - the new default provider

getApplication

public IApplication getApplication(String applicationID)
Description copied from interface: IDEMRegistry
Returns an application associated with a given ID.

Specified by:
getApplication in interface IDEMRegistry
Parameters:
applicationID - the application ID
Returns:
the provider associated with the given ID if the ID is valid, null otherwise
See Also:
IDEMRegistry.getApplication(java.lang.String)

getProvider

public IProvider getProvider(String providerID)
Description copied from interface: IDEMRegistry
Returns a provider associated with a given ID.

Specified by:
getProvider in interface IDEMRegistry
Parameters:
providerID - the provider ID
Returns:
the provider associated with the given ID if the ID is valid, null otherwise
See Also:
IDEMRegistry.getProvider(java.lang.String)

getService

public IService getService(String serviceID)
Description copied from interface: IDEMRegistry
Returns a service associated with a given ID.

Specified by:
getService in interface IDEMRegistry
Parameters:
serviceID - the service ID
Returns:
the service associated with the given ID if the ID is valid, null otherwise
See Also:
IDEMRegistry.getService(java.lang.String)

getStage

public IStage getStage(String stageID)
Description copied from interface: IDEMRegistry
Returns a stage associated with a given ID.

Specified by:
getStage in interface IDEMRegistry
Parameters:
stageID - the stage ID
Returns:
the stage associated with the given ID if the ID is valid, null otherwise
See Also:
IDEMRegistry.getStage(java.lang.String)


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.