Java Reference
In-Depth Information
ies, which are: addition of annotations, addition of methods, and changing of some
access modifiers.
The added annotations
In all, JavaMail 1.5 introduced two new annotations (
@MailSessionDefinition
and
@MailSessionDefinitions
) to configure JavaMail session resources in a
Java EE 7 application server.
The
@MailSessionDefinition
annotation contains several parameters (see the
Java
class in the following code) with the goal of offering the possibility to define a
Mail Session that will be registered in any valid Java EE namespace and accessed
by other components through the
JNDI
.
The following code highlights the attributes of
@MailSessionDefinition
annota-
tion:
public @interface MailSessionDefinition {
String description() default "";
String name();
String storeProtocol() default "";
String transportProtocol() default "";
String host() default "";
String user() default "";
String password() default "";
String from() default "";
String[] properties() default {};
}