jsr366-experts@javaee-spec.java.net

[jsr366-experts] default resources

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Wed, 05 Nov 2014 16:06:14 -0800

Here's a small issue to get the expert group started!...

There are several places in Java EE 7 where we defined that unmapped
resources must be mapped to the platform default resources. For example,
if you define a DataSource resource or a JMS connection factory resource,
but it's not mapped to a specific (portable or platform-specific)
resource, it must be automatically mapped at deployment time to the
corresponding platform default resource.

See EE.5.19, EE.5.20, and EE.5.21.

Previously, the expectation was that unmapped resources would result in
an error at deployment time. The newly defined behavior fails to consider
two cases:


1. The resource might be mapped using a product-specific deployment descriptor.

The intent was that the default mapping would only occur in the absence
of any explicit mapping. The spec will need to make this clear.


2. The resource might be mapped using a product-specific implicit mapping rule.

This case is more problematic. With nothing in the application code, and
nothing in the deployment descriptors, I would normally expect the deployment
to fail. Some products may have mapped any unmapped resources to some
administrator-defined product-specific resource using some undefined
name mangling or defaulting rules. With the Java EE 7 mapping rules, the
mapping of such resources might change.


How should we handle case #2?

A. The product redefined an error case to be a non-error case, which
   conflicts with the Java EE 7 spec. The product has to change.

B. The spec should allow a product-specific switch that controls whether
   the behavior follows the Java EE 7 rules or the product-specific rules.
   The switch might be per-application or global, but the default must be
   to follow the Java EE 7 rules.

C. The spec should define a per-application switch to control whether
   unmapped resources are mapped to the platform default resources or
   are handled in a product-specific way. The default behavior would
   be as specified in Java EE 7. This allows applications that depended
   on the old product-specific behavior to continue to work, but only if
   the application is changed.

D. The spec should allow a resource with no explicit mapping to be
   mapped to an existing product-specific resource using a product-specific
   implicit mapping as long as that product-specific resource exists. If
   the product-specific resource does not exist, the resource must be mapped
   to the platform-defined default resource. This somewhat reduces
   portability while providing some compatibility with existing products
   that use implicit mapping rules.

Note that parts of B, C, and D could all be done; these choices need not
be exclusive.

Please let me know what you think.

Thanks.