New approaches for integrating java libraries via network class loader

Description

One of the abilities that is missing in ColdFusion is to be able to class load new java libraries dynamically. Right now you can only achieve this in the following ways:

1) Add to lib path. Not portable, extremely custom and not modular.
2) Add to Application.cfc via this.javaSettings. Great for standalone apps, but not modular and does not allow for on-deman loading.

It would be great to integrate a network class loader into the current page context class loader so you can add paths a-la-carte, get the current loaded URLs, or remove them as needed. This is completely doable as we have achieved this already with the JavaLoader project with Mark Mandel. It requires implementing a network class loader and just attaching it to the current parent loader.

This would open great flexibility for modular development and not monolithic development for Java integrations.

Here are some proposals for implementation:

1. Top level functions
addJavaClassPath( paths )
getJavaClassPaths()
removeJavaClassPaths()

2. Objectifyed
getPageContext().addClassPaths()
getPageContext().getClassPaths()
getPageContext().removeClassPaths()

I find this imperative if we want to integrate modularly with Java. If not, we go back to monolithic times.

Assignee

Michael Offner

Reporter

Luis Majano

Labels

None

Priority

New
Configure