[ http://issues.apache.org/jira/browse/TUSCANY-773?page=all ]
Venkatakrishnan updated TUSCANY-773:
------------------------------------
Attachment: Tuscany-sca-kernel-core-03-Oct.diff
Tuscany-sca-kernel-spi-03-Oct.diff
Tuscany-spec-sca-03-Oct.diff
Hi Raymond,
I have now included the missing file. I pulled down the latest revision and
have created these patchs over it.
I have tested for the following component defn. I created a simple Java Bean
called HelloSayer that has two string fields - firstName and lastName. Then I
added this as a field in the component implementation and exposed it as a
property (with annotations). And then here in this comp. defn. i configure
those properties.
--------------------------------------------------------------------------------------------------------
<component name="HelloWorldJavaReference">
<implementation.java class="helloworld.HelloWorldServiceImpl"/>
<property name="greeting">
Hullow
</property>
<property name="helloSayer">
<firstName>Tuscany</firstName>
<lastName>World</lastName>
</property>
</component>
HelloSayer.java
----------------------
public class HelloSayer {
public String firstName = "";
public String lastName = "";
}
HelloWorldServiceImpl.java
-------------------------------------
public class HelloWorldServiceImpl implements HelloWorldService {
@Property
public String greeting = "Default hello";
@Property
public HelloSayer helloSayer = new HelloSayer();
public String sayHello(String s) {
return greeting + " " + s + " from " + helloSayer.firstName + " " +
helloSayer.lastName;
}
}
--------------------------------------------------------------------------------------------------------
*) to the question on support for xpath thro the 'source' attribute, I would
prefer to get into this after we have containers (javascript, ruby and maybe
even groovy) work for properties that are specified as xml within the comp.
defn. itself. Just want to have the basic functionality working across
containers. I see that 'source' will not be stop show since the user will
still be able to get a feel of property config. for components. Is my view
right here ?
*) As for the 'databinding', well I am really interested in getting that
onboard for this with your help :). Right now the xml document is transformed
to a java object using reflection. Do we have a databinding transformer that
does this more and in more scalable way? And if so how do we fit it here -
mean the programming model to be used to exploit the databinding facility.
This is going to be something we may need across containers albiet in different
forms.
Thanks
- Venkat
> Fix Property Value Loading from Component Definitions
> -----------------------------------------------------
>
> Key: TUSCANY-773
> URL: http://issues.apache.org/jira/browse/TUSCANY-773
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core
> Affects Versions: Java-M2
> Reporter: Venkatakrishnan
> Attachments: rfeng.patch, Tuscany-kernel-core-02-Oct.diff,
> Tuscany-kernel-spi-02-Oct.diff, Tuscany-sca-kernel-core-03-Oct.diff,
> Tuscany-sca-kernel-spi-03-Oct.diff, Tuscany-spec-sca-02-Oct.diff,
> Tuscany-spec-sca-03-Oct.diff
>
>
> Currently property loading for application components does not work. There
> is NPE exception thrown when creating a property instance factory based on
> the property value defined in the Component Defn.
> Also the property loading works only for simply types whose values can be
> represented as a simple xml text content.
--
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]