system/src/sc/layer/LayeredSystem.java
private void resetClassLoader() {
      if (buildClassLoader instanceof TrackingClassLoader) {
         ((TrackingClassLoader) buildClassLoader).deactivate();
      }
      buildClassLoader = getClass().getClassLoader();
      RTypeUtil.flushCaches();
      resetClassCache();
      resetModelCaches();
      initSysClassLoader(buildLayer, ClassLoaderMode.ALL);

      if (getUseContextClassLoader())
         Thread.currentThread().setContextClassLoader(getSysClassLoader());
      refreshBoundTypes(ModelUtil.REFRESH_CLASSES, true);

      // Test processors and other instances need to be refreshed with the new class loader
      if (buildInfo != null)
         buildInfo.reload();
   }
/**
    * Before we run any application code, we want to build a single canonical class loader used by the system.
    * We'll throw away the existing one and flush out any classes loaded for compilation.  The issue is that some
    * systems like openJPA use their class loader to load resources etc.  This class loader needs to have access to
    * stuff in any buildDir used by the layered system.  When there are multiple build layers at once, we need a
    * class loader which can find the compiled classes that does not contain any files we are building.
    * <p>
    * If this becomes problematic, another approach is to use the ClassFile's for compilation and only use the
    * ClassLoader scheme when we start running stuff.
    */
Before we run any application code, we want to build a single canonical class loader used by the system.
We'll throw away the existing one and flush out any classes loaded for compilation.  The issue is that some
systems like openJPA use their class loader to load resources etc.  This class loader needs to have access to
stuff in any buildDir used by the layered system.  When there are multiple build layers at once, we need a
class loader which can find the compiled classes that does not contain any files we are building.

If this becomes problematic, another approach is to use the ClassFile's for compilation and only use the
ClassLoader scheme when we start running stuff.
Before we run any application code we want to build a single canonical class loader used by the system . We ' ll throw away the existing one and flush out any classes loaded for compilation . The issue is that some systems like openJPA use their class loader to load resources etc . This class loader needs to have access to stuff in any buildDir used by the layered system . When there are multiple build layers at once we need a class loader which can find the compiled classes that does not contain any files we are building . If this becomes problematic another approach is to use the ClassFile ' s for compilation and only use the ClassLoader scheme when we start running stuff .
private void resetClassLoader() {
      if (buildClassLoader instanceof TrackingClassLoader) {
         ((TrackingClassLoader) buildClassLoader).deactivate();
      }
      buildClassLoader = getClass().getClassLoader();
      RTypeUtil.flushCaches();
      resetClassCache();
      resetModelCaches();
      initSysClassLoader(buildLayer, ClassLoaderMode.ALL);
      if (getUseContextClassLoader())
         Thread.currentThread().setContextClassLoader(getSysClassLoader());
      refreshBoundTypes(ModelUtil.REFRESH_CLASSES, true);
      if (buildInfo != null)
         buildInfo.reload();
   }
private void resetClassLoader ( ) { if ( buildClassLoader instanceof TrackingClassLoader ) { ( ( TrackingClassLoader ) buildClassLoader ) . deactivate ( ) ; } buildClassLoader = getClass ( ) . getClassLoader ( ) ; RTypeUtil . flushCaches ( ) ; resetClassCache ( ) ; resetModelCaches ( ) ; initSysClassLoader ( buildLayer , ClassLoaderMode . ALL ) ; if ( getUseContextClassLoader ( ) ) Thread . currentThread ( ) . setContextClassLoader ( getSysClassLoader ( ) ) ; refreshBoundTypes ( ModelUtil . REFRESH_CLASSES , true ) ; if ( buildInfo != null ) buildInfo . reload ( ) ; }
Before we run any application code, we want to build a single canonical class loader used by the system.
Before we run any application code we want to build a single canonical class loader used by the system .
// Test processors and other instances need to be refreshed with the new class loader