[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: MutableClassInfo?

stale.pedersen@jboss.org do-not-reply at jboss.com
Mon Jan 26 08:00:05 EST 2009


we also need to add support for adding classes to the classpool with a byte[] and the posibility to get a byte[] representation of a MutableClassInfo instance.

adding classes to the classpool could be solved with a utilclass or via some sort of ClassPool interface, the way this is done in javassist:ByteArrayClassPath cp = new ByteArrayClassPath(className, classfileBuffer);
  | pool.insertClassPath(cp);

byte[] representation of the class will be added to MutableClassInfo interface:public interface MutableClassInfo extends ClassInfo
  | {
  |    ...
  |    /**
  |     * Converts the class to a Class file. 
  |     * After this method is called, no modifications to the class is allowed.
  |     * 
  |     * @return
  |     */
  |    byte[] toByteCode();
  | }

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

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



More information about the jboss-dev-forums mailing list