[Design of JBossXB] - Re: JBossXB-2.0.0.CR5
by scott.stark@jboss.org
The CollectionPropertyHandler type still needs to be the propertyType as the localPropertyType is only the colllection parameter type when overriden. If the localPropertyType is only overriden when it has not already been set to something other than the propertyType:
| else if (propertyType.isCollection() && ((ClassInfo) propertyType).getUnderlyingAnnotation(XmlType.class) == null)
| {
| isCol = true;
| propertyHandler = new CollectionPropertyHandler(property, propertyType);
| ClassInfo typeArg = (ClassInfo) findComponentType(property);
|
| //if (((ClassInfo) typeArg).getUnderlyingAnnotation(XmlType.class) != null)
| if (typeArg != null && typeArg.getUnderlyingAnnotation(JBossXmlModelGroup.class) == null)
| {// it may be a model group in which case we don't want to change the type
|
| // TODO yes, this is another hack with collections
| JBossXmlChild xmlChild = ((ClassInfo) propertyType).getUnderlyingAnnotation(JBossXmlChild.class);
| if (xmlChild == null && localPropertyType.equals(propertyType))
| {
| localPropertyType = typeArg;
| }
| }
| }
|
Then all of the BeanTestCase tests pass, and of the 224 mc tests, there are only 9 failures. All the failures are xxxWithValue() tests where the value is null rather than as expected.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088243#4088243
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088243
16 years, 8 months
[Design of JBossXB] - Re: JBossXB-2.0.0.CR5
by scott.stark@jboss.org
The problem is this section of code for collections. The annotation property is a collection, and there is no XmlType annotation, so this gets executed:
| // a collection may be bound as a value of a complex type
| // and this is checked with the XmlType annotation
| else if (propertyType.isCollection() && ((ClassInfo) propertyType).getUnderlyingAnnotation(XmlType.class) == null)
| {
| isCol = true;
| propertyHandler = new CollectionPropertyHandler(property, propertyType);
| ClassInfo typeArg = (ClassInfo) findComponentType(property);
|
| //if (((ClassInfo) typeArg).getUnderlyingAnnotation(XmlType.class) != null)
| if (typeArg != null && typeArg.getUnderlyingAnnotation(JBossXmlModelGroup.class) == null)
| {// it may be a model group in which case we don't want to change the type
|
| // TODO yes, this is another hack with collections
| JBossXmlChild xmlChild = ((ClassInfo) propertyType).getUnderlyingAnnotation(JBossXmlChild.class);
| if (xmlChild == null)
| {
| localPropertyType = typeArg;
| }
| }
| }
|
This ends up overriding the localPropertyType (that has been correctly set previously from the XmlElement) to the interface class. The typeArg is a collection of the interface class when it should be a collection of the overriden localPropertyType.
I guess the findComponentType(property) call needs to take the localPropertyType as well as the CollectionPropertyHandler ctor.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088237#4088237
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088237
16 years, 8 months
[Design of POJO Server] - Re: ManagedOperation aspects for the ProfileService.Manageme
by alesj
"scott.stark(a)jboss.org" wrote :
| The properties are updated during the ManagementView.process call based on what updateComponent calls have been made. These currently just map back to the deployemnt attachment.
|
| ManagedProperty ctxProp = serverComp.getProperties().get(prop.getName());
| // Check for a mapped name
| if( ctxProp == null )
| {
| String mappedName = prop.getMappedName();
| if( mappedName != null )
| ctxProp = serverComp.getProperties().get(mappedName);
| }
| if( ctxProp == null )
| {
| formatter.applyPattern(i18n.getString("ManagementView.InvalidTemplateProperty")); //$NON-NLS-1$
| Object[] args = {prop.getName()};
| String msg = formatter.format(args);
| throw new IllegalArgumentException(msg);
| }
| ctxProp.setValue((Serializable)prop.getValue());
|
I'm failing to see where this change gets applied on the server side?
ManagementView.process calls MainDeployer.process, which only processes undeployments and new deployments.
But I can't see where changed/updated components/deployments are processed ...
"scott.stark(a)jboss.org" wrote :
| ... we also need to send the change to the runtime component.
|
How should we wire this with ManagementView?
Or just use plain KernelBus on the MC side?
I get this when running PS tests.
Was this fixed?
| *** CONTEXTS IN ERROR: Name -> Error
|
| vfsfile:/C:/projects/jboss5/trunk/build/output/jboss-5.0.0.Beta3/server/profileservice/deploy/testHqldbDS-ds.xml -> org.xml.sax.SAXParseException: Premature end of file.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088190#4088190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088190
16 years, 8 months
[Design of JBossXB] - Re: JBossXB-2.0.0.CR5
by scott.stark@jboss.org
It does not appear to be picking up the type from the annotation. For example, when I run the org.jboss.test.xb.builder.object.mc.test.BeanTestCase.testBeanWithAnnotation test, its failing with an attempt to create an interface instance:
anonymous wrote :
| Caused by: org.jboss.joinpoint.spi.JoinpointException: Constructor not found org.jboss.test.xb.builder.object.mc.support.model.AnnotationMetaData[] no constructors
| at org.jboss.joinpoint.plugins.Config.findConstructorInfo(Config.java:276)
| at org.jboss.joinpoint.plugins.Config.getConstructorJoinpoint(Config.java:150)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.newInstance(AbstractBeanInfo.java:221)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.newInstance(AbstractBeanInfo.java:216)
| at org.jboss.xb.spi.AbstractBeanAdapter.construct(AbstractBeanAdapter.java:115)
|
The corresponding property is annotated with the concrete type that should be used however:
| @XmlElement(name="annotation", type=AbstractAnnotationMetaData.class)
| public void setAnnotations(Set<AnnotationMetaData> annotations)
| {
| this.annotations = annotations;
| flushJBossObjectCache();
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088147#4088147
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088147
16 years, 8 months