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

alesj do-not-reply at jboss.com
Sat Nov 22 14:23:16 EST 2008


"scott.stark at jboss.org" wrote : I'm not sure what the hooks are for introducing an attachment or an annotation on jdk types like javax.management.ObjectName are. ?
Something like this:

  |    public <T> void registerMapper(Class<T> clazz, MetaMapper<T> metaMapper)
  |    {
  |       ClassInfo ci = configuration.getClassInfo(clazz);
  |       ci.setAttachment(MetaMapper.class.getName(), metaMapper);
  |    }
  | 
  |    MetaMapper<ObjectName> onMetaMapper = new ObjectNameMetaMapper();
  |    registerMapper(ObjectName.class, onMetaMapper);   
  | 
You only need to be careful for transient ClassInfos,
since it's all weak (value) hash map in the background.

But for jdk classes this should stick in there forever. :-)

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

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



More information about the jboss-dev-forums mailing list