Community

JBoss Reflect Performance Javassist vs Introspection

reply from Andrew Rubinger in JBoss Microcontainer Development - View the full discussion

ie:

 

/**
 * {@link LifecycleEventHandler} implementation to set the jboss-reflect
 * {@link RepositoryClassPoolFactory}.  Must be called before MC is brought up.
 *
 * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
 */
public enum SetClassPoolLifecycleEventHandler implements LifecycleEventHandler {
 
   INSTANCE;
 
   //-------------------------------------------------------------------------------------||
   // Class Members ----------------------------------------------------------------------||
   //-------------------------------------------------------------------------------------||
 
   /**
    * Logger
    */
   private static final Logger log = Logger.getLogger(SetClassPoolLifecycleEventHandler.class);
 
   //-------------------------------------------------------------------------------------||
   // Required Implementations -----------------------------------------------------------||
   //-------------------------------------------------------------------------------------||
 
   /**
    * {@inheritDoc}
    * @see org.jboss.bootstrap.api.lifecycle.LifecycleEventHandler#handleEvent(org.jboss.bootstrap.api.lifecycle.LifecycleState)
    */
   @Override
   public void handleEvent(final LifecycleState state) throws LifecycleEventException
   {
      /*
       * Make sure we have the correct classpool  
       */
 
      final RepositoryClassPoolFactory factory = new RepositoryClassPoolFactory(ClassPoolRepository.getInstance());
      JavassistTypeInfoFactoryImpl.setPoolFactory(factory);
      if (log.isTraceEnabled())
      {
         log.tracef("Set %s pool factory to %s", JavassistTypeInfoFactoryImpl.class.getSimpleName(), factory);
      }
   }
}

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community