Changeset 7228


Ignore:
Timestamp:
Nov 16, 2016, 8:43:51 AM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2041: Support for extension points within extensions

Implemented a better solution for re-installing an updated extension. The class loader is now reset as part of the re-installation process and not as part of the scanning-for-changes process. The existing ResetErrorFlagProcessor class has been deprecated and replaced with the more generic ResetProcessor which is able to reset the error flag, class loader and any other things we might need to reset in the future when doing a re-installation.

Location:
trunk/src
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/extensions/ExtensionsControl.java

    r7108 r7228  
    7272import net.sf.basedb.util.extensions.manager.processor.ExtractResourcesProcessor;
    7373import net.sf.basedb.util.extensions.manager.processor.PluginInstallationProcessor;
    74 import net.sf.basedb.util.extensions.manager.processor.ResetErrorFlagProcessor;
     74import net.sf.basedb.util.extensions.manager.processor.ResetProcessor;
    7575import net.sf.basedb.util.extensions.manager.processor.UnregisterExtensionsProcessor;
    7676import net.sf.basedb.util.extensions.xml.ExtensionPointFilter;
     
    257257      if (!initialScan)
    258258      {
    259         ResetErrorFlagProcessor resetError = new ResetErrorFlagProcessor(results);
    260         manager.processFiles(resetError, new InstallFilter(request, true)); // Ignore error flag
     259        ResetProcessor reset = new ResetProcessor(results);
     260        manager.processFiles(reset, new InstallFilter(request, true)); // Ignore error flag
    261261      }
    262262       
  • trunk/src/core/net/sf/basedb/util/extensions/manager/ExtensionsFile.java

    r7227 r7228  
    582582    throws IOException
    583583  {
    584     if ((jarLoader == null || wasModified) && isJar())
     584    if ((jarLoader == null) && isJar())
    585585    {
    586586      jarLoader = (JarClassLoader)JarClassLoader.getInstance(getFile().getAbsolutePath(), true);
     
    738738    {
    739739      xtFile.hasError = error;
     740    }
     741   
     742    /**
     743      Reset the classloader for this file, forcing a new
     744      instance in case the JAR file has been changed.
     745      This method should be called before re-installing
     746      an extension and the {@link ExtensionsFile#checkModified()}
     747      returns true.
     748      @throws IllegalStateException If the file has been closed
     749      @since 3.10
     750    */
     751    public void resetClassLoader()
     752    {
     753      checkClosed();
     754      xtFile.jarLoader = null;
    740755    }
    741756
  • trunk/src/core/net/sf/basedb/util/extensions/manager/processor/ResetErrorFlagProcessor.java

    r6520 r7228  
    3535  @since 3.2.4
    3636  @base.modified $Date$
     37  @deprecated In 3.10, use {@link ResetProcessor} instead
    3738*/
     39@Deprecated
    3840public class ResetErrorFlagProcessor
    3941  implements ExtensionsFileProcessor
Note: See TracChangeset for help on using the changeset viewer.