[jboss-user] [JBoss AOP] - How can I intercept methods in java.net.* or javax.*.*?

Mehdi Azarmi do-not-reply at jboss.com
Thu May 12 13:23:59 EDT 2011


Mehdi Azarmi [http://community.jboss.org/people/m.azarmi] created the discussion

"How can I intercept methods in java.net.* or javax.*.*?"

To view the discussion, visit: http://community.jboss.org/message/605002#605002

--------------------------------------------------------------
I found this method in the SystemClassLoader.java (JBoss AOP source code)

   /**
    * Load jre classes from the parent classloader
    *
    * @param name the class name
    * @return the class
    * @throws ClassNotFoundException when there is no class
    */
   protected Class<?> loadClassByDelegation(String name)
      throws ClassNotFoundException
   {
      // FIXME: Only works for Sun for now
      if (name.startsWith("java.") || name.startsWith("javax.")
         || name.startsWith("sun.") || name.startsWith("com.sun.")
         || name.startsWith("org.apache.xerces.") || name.startsWith("org.xml.sax.")
         || name.startsWith("org.w3c.dom."))
         return getParent().loadClass(name);


      return null;
   }

How can I address this "FIXME"?
Is there any simpler way to intercept those methods?

Thank you,
Mehdi
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/605002#605002]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110512/8b9112e6/attachment.html 


More information about the jboss-user mailing list