[Design of JBoss ESB] - Re: Webservice - SOAP - JAXB Introductions
by Sylvia Isler
I think this is a great idea also. But I am having trouble getting it to work.
I wrote the following class:
public class UnitPrice {
| public double value;
| UnitPrice(double value){
| this.value=value;
| }
| UnitPrice()
| {
|
| }
| public double getValue()
| {
| return this.value;
| }
|
| }
with the following config file: (note I've tried the XmlAttribute and the commented out XmlElement for presenting a UnitPrice and its value.)
| <?xml version = "1.0" encoding = "UTF-8"?>
| <jaxb-intros xmlns="http://www.jboss.org/xsd/jaxb/intros">
| <Class name="junit.prices.UnitPrice">
| <XmlType name = "UnitPrice"/>
| <Field name="value">
| <!-- XmlElement name="value" nillable="true" /-->
| <XmlAttribute name="value" required="true" />
| </Field>
| </Class>
| </jaxb-intros>
|
and the following xml file for unmarshalling:
<?xml version="1.0" encoding="UTF-8"?>
| <UnitPrice value="40.0" xsi:noNamespaceSchemaLocation="C:\UnitPrice.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
|
I then used the following code to test the unmarshalling of the above XML.
JaxbIntros config = IntroductionsConfigParser.parseConfig(getClass().getResourceAsStream("UnitConfig.xml"));
|
|
| ClassIntroConfig classIntroConfig = config.getClazz().get(0);
| assertEquals(UnitPrice.class.getName(), classIntroConfig.getName());
| IntroductionsAnnotationReader reader = new IntroductionsAnnotationReader(config);
|
| Map<String, Object> jaxbConfig= new HashMap<String, Object>();
| jaxbConfig.put(JAXBRIContext.ANNOTATION_READER, reader);
| JAXBContext jaxbContext = JAXBContext.newInstance(new Class[] {UnitPrice.class}, jaxbConfig);
|
| Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
| JAXBElement jbe = null;
| UnitPrice order =null;
|
| StreamSource ss = new StreamSource(getClass().getResourceAsStream("UsdUnitPrice1.xml"));
|
| jbe = unmarshaller.unmarshal(ss, UnitPrice.class);
|
| order =(UnitPrice)jbe.getValue();
| try{
| assertEquals("get double value error", 40.0, order.getValue());
| } catch (Exception e) {
| fail(e.getMessage());
| }
|
a UnitPrice instance is instantiated. However, the above test code fails because the value attribute of the unmarshalled UnitPrice instance is 0.0 instead of 40.0.
Does anyone see any problems with the JAXB Intros config file above that would cause JAXB to fail to properly unmarshall the above XML file?
Thanks,
Sylvia
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073112#4073112
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073112
18 years, 8 months
[Design of JBossCache] - JBCACHE-816 vs JGRP-105
by galder.zamarreno@jboss.com
In the last few days Manik and I have been discussing http://jira.jboss.com/jira/browse/JBCACHE-816 and as a result of that, we've also started discussing http://jira.jboss.com/jira/browse/JGRP-105
1.- Looking at 816 I thought, is there a real need to resolve this issue at the JBC level? What can JBC bring to the table to resolve this?
Re 1.- JBC is a specialist keeping stuff in memory. Will this proxy keep the data transfered between DCs in memory? I don't see any point of doing this. Local cache instances within DCs will already have this information as propagated by the GR. This led to a second question.
2.- Could this be fully resolved by the enhanced GR (outcome of JGRP-105)?
Re 2.- Resolving this at the GR level it's always gonna be faster than doing it at the JBC level via CacheListeners. Besides, using JBC and CacheListeners as a mere tunnel seems to me an overkill.
3.- In my discussion with Manik, he replied that we might not want all local DC multicasting traffic to be broadcasted to other DCs as this would slow things down. We might only want for example JBC Crud (put, remove...etc) methods to be broadcasted to other DCs.
Re 3.- To resolve this, the enhanced GR could provide provide some kind of filtering that determines which traffic to propagate and which not.
4.- Manik also mentioned that we would like local DC multicast to be synchronous, whereas inter DC or inter GR communications to be asynchronous.
Re 4.- I guess this could be configured at the GR level?
Summary: I'd like to add the following requirements to JGRP-105:
- be able to filter which traffic get's propagated to DCs, i.e. only Cache CRUD methods. JGroups could define an interface for that, which JBC would implement based on its requirements.
- configurable (sync/async) communications for in DC (typically IP multicast) and inter DC (inter GR - typically TCP based)
Finally, JGRP-105 should also provide:
- GR failover. We need to support failover of a GR so that another node in the local DC takes over.
Thoughts?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073075#4073075
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073075
18 years, 8 months