keinmensch wrote:
Hi!
Exploring property injection on SCA components, I find that when I
annotate an instance field in a class like this:
@Property(name="fileContents", required=false)
private String mFileContents;

There is a warning in the log when starting the SCA node:
WARNING: Invalid annotation
@org.oasisopen.sca.annotation.Property(name=fileContents,
required=false) is found on private java.lang.String
com.ivan.components.impl.PropertyPrinterServiceImpl.mFileContents

The SCA 1.0 specification clearly says that the @Property annotation may
only be used on public or protected fields (Java Common Annotations and
APIs, section 1.8.13), however I find no such limitations in the SCA 1.1
specification.
My questions is whether the above warning message is a remains from the
SCA 1.0 days or if the SCA 1.1 specification forgets to mention that
annotated fields must be public or protected? A third possibility that I
should take into consideration is that I simply has failed to find the
appropriate place in the specifications.
Many thanks in advance!


The OASIS SCA Java specifications (Java Common Annotations & APIs, Java POJO Implementation) permits the @Property annotation on private fields (they do not restrict the scope of the field at all).

This was a deliberate change by OASIS.  Looks like Tuscany needs to change to 
reflect this properly.

Thanks for picking this up.


Yours,  Mike.

Reply via email to