sca-j message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [sca-j] [NEW ISSUE] Java C&I Constrctor Examples are incorrect
- From: Mike Edwards <mike_edwards@uk.ibm.com>
- To: OASIS Java <sca-j@lists.oasis-open.org>
- Date: Tue, 17 Mar 2009 10:27:49 +0000
Vamsi,
There is no explicit statement in the
Java C&I spec along the lines that you describe in your note, but I'm
not sure
that there should be a statement of
this kind. It is a consequence of clear statements that are present
in the document:
(all line numbers are from sca-javaci-1.1-spec-wd04_proposal2.doc)
1) @Service annotation is not required
- lines 52-54, plus section 2.3 (lines 161-169)
2) @Reference annotation is not required
- lines 212-214 plus section 8.2 (lines 441-480)
3) @Property annotation is not required
- lines 250-252 plus section 8.2 (lines 441-480)
4) IF a constructor with arguments is
used then it must have @Reference or @Property annotations for each parameter
- lines 264-271 (note that Simon
thinks that the text here needs clarifying, but I take the view that the
text means precisely
this)
- as a result, IF you want an implementation
to have NO @Service, @Reference or @Property annotations, then your
only constructor option is a no-arg
constructor and any properties and references have to be introspected as
defined
by section 8.2....
Yours, Mike.
Strategist - Emerging Technologies, SCA & SDO.
Co Chair OASIS SCA Assembly TC.
IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great Britain.
Phone & FAX: +44-1962-818014 Mobile: +44-7802-467431
Email: mike_edwards@uk.ibm.com
From:
| C Vamsi <vamsic007@in.ibm.com>
|
To:
| OASIS Java <sca-j@lists.oasis-open.org>
|
Date:
| 17/03/2009 09:40
|
Subject:
| Re: [sca-j] [NEW ISSUE] Java C&I
Constrctor Examples are incorrect |
Hi Simon,
I do not recall coming across the requirement, "allows unannotated
implementations if they have a no-parameter constructor" made clear
in the
current spec. To speed things up, can you please point me to the
section/paragraph?
Thanks.
++Vamsi
Apache Tuscany Committer http://tuscany.apache.org
Apache Geronimo Committer and Member of PMC http://geronimo.apache.org
Simon Nash
<oasis@cjnash.com
>
To
OASIS Java
09/03/2009 19:43
<sca-j@lists.oasis-open.org>
cc
Subject
Re: [sca-j]
[NEW ISSUE] Java C&I
Constrctor
Examples are incorrect
Vamsi,
I agree that it's unfortunate that constructor injection isn't
possible for properties and references of unnanotated implementations.
This is because it's not possible to infer the name of a property
or reference that appears as a constructor parameter.
I'm not sure why you think a new issue is needed. The current spec
allows unannotated implementations if they have a no-parameter constructor.
Do you think there is some way to improve on this?
Simon
C Vamsi wrote:
> Simon,
>
> When JAVA-39 was raised, I have not thought about the constructors.
Now
> that we require all parameters of a constructor annotated with a
> @Constructor annotation to have either a @Property or a @Reference
> annotation (JCA90003 in CAA spec), we need to revisit these examples.
> Appears like we have to require an unannotated implementation (i.e.,
one
> with no @Property or @Referene annotations) to have a constructor
with no
> parameters. I guess it will call for a new issue!!
>
> ++Vamsi
> Apache Tuscany Committer http://tuscany.apache.org
> Apache Geronimo Committer and Member of PMC http://geronimo.apache.org
>
>
>
>
> Simon Nash
> <oasis@cjnash.com
> >
To
>
OASIS
Java
> 27/02/2009 20:40
<sca-j@lists.oasis-open.org>
>
cc
>
>
Subject
>
Re:
[sca-j] [NEW ISSUE] Java C&I
>
Constrctor
Examples are incorrect
>
>
>
>
>
>
>
>
>
> I believe this is a duplicate of issue JAVA-39. However, I'd
like
> to understand the reason for the assertion that the examples noted
as
> "does not unambiguously identify all property and reference values"
> are incorrect.
>
> Simon
>
> Mike Edwards wrote:
>> Raiser: Mike
Edwards
>>
>> Target: sca-javaci-1.1-spec-wd03.pdf
>>
>> Description:
>>
>> The constructor examples in section 5 contain errors that make
some of
>> them illegal and they must be fixed.
>>
>> /** Simple class taking a single property value */
>>
>> public class Impl1 {
>>
>> String someProperty;
>>
>> public Impl1(String propval) {...}
>>
>> }
>>
>> *<mje> This one does not "unambiguously identify all
property and
>> reference values"</mje>*
>>
>> /** Simple class taking a property and reference in the constructor;
>>
>> * The values are not injected into the fields.
>>
>> *//
>>
>> public class Impl2 {
>>
>> public String someProperty;
>>
>> public SomeService someReference;
>>
>> public Impl2(String a, SomeService b) {...}
>>
>> }
>>
>> *<mje> This one does not "unambiguously identify all
property and
>> reference values"</mje>*
>>
>> /** Class declaring a named property and reference through the
>> constructor */
>>
>> public class Impl3 {
>>
>> @Constructor({"someProperty", "someReference"})
>>
>> public Impl3(String a, SomeService b) {...}
>>
>> }
>>
>> *<mje>@Constructor annotation has no such attributes (see
[JAVACAA])
>> </mje>*
>>
>> /** Class declaring a named property and reference through parameters
*/
>>
>> public class Impl3b {
>>
>> public Impl3b(
>>
>> @Property("someProperty")
String a,
>>
>> @Reference("someReference) SomeService
b
>>
>> ) {...}
>>
>> }
>>
>> *<mje>This one is OK</mje>*
>>
>> /** Additional property set through a method */
>>
>> public class Impl4 {
>>
>> public String someProperty;
>>
>> public SomeService someReference;
>>
>> public Impl2(String a, SomeService b) {...}
>>
>> @Property public void setAnotherProperty(int x)
{...}
>>
>> }
>>
>> *<mje> This one does not "unambiguously identify all
property and
>> reference values"</mje>*
>>
>>
>> Proposal:
>>
>> Replace the examples with the following ones:
>>
>> /** Constructor declared using @Constructor annotation */
>>
>> public class Impl1 {
>>
>> private String someProperty;
>>
>> @Constructor
>>
>> public Impl1( @Property("someProperty")
String propval ) {...}
>>
>> }
>>
>> /** Declared constructor unambiguously identifying all Property
and
>> Reference values */
>>
>> public class Impl2 {
>>
>> private String someProperty;
>>
>> private SomeService someReference;
>>
>> public Impl2( @Property("someProperty")
String a,
>>
>>
@Reference("someReference") SomeService b )
>>
>> {...}
>>
>> }
>>
>> /** Declared constructor unambiguously identifying all Property
and
>> Reference values
>>
>> plus an additional Property injected via a setter
method */
>>
>> public class Impl3 {
>>
>> private String someProperty;
>>
>> private String anotherProperty;
>>
>> private SomeService someReference;
>>
>> public Impl3( @Property("someProperty")
String a,
>>
>>
@Reference("someReference") SomeService b)
>>
>> {...}
>>
>> @Property
>>
>> public void setAnotherProperty( String anotherProperty
) {...}
>>
>> }
>>
>> /** No-arg constructor */
>>
>> public class Impl4 {
>>
>> @Property
>>
>> public String someProperty;
>>
>> @Reference
>>
>> public SomeService someReference;
>>
>> public Impl4() {...}
>>
>> }
>>
>>
>> Yours, Mike.
>>
>> Strategist - Emerging Technologies, SCA & SDO.
>> Co Chair OASIS SCA Assembly TC.
>> IBM Hursley Park, Mail Point 146, Winchester, SO21 2JN, Great
Britain.
>> Phone & FAX: +44-1962-818014 Mobile: +44-7802-467431
>> Email: mike_edwards@uk.ibm.com
>>
>>
>> ------------------------------------------------------------------------
>>
>> /
>> /
>>
>> /Unless stated otherwise above:
>> IBM United Kingdom Limited - Registered in England and Wales with
number
>> 741598.
>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6
> 3AU/
>>
>>
>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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
>
>
>
---------------------------------------------------------------------
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
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]