OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sca-j message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: NEW ISSUE: @Service attributes "value" and "interfaces" should becombined


TARGET: Java Common Annotations and APIs

DESCRIPTION: @Service attributes "value" and "interfaces" should be combined

The @Service annotation allows a single service interface
(Java interface or Java class) to be specified using the "value"
attribute, and multiple service interfaces to be specified
using the "interfaces" attribute.

There is no need for these attributes to be separate, because the
Java annotations syntax permits a single value to be specified
for an array-valued attribute, in which case an array containing
one element is implied.  Other SCA Java annotations such as
@Requires and @PolicySets exploit this capability.

By merging the "value" and "interfaces" attribute, the syntax of
@Service can be made simpler to use and easier to describe, with no
loss of capability or convenience.

PROPOSAL:

The following line numbers are taken from Java CAA CD03.

Replace lines 2187-2193 by:

  public @interface Service {

      Class<?>[] value() default { Void.class };
      String name() default "";
      String[] names() default {};
  }

Replace lines 2202-2217 by:

  The @Service annotation has the following attributes:
   • value (1..1) – An array of interface or class objects that are
     exposed as services by this implementation.  The array MUST contain
     at least one element. [JCA90053]
   • name (0..1) -  A string which is used as the service name.  If the
     name attribute is specified on the @Service annotation, the value
     attribute MUST contain an array of exactly one element. [JCA90048]
   • names (0..1) -  Contains an array of Strings which are used as the
     service names for each of the interfaces declared in the values array.
     If the names attribute is specified for a @Service annotation, the
     name attribute MUST NOT be specified. [JCA90049]  The number of Strings
     in the names attributes array of the @Service annotation MUST match
     the number of elements in the values attribute array. [JCA90050]

Replace lines 2222-2225 by:

The service names of the defined services default to the names of the
interfaces or class, without the package name. If the names parameter is
specified, the service name for each interface in the values attribute
array is the String declared in the corresponding position in the names
attribute array.




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]