Resource annotation

Resource causes an annotated variable to reference an object that holds values from a specified entry in the EGL deployment descriptor.

EGL package name

eglx.lang

Example use
The following declaration indicates that access details are in the EGL deployment descriptor entry named “myBinding”:
myService IMyService?{@Resource{bindingKey = "myBinding"}};
Annotation detail
Record Resource type Annotation
{
   targets = [elementKind.fieldMbr]
}
   bindingKey string;
   propertyFileName string?;
end
Annotation fields
bindingKey
The name of the entry in an EGL deployment descriptor. The default value of bindingKey is the name of the variable being annotated. The name in the previous example is myService.
propertyFileName
The name of the EGL deployment descriptor that contains the binding. The default value of propertyFileName is the name of the deployment descriptor that is used at deployment time.

When you set the propertyFileName annotation field, do not include a file extension. The name of the file that is accessed at run time includes the following suffix: -bind.xml.

Comments
For details on dynamically accessing a deployment descriptor entry, see SysLib.getResource function.
Compatibility

Table 1. Compatibility
Target Issue
Java No issues.
JavaScript No issues.