After reading the wiki my first attempt looks something like

public class JBossClassPreloader {
  |     private static final Logger logger = 
Logger.getLogger(JBossClassPreloader.class);
  | 
  |     public JBossClassPreloader() {
  |             try {
  |                     // get the classloader associated with the thread
  |                     ClassLoader cl = 
Thread.currentThread().getContextClassLoader();            
  |                     // load the class           
  |                     cl.loadClass("org.jboss.mq.selectors.Operator");
  |                     cl.loadClass("org.jboss.mq.selectors.Token");
  |                     //repeat for every possible class that jboss mq uses! 
Eek!
  |             } catch (Exception ex) {
  |                     logger.warn("Exception in class preloader", ex);
  |             } 
  |     }
  | }
  | 

Then I create a new xml file in the deploy directory that has the following


  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE server>
  | <!-- $Id$ -->
  | 
  | <server>
  | 
  |    <mbean code="mypackage.server.plugin.JBossClassPreloader" 
  |           name="jboss:service=MyClassPreloader">
  |    </mbean>
  |    
  | </server>
  | 

Is this kind of what you had in mind Adrian?  Considering how many classes are 
in the jboss mq jar file I dont think this is going to be practical.

Maybe I should create an MBean that presubscribes to one of the topics instead 
to achieve the same classloading effect?  But then how would I make it so the 
MBean is executed after the mbeans that initialise the topics?



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

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


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to