pt.ist.fenixframework.backend
Class BackEndId

Package class diagram package BackEndId
java.lang.Object
  extended by pt.ist.fenixframework.backend.BackEndId
Direct Known Subclasses:
CurrentBackEndId

public abstract class BackEndId
extends Object

This class represents a feature that all DML code generators must implement: All CodeGenerator implementations should generate a class named CurrentBackEndId (see CodeGenerator.generateBackEndId()) that implements this abstract class and provides information about the current backend that is being used to manage the domain model. This is also part of the support required for configuration by convention.

See Also:
FenixFramework

Constructor Summary
BackEndId()
           
 
Method Summary
abstract  Class<? extends ContextFactory> getAtomicContextFactoryClass()
          Get the Class instance for the factory that creates AtomicContexts.
static BackEndId getBackEndId()
          Lookup via reflection the CurrentBackEndId class and return an instance of it.
abstract  String getBackEndName()
          Get the (unique) name of this BackEnd.
abstract  Class<? extends Config> getDefaultConfigClass()
          Get the Class instance that represents the default configuration class to use for this backend.
 String getParam(String key)
          Search for a parameter value given its key.
protected  String setParam(String key, String value)
          Adds a parameter to the map of parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackEndId

public BackEndId()
Method Detail

setParam

protected final String setParam(String key,
                                String value)
Adds a parameter to the map of parameters. The typical usage of this method is during the initialization of this class, to store parameters, e.g., a module may register that is active by setting a key with a given value.


getParam

public final String getParam(String key)
Search for a parameter value given its key. param key The parameter to lookup.

Returns:
null if the corresponding key does not exist.

getBackEndName

public abstract String getBackEndName()
Get the (unique) name of this BackEnd. The String returned by this method should contain only valid characters in a filename (because it can be used for configuration by convention (see FenixFramework).

See Also:
FenixFramework

getDefaultConfigClass

public abstract Class<? extends Config> getDefaultConfigClass()
Get the Class instance that represents the default configuration class to use for this backend. This class is used to instantite a Config instance is none is explicitly indicated.


getAtomicContextFactoryClass

public abstract Class<? extends ContextFactory> getAtomicContextFactoryClass()
Get the Class instance for the factory that creates AtomicContexts. These contexts are backend-specific (thus the backend provides the factory), because they control the logic required to execute a Callable within a transactional context.


getBackEndId

public static final BackEndId getBackEndId()
                                    throws ConfigError
Lookup via reflection the CurrentBackEndId class and return an instance of it.

Throws:
ConfigError - if the expected class does not exit, or it does not extend the BackEndId class


Copyright © 2013. All Rights Reserved.