jsr342-experts@javaee-spec.java.net

[jsr342-experts] resource-specific approach to metadata

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Thu, 13 Oct 2011 10:44:10 -0700

The consensus of the group has been that the resource-specific approach
to metadata is preferable.

I'd like to follow up on the earlier discussion regarding specification
of configurability information with regard to resource-specific resource
annotations.

We believe that we can address this by means of a suitable set of
required elements and suitable defaults.

The proposed semantics are as follows:

The values specified for required elements must be observed.

In general, non-default values specified for optional elements *should*
be observed. Changing the values set for some optional elements (e.g.,
transactional) may cause the application to break. Changing the values
set for optional elements related to quality of service (e.g., pool sizes,
idle times, etc.) may affect the performance of the application.

The following default values used in the DataSourceDefinition,
JMSConnectionFactoryDefinition, JMSDestinationDefinition,
MailSessionDefinition, and ConnectorResourceDefinition indicate that
an element value has *not* been set:
   * integer-valued elements: -1
   * string-valued elements: ""
   * array-valued elements {}


An implementation of this specification may choose suitable server-specific
default values for optional elements for which values have not been set.
An implementation of this specification may place restrictions on and/or
alter values set for optional elements related to quality of service.

Definitions for the proposed annotations are given below. If the expert
group agrees with this approach, I'll follow up with corresponding XML.


-Linda

---------


package javax.jms;

import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

@Retention(RUNTIME)
@Target({TYPE, METHOD, FIELD})
public @interface JMSConnectionFactoryDefinition {
     String description() default "";
     String name();
     String className() default "";
     String resourceAdapterName() default "";
     String user() default "";
     String password() default "";
     String clientId() default "";
     boolean transactional() default true;
     int initialPoolSize() default -1;
     int maxPoolSize() default -1;
     int minPoolSize() default -1;
     int maxIdleTime() default -1;
     int connectionTimeout() default -1;
     String[] properties() default {};
}


-----

package javax.jms;

import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

@Retention(RUNTIME)
@Target({TYPE, METHOD, FIELD})
public @interface JMSDestinationDefinition {
     String description() default "";
     String name();
     String className();
     String resourceAdapterName() default "";
     String resourceName() "";
     String[] properties() default {};
}


-----

package javax.mail;

import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;


@Retention(RUNTIME)
@Target({TYPE})
public @interface MailSessionDefinition {
     String description() default "";
     String name();
     String storeProtocol() default "";
     String storeProtocolClass() default "";
     String transportProtocol() default "";
     String transportProtocolClass() default "";
     String host() default "";
     String user() default "";
     String from() default "";
     String[] properties() default {};
}


------

package javax.resource;

import static java.lang.annotation.ElementType.TYPE;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Target;

@Retention(RUNTIME)
@Target({TYPE})
public @interface ConnectorResourceDefinition {
     String description() default "";
     String name();
     String className();
     String[] properties() default {};
}