[jboss-user] [JBoss Microcontainer Development] - ClassPool bootstrap refactoring

Kabir Khan do-not-reply at jboss.com
Mon Apr 26 07:10:21 EDT 2010

Kabir Khan [http://community.jboss.org/people/kabir.khan%40jboss.com] replied to the discussion

"ClassPool bootstrap refactoring"

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

AbstractMCServerBase now does (once it is working properly I will move the extra code to LifecycleEventListeners)

   protected void doInitialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
      // NEW CODE - 1

       * Make sure we have the correct classpools set up  

      //Initialize jboss-reflect to use the correct classpools
      JBossClClassPoolConfig config = JBossClClassPoolConfig.getInstance();
      RepositoryClassPoolFactory factory = new RepositoryClassPoolFactory(config.getClassPoolRepository());
      // NEW CODE - 1 - END

       * We need to start the bootstrap here so we can set the kernel

       * before we fire start kernel events 

      // Call Super implementation
      // NEW CODE - 2
      //Install the bean configuring the classpools
      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("JBossClClassPoolConfig", JBossClClassPoolConfig.class.getName());
      ValueMetaData inject = builder.createContextualInject(null, null, AutowireType.BY_NAME, InjectOption.CALLBACK);
      //TODO add name to BeanMetaDataBuilder
      builder.addPropertyMetaData("classLoading", inject);
      catch (Throwable e)
         // AutoGenerated
         throw new RuntimeException(e);
      // NEW CODE - 2 - END

The stuff in 1) sets up the classloader system so it understands the bootstrap classloaders
The stuff in 2) "listens" for ClassLoading and registers the container as a module Handler


Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100426/215e5a4d/attachment.html 

More information about the jboss-user mailing list