#150 Enable overriding the class loader delegation model

Next_Major_Version
closed-fixed
Node (28)
5
2011-09-12
2011-09-07
No

Currently the node's JPPF class loader follows the standard delegation model to its parent.
Sometimes it may be incovenient, especially when a user has added libraries via the addURL(...) method, because it is not possible to avoid a round trip to the server even if the classes are added to the client-tied classloader via its list of URLs.
We propose to enable a delegation model that would first look in the URL-specified class path of the current class loader, then delegate to the parent
There are a number of ways the delegation model could be set:
- statically via the node's configuration file
- using the class loader API
- dynamically with JMX
- in the job SLA

Discussion

  • Laurent Cohen

    Laurent Cohen - 2011-09-07
    • summary: Enable overrinding the class loader delegation model --> Enable overriding the class loader delegation model
     
  • Laurent Cohen

    Laurent Cohen - 2011-09-12
    • status: open --> closed-fixed
     
  • Laurent Cohen

    Laurent Cohen - 2011-09-12

    This feature has now been implemented. The delegation model can be configured via the node configuration proporty "jppf.classloader.delegation" with 2 possible values: "parent" (standard parent-first delegation) and "local" (delegation to parent classloader URL classpath first, then parent remote peer classpath).
    From the perspective of a JPPF task's class loader, the "local" delegation proceeds as follows (for the longest possible path):
    1. client class loader delegates to server class loader
    2. server class loader delegates to node system class loader
    3. system class loader does not find the class: back to server class loader
    4. server class loader does not find the class in its URL classpath: back to client class loader
    5. client class loader does not find the class in its URL classpath: delegate to server class loader for remote request
    6. server class loader does not find the class in the server's classpath: back to client class loader
    7. client class loader remoteley looks up the class in the clilent(s classpath

    The main difference with the standard delegation model is that if a class is in the URL classpath of a JPPF class loader, it will be found without any network request.

    Changes committed to SVN trunk: revisions 1781 and 1782

     
  • Laurent Cohen

    Laurent Cohen - 2011-09-12

    Forgot to add that the delegation model can be changed dynamically:
    - locally by calling the static method AbstractJPPFClassLoader.setDelegationModel(int model)
    - remotely via JMX by calling JMXNodeConnectionWrapper.setDelegationModel(Integer model)
    In all cases, model is one of AbstractJPPFClassLoader.PARENT_FIRST or AbstractJPPFClassLoader.LOCAL_FIRST. If any other value is sent, then PARENT_FIRST will be used.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks