|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Profile
A representation of the model object 'Profile'. Collection of named things. The purpose of profiles to have a single component configuration for multiple environments where the component might be deployed. For example a single component configuration can be used on a local developer workstation, in a shared development environment, testing environment and production environment. In each deployment the client code supplies a different profile path, but the component configuration resource remains the same. It alleviates an often encountered problem when different environments have different configuration resources and as such problems in production environment can not be reproduced in development environment. An often used approach with substitution variables (tokens) quickly goes out of control as complexity of the system increases. Profiles can leverage substitution variables and provide additional level of flexibility. Profiles form a hierarchy (path). Named values on lower levels shadow/override values defined at higher levels. For example, let's say there is a data source definition. It has driver class, url, user and password. The driver class name (and a path to load the driver) can be defined at the root level, as well as the database user name. Connection URL can be defined at the environment profile level - different URL's for local environment, DEV and PROD. The password shall not be stored in the config file. So it shall come from a substitution token, e.g. $[db.password]. The password can be defined at the root level, or at environment level. In the latter case the token may contain environment name, e.g. $[db.password.DEV]. If, acciedentally, developer tries to load production profile in his local or DEV environment, then startup will fail because of unsuccessful expansion of $[db.password.PROD] token or because substituted password will be invalid. The first case - unsuccessfull expansion is easier to detect and troubleshoot. Profiles also allow to specify different qualities of service (e.g. performance, cost, distributes vs. local computation) for the same component with the same interface in different environments.
The following features are supported:
ConfigPackage.getProfile()| Method Summary | |
|---|---|
String |
getDescription()
Returns the value of the 'Description' attribute. |
String |
getName()
Returns the value of the 'Name' attribute. |
PropertySource |
getOwner()
Returns the value of the 'Owner' container reference. |
void |
setDescription(String value)
Sets the value of the ' Description' attribute. |
void |
setName(String value)
Sets the value of the ' Name' attribute. |
void |
setOwner(PropertySource value)
Sets the value of the ' Owner' container reference. |
| Methods inherited from interface com.hammurapi.config.PropertySource |
|---|
getClassPath, getProfile, getProperty, injectProperties |
| Methods inherited from interface org.eclipse.emf.ecore.EObject |
|---|
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eIsProxy, eIsSet, eResource, eSet, eUnset |
| Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
|---|
eAdapters, eDeliver, eNotify, eSetDeliver |
| Method Detail |
|---|
String getName()
setName(String),
ConfigPackage.getProfile_Name()void setName(String value)
Name' attribute.
value - the new value of the 'Name' attribute.getName()String getDescription()
setDescription(String),
ConfigPackage.getProfile_Description()void setDescription(String value)
Description' attribute.
value - the new value of the 'Description' attribute.getDescription()PropertySource getOwner()
Profile'.
Parent profile or object definition.
setOwner(PropertySource),
ConfigPackage.getProfile_Owner(),
PropertySource.getProfile()void setOwner(PropertySource value)
Owner' container reference.
value - the new value of the 'Owner' container reference.getOwner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||