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: Re: [sca-j] JAVA-98: Summary of current status and proposed directionfor resolution


Based on Friday's discussion, here is the next update of this proposal.

  A) Specific intent annotations can appear together with @Requires
     on the same Java program element.  If they do, the annotations
     contributed by specific intent annotations are merged with those
     contributed by @Requires, following the policy rules for merging
     intents at the same hierarchy level.

     Implementation intents can be applied to the Java implementation
     class for a service.  It is an error to apply an implementation
     intent to a method of a Java implementation for a service,
     a Java interface for a service, a method of a Java interface for
     a service, a Java reference, a Java interface for a reference,
     or a method of a Java interface for a reference.

     Interaction intents can be applied to a service implementation class
     or Java interface used as an SCA service interface, a method of a
     Java interface for a service, an implementation method for a service
     interface method, a Java reference, a Java interface for a reference,
     or a method of a Java interface for a reference.  It is an error to
     apply an interaction intent to a Java implementation class not used
     as an SCA service interface, or to an implementation  method not
     used to implement a service interface method.

  B) The effective interaction intents for a service method are computed
     by the following algorithm:
     1. Use the rules in A) above to find the intents for the method
        and the interaction intents for its declaring class or interface.
     2. Use the policy rules for merging intents within a structural
        hierarchy to merge the intents found in step 1 above, with the
        method at the lower level and the method's declaring class or
        interface at the higher level.
     These rules are applied to the methods of the Java implementation
     class for a service, the methods of the Java interface for a service,
     and the methods of the Java interface for a reference.

  C) For SCA service interfaces, the effective interaction intents for the
     methods of the interface are computed using the following algorithm:
     1. If the service interface is the Java implementation class for
        the service, apply the algorithm described in B) above to the
        service implementation methods and do not proceed with steps
        2 and 3 below.  If the service interface is a Java interface,
        apply the algorithm described in B) above to the service interface
        methods and continue with steps 2 and 3 below.
     2. For each method of the service interface, apply the algorithm
        described in B) above to the corresponding method of the service
        implementation class.
     3. For each method of the service interface, merge the intents
        found in steps 1 and 2 above, following the policy rules for
        merging intents at the same hierarchy level.

     For SCA reference interfaces, the effective interaction intents for
     each method are computed using the following algorithm:
     1. For each method of the reference interface, apply the algorithm
        described in B) above to the reference interface.
     2. For each method of the reference interface, add the intents for
        the Java reference to the intents found in step 1 above, following
        the policy rules for merging intents at the same hierarchy level.

  D) The componentType introspection rules for intents are as follows:
     1. Implementation and interaction intents on the Java implementation
        class for the service are placed on the <implementation.java>
        element in the component type.
     2. Interaction intents on each Java reference are placed on the
        corresponding <reference> element in the componentType.
     3. The Java interface for each Java reference is placed on an
        <interface.java> element within the corresponding <reference>
        element in the componentType.  This interface can carry intent
        annotations.
     4. Interaction intents on each service implementation class or
        Java interface used as an SCA service interface are placed on the
        corresponding <service> element in the componentType.
     5. For SCA service interfaces that did not have intents added by
        step 3 of C) above, the Java interface or class for the SCA service
        is placed on an <interface.java> element within the corresponding
        <service> element in the componentType.  This interface can carry
        intent annotations.
     6. For SCA service interfaces that did have intents added by step 3
        of C) above, a synthetic interface for the SCA service is placed
        on an <interface.java> element within the corresponding <service>
        element in the componentType.  This interface carries the merged
        intent annotations resulting from step 3 of C) above.

        Here is an example that shows how point 6 would work:

        @Remotable
        public interface MyService {
            @Confidentiality
            void myMethod1();
            @Requires(INTEGRITY)
            void myMethod2();
        }

        public class MyServiceImpl implements MyService {
            @Integrity
            public void myMethod1() {...}
            @Requires(AUTHENTICATION)
            public void myMethod2() {...}
        }

        The component type would contain the following interface:

        @Remotable
        public interface $Synthetic_MyService {
            @Confidentiality
            @Integrity
            void myMethod1();
            @Requires({INTEGRITY, AUTHENTICATION})
            void myMethod2();
        }


   Simon

Simon Nash wrote:
> Here is an updated version of my proposed direction for resolution,
> based on the discussion on Monday's call.
> 
>  A) Specific intent annotations can appear together with @Requires
>     on the same Java program element.  If they do, the annotations
>     contributed by specific intent annotations are merged with those
>     contributed by @Requires, following the policy rules for merging
>     intents.  Specifically, qualified intents have priority over
>     unqualified ones, and mutually exclusive intents are an error.
> 
>  B) The effective intents for a service method are computed by the
>     following algorithm:
>     1. Use the rules in A) above to find the intents for the method
>        and its declaring class or interface.
>     2. Use the policy rules for hierarchies to merge the intents
>        found in step 1 above, with the method at the lower level and
>        the method's declaring class or interface at the higher level.
>        Specifically, qualified intents have priority over unqualified
>        intents, and lower level intents cancel out any mutually
>        exclusive intents from the higher level.
> 
>  C) For service interfaces, the effective interaction intents for each
>     method are computed using the following algorithm:
>     1. For each method of the service interface, apply the algorithm
>        described in B) above.
>     2. If the service interface is the Java implementation class for
>        the service, the effective interaction intents are those found
>        in step 1 above.  If the service interface is a Java interface,
>        continue with steps 3 and 4 below.
>     3. For each method of  the service interface, apply the algorithm
>        described in B) above to the corresponding method of the service
>        implementation class, looking only at interaction intents.
>     4. For each method of the service interface, merge the intents
>        found in steps 1 and 3 above, without hierarchical precedence.
> 
>    For reference interfaces, the effective interaction intents for each
>    method are computed using the following algorithm:
>     1. For each method of the reference interface, apply the algorithm
>        described in B) above to the reference interface to obtain the
>        interaction intents for the interface methods.
>     2. For each method of the reference interface, add the interaction
>        intents for the reference to the intents found in step 1 above,
>        without hierarchical precedence.
> 
>  D) For references, all the relevant intents are already present in the
>     component type reference and its interface, so nothing further is
>     needed.  For services, if any intents were added by step 3 of C) above,
>     these intents are represented in the component type by using a new
>     "synthetic" interface for the component type service interface.
>     This "synthetic" interface provides a complete set of methods with
>     annnotations for the intents computed by step 4 of C) above.
> 
>     Here is an example that shows how this would work:
> 
>     @Remotable
>     public interface MyService {
>         @Confidentiality
>         void myMethod1();
>         @Integrity
>         void myMethod2();
>     }
> 
>     public class MyServiceImpl implements MyService {
>         public void myMethod1() {...}
>         @Authentication
>         public void myMethod2() {...}
>     }
> 
>     The component type would contain the following interface:
> 
>     @Remotable
>     public interface $Synthetic_MyService {
>         @Confidentiality
>         void myMethod1();
>         @Integrity
>         @Authentication
>         void myMethod2();
>     }
> 
> 
>   Simon
> 
> Simon Nash wrote:
>> So far we have agreed the following as directional resolutions:
>>
>>  1. We won't follow the JSR 250 guideline about method-level
>>     annotations cancelling the effect of class-level annotations
>>     of the same type.
>>
>>  2. We won't use @Inherited on any intent annotations.
>>
>> I believe the following are generally accepted by the TC.
>>
>>  3. We will follow the other JSR 250 guidelines and we will point
>>     to them by reference rather than copying them into the SCA spec.
>>
>>  4. We will not use @Inherited on any of the non-intent annotations.
>>
>> Questions that still need to be answered:
>>
>>  A) If we retain specific intent annotations, how do they relate to
>>     the @Requires annotation?  They cannot be considered exactly
>>     equivalent because users may have defined other semantics for them.
>>
>>  B) What are the precise rules for merging between method-level
>>     annotations and class-level annotations?
>>
>>  C) How do intent annotations on a service interface interact with
>>     intent annotations on the implementation?
>>
>>  D) How are intent annotations on the implementation represented in
>>     the component type now that <operation> elements have been removed?
>>
>> My proposed answers to the above questions:
>>
>> A) Specific intent annotations can appear together with @Requires
>>    on the same Java program element.  If they do, the annotations
>>    contributed by specific intent annotations are merged with those
>>    contributed by @Requires, with the specific intent annotations
>>    taking priority.  This means that for any given program element,
>>    if any intents contributed by specific intent annotations have
>>    the same base intent names as any intents contributed by @Requires,
>>    all the intents with these base names contributed by @Requires
>>    are ignored for that program element.
>>
>>    More precisely, the effective intents for a Java program element
>>    (class, interface, service method, setter method, field, or
>>    constructor parameter) are computed as follows:
>>    1. Look on the program element for intents contributed by specific
>>       intent annotations.  If different specific intent annotations
>>       contribute intents with the same base intent name, this is
>>       an error.
>>    2. Look on the program element for intents contributed by @Requires
>>       with base intent names that differ from those of any intents
>>       found in step 1.
>>
>> B) The effective intents for a service method are computed as follows:
>>    1. Look on the method for intents using the rules in A) above.
>>    2. Look on the declaring class for intents using the rules in
>>       A) above, disregarding any intents with the same base intent
>>       names as intents that were found in step 1.
>>
>> C) For service methods, the effective intents are found by using
>>    the following algorithm:
>>    1. For each method of the service interface, apply the algorithm
>>       described in B) above to the service implementation class.
>>    2. For each method of the service interface, apply the algorithm
>>       described in B) above to the service interface, disregarding
>>       any intents with the same base intent names as intents that
>>       were found in step 1.
>>
>>   For references and properties, the effective intents are found by
>>   using the following algorithm:
>>    1. Apply the algorithm described in A) above to the program element
>>       defining the reference or property.  Any intents found for a
>>       reference are applied to all methods of the reference.
>>    2. Apply the algorithm described in A) above to the implementation
>>       class containing the program element defining the reference or
>>       property, disregarding any intents with the same base intent
>>       names as intents that were found in step 1.  Any intents found
>>       for a reference are applied to all methods of the reference.
>>    3. For a reference, apply the algorithm described in B) above to
>>       each method of the service interface, disregarding any intents
>>       with the same base intent names as intents that were found in
>>       steps 1 or 2.
>>
>> D) The SCA runtime creates a new interface or class that extends the
>>    Java interface or class that was used to define the SCA service
>>    or reference.  This interface or class contains method-level
>>    @Requires annotations specifying the intents that were derived from
>>    following the steps in C) above.  This new interface or class
>>    is used for the introspected component type.
>>
>>   Simon
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this mail list, you must leave the OASIS TC that
>> generates this mail.  Follow this link to all your TCs in OASIS at:
>> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this mail list, you must leave the OASIS TC that
> generates this mail.  Follow this link to all your TCs in OASIS at:
> https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
> 
> 




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