Changeset 7224


Ignore:
Timestamp:
Nov 14, 2016, 1:43:01 PM (5 years ago)
Author:
Nicklas Nordborg
Message:

References #2041: Support for extension points within extensions

Adding more debug-level logging to see what is going on when initializing the extension system. There is one step in the core that only load some extensions and one step in the web client that load other extensions. Everything that falls outside of that is not loaded at all (at least until a manual re-install is triggered from the web interface).

I think it should be safe to remove the filtering from the web client initialization and let it load all extensions. It seems like it should not touch already registered extensions.

Regarding the ClassCastException mentioned in the second point above I think it is a result of the Registry.RegisteredExtensionPoint.update() only is changing the classloader and not the action class.

Location:
trunk/src/core/net/sf/basedb/util/extensions
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/extensions/Registry.java

    r6881 r7224  
    794794    void update(ExtensionPoint<A> ep, ClassLoader classLoader)
    795795    {
     796      if (log.isDebugEnabled())
     797      {
     798        log.debug("Update registry: " + ep +
     799          "; old classloader="+this.classLoader + "; new classLoader="+classLoader);
     800      }
    796801      this.classLoader = classLoader;
    797802      this.name = ep.getName();
     
    935940    void update(Extension<A> extension, ClassLoader classLoader)
    936941    {
     942      if (log.isDebugEnabled())
     943      {
     944        log.debug("Update registry: " + extension +
     945          "; old classloader="+this.classLoader + "; new classLoader="+classLoader);
     946      }
    937947      this.classLoader = classLoader;
    938948      this.index = extension.getIndex();
  • trunk/src/core/net/sf/basedb/util/extensions/xml/ExtensionPointFilter.java

    r6473 r7224  
    4949{
    5050
     51  private static final org.slf4j.Logger log =
     52    org.slf4j.LoggerFactory.getLogger(ExtensionPointFilter.class);
     53 
    5154  private final Pattern pattern;
    5255 
     
    99102      idToMatch = Values.getStringOrNull(tag.getText());
    100103    }
    101     return idToMatch != null && pattern.matcher(idToMatch).matches();
     104    boolean matches = idToMatch != null && pattern.matcher(idToMatch).matches();
     105   
     106    if (log.isDebugEnabled())
     107    {
     108      if (matches)
     109      {
     110        log.debug(tagName + "[" + idToMatch + "] matches filter: " + pattern);
     111      }
     112      else
     113      {
     114        log.debug(tagName + "[" + idToMatch + "] doesn't match filter: " + pattern);
     115      }
     116    }
     117
     118    return matches;
    102119  }
    103120  // --------------------------
     121
     122  @Override
     123  public String toString()
     124  {
     125    return "ExtensionPointFilter["+pattern+"]";
     126  }
     127 
     128 
     129 
    104130}
  • trunk/src/core/net/sf/basedb/util/extensions/xml/XmlLoader.java

    r6880 r7224  
    223223  public void setFilter(Filter<Element> filter)
    224224  {
     225    log.debug("Using filter: " + filter);
    225226    this.filter = filter;
    226227  }
Note: See TracChangeset for help on using the changeset viewer.