[jboss-dev-forums] [Design of POJO Server] - Re: MetaValue representation of javax.management.ObjectNames

emuckenhuber do-not-reply at jboss.com
Sat Nov 22 09:37:24 EST 2008


"scott.stark at jboss.org" wrote : The type on the underlying mbean is ObjectName, so either we could create a ObjectNameMetaValueHandler to simplify the building/viewing of the CompositeValue, or make use of the ManagementProperty.marshallerFactory() to map the ObjectName to/from a string MetaValue. This later bit does not seem tested, so I'll have to look at that.
  | 
  | In terms of the values not being set, I'll update our JmsDestinationUnitTestCase to set these values and assert that they are not null.
  | 

How about using a MetaMapper for transforming ObjectNames, as this already exists.
something like:


  | public class ObjectNameMetaMapper extends MetaMapper<ObjectName>
  | {
  |    
  |    @Override
  |    public MetaType getMetaType()
  |    {
  |       return SimpleMetaType.STRING;
  |    }
  |    
  |    @Override
  |    public MetaValue createMetaValue(MetaType metaType, ObjectName object)
  |    {
  |       return SimpleValueSupport.wrap(object.getCanonicalName());
  |    }
  | 
  |    @Override
  |    public ObjectName unwrapMetaValue(MetaValue metaValue)
  |    {
  |       return internalUnwrap(metaValue);
  |    }
  | }
  | 
And add a static mapping to the MetaMapper for that, as this seems to be a common use case?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4191475#4191475

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4191475



More information about the jboss-dev-forums mailing list