@Privileged annotationThe @Privileged annotation can be applied only to a class definition, and it must be applied to the class named in the metamodel XML descriptor. For example, it cannot be on a superclass or any other class directly or indirectly loaded from the metamodel JAR file. This annotation has no arguments. If a class does not have this annotation, any other privilege-related annotations in the class (such as @CredentialServiceReference) are ignored. @CredentialServiceReference annotationThe @CredentialServiceReference annotation can be applied only to fields in a class that has the @Privileged annotation. It can be used only on class fields, not on local variables. Class fields with this annotation must be non-static, private, transient, and be of the type com.engineous.sdk.security.CredentialService. These requirements are checked at runtime; violations will not cause a compile-time error. It is not useful to have this annotation on more than one field in a class, but there is nothing that prevents such usage. The @CredentialServiceReference annotation has no arguments. The field associated with this annotation will be set (injected) with a reference to a CredentialService object after the class is instantiated (constructor is called), but before any other methods are invoked on the class. The extension can use the CredentialService to obtain the various types of credentials that the service supports. The annotated field will always (after construction) have a valid, non-null reference to a CredentialService. However, that service will supply credentials only at specific times, depending on the type of extension (see the table below). If the service is called at a time when the credentials are not available—for example, if a component calls the service during its initialize() method—the service will throw a CredentialNotAvailableException.
|