Hi again. In order to get my goals, I've had to modify the source code os JBossAOP.
I've modified in the class org.jboss.aop.AspectXmlLoader the method loadURL. 
The original code was: 

private static Document loadURL(URL configURL) throws Exception {
      InputStream is = configURL != null ? configURL.openStream() : null;
      if (is == null) {
         throw new IOException("Failed to obtain InputStream from url: " + configURL);
      }

      DocumentBuilderFactory docBuilderFactory = null;
      docBuilderFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
      Document doc = docBuilder.parse(is);
      return doc;
}

And I've added:

private static Document loadURL(URL configURL) throws Exception {
      InputStream is = AspectXmlLoader.class.getResourceAsStream("/jboss-aop.xml");
      if (is == null) {
          is = configURL != null ? configURL.openStream() : null;
      }
      
      if (is == null) {
         throw new IOException("Failed to obtain InputStream from url: " + configURL);
      }

      DocumentBuilderFactory docBuilderFactory = null;
      docBuilderFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
      Document doc = docBuilder.parse(is);
      return doc;
}

Now, each application within servlet-container or application server will have his own
jboss-aop.xml and the only thing to do is put into the classpath of the application 
(i.e.: at WEB-INF/classes/jboss-aop.xml)

It would be nice that name and relative path of this file were specified by a property
(not a system property, please!).


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

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


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to