[ 
http://issues.apache.org/jira/browse/TUSCANY-913?page=comments#action_12448280 
] 
            
Raymond Feng commented on TUSCANY-913:
--------------------------------------

@Reference annotation is not required by the SCA C&I spec (v0.95) section 
1.2.1.3:

1.2.1.3. Semantics of an unannotated POJO
A class that has no annotations and corresponding ComponentType side file can 
still be used as an SCA
component implementation. If the implemented interfaces are not decorated with 
an @Remotable
annotation, the class is considered to implement a single local service whose 
type is defined by the class
(recall that local services may be typed using either Java interfaces or 
classes) or, if the class implements a
single interface, the interface itself.
In the absence of @Property and @Reference annotations, the properties and 
references of a class are
defined according to the following rules:
1. Public setter methods that are not included in any interface specified by an 
@Service annotation.
2. Protected setter methods
3. Public or protected fields unless there is a public or protected setter 
method for the same name
The following rules are used to determine whether an unannotated field or 
setter method is a property or
reference:
1. If its type is simple, then it is a property.
2. If its type is complex, then if the type is an interface marked by 
@Remotable, then it is a reference;
otherwise, it is a property.
3. Otherwise, if the type associated with the member is an array or a 
java.util.Collection, the basetype will
be the element type of the array or the parameterized type of the Collection; 
otherwise the basetype will be the member type. If the basetype is an interface 
with an @Remotable or @Service annotation
then the member will be defined as a reference. Otherwise, it will be defined 
as a property.

> no validation on @Reference(required=true)
> ------------------------------------------
>
>                 Key: TUSCANY-913
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-913
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: Java Spec APIs
>    Affects Versions: Java-M2
>         Environment: windows xp
>            Reporter: Yang Lei
>
>  @Reference(required=true) or by default  @Reference
> I can define a component without giving reference. The code still works.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to