User: juhalindfors
  Date: 02/03/17 02:33:22

  Modified:    src/main/org/jboss/mx/capability
                        OptimizedMBeanDispatcher.java
  Log:
  if ULR is used, create a UCL and directly feed it the bytecodes that define
  the generated class
  
  Revision  Changes    Path
  1.4       +16 -8     
jmx/src/main/org/jboss/mx/capability/OptimizedMBeanDispatcher.java
  
  Index: OptimizedMBeanDispatcher.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jmx/src/main/org/jboss/mx/capability/OptimizedMBeanDispatcher.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OptimizedMBeanDispatcher.java     8 Mar 2002 00:41:36 -0000       1.3
  +++ OptimizedMBeanDispatcher.java     17 Mar 2002 10:33:22 -0000      1.4
  @@ -74,6 +74,9 @@
   import org.apache.bcel.classfile.JavaClass;
   
   import org.jboss.mx.loading.LoaderRepository;
  +import org.jboss.mx.loading.UnifiedClassLoader;
  +
  +import org.jboss.mx.server.ServerConstants;
   
   import org.jboss.mx.metadata.AttributeOperationResolver;
   
  @@ -91,10 +94,10 @@
    * @see org.jboss.mx.capability.DispatchClassLoader
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>.
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    *
    */
  -public class OptimizedMBeanDispatcher
  +public class OptimizedMBeanDispatcher implements ServerConstants
   {
      // Constants -----------------------------------------------------
      final static Class SUPER_CLASS = ReflectedMBeanDispatcher.class;
  @@ -125,12 +128,17 @@
            BufferedOutputStream bos = new BufferedOutputStream(baos);
            c.dump(bos);
   
  -         LoaderRepository rep = LoaderRepository.getDefaultLoaderRepository();
  -
  -         // FIXME: what about ctx cl?
  -         // FIXME: also I dont know if the parent is right here, have to check later
  -         DispatchClassLoader dcl = new 
DispatchClassLoader(resource.getClass().getClassLoader(), className, 
baos.toByteArray());
  -         rep.addClassLoader(dcl);
  +         ClassLoader ocl;
  +         
  +         if 
(System.getProperty(ServerConstants.LOADER_REPOSITORY_CLASS_PROPERTY).equals(
  +                  ServerConstants.UNIFIED_LOADER_REPOSITORY_CLASS))
  +            ocl = new UnifiedClassLoader(className, baos.toByteArray());
  +         else
  +            // FIXME: what about ctx cl?
  +            // FIXME: also I dont know if the parent is right here, have to check 
later
  +            ocl = new DispatchClassLoader(resource.getClass().getClassLoader(), 
className, baos.toByteArray());
  +         
  +         LoaderRepository.getDefaultLoaderRepository().addClassLoader(ocl);
   
            // FIXME: throw the DLC away when an MBean is unregistered!
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to