java.classpath

Make extensible to any ClassLoader, not just URLClassLoader derivatives

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

Currently, only URLClassLoaders are supported, but with the introduction of a protocol for obtaining a sequence of URL's corresponding to the segments of a ClassLoader's classpath, we make it possible to use this library in JVM's that don't necessarily use a URLClassLoader, e.g. JBoss.

Activity

Hide
Jim Crossley added a comment -

Attached patch file: classpath-5.diff

Show
Jim Crossley added a comment - Attached patch file: classpath-5.diff
Hide
Stuart Sierra added a comment -

The goal is reasonable, but I don't understand this patch: it's extending the Classpath protocol to java.lang.ClassLoader and then trying to call a method which is not defined in java.lang.ClassLoader

Also, I don't understand the description: JBoss is not a JVM.

Show
Stuart Sierra added a comment - The goal is reasonable, but I don't understand this patch: it's extending the Classpath protocol to java.lang.ClassLoader and then trying to call a method which is not defined in java.lang.ClassLoader Also, I don't understand the description: JBoss is not a JVM.
Hide
Jim Crossley added a comment -

Sorry, that patch was a mistake. Corrected one attached (same name)

Show
Jim Crossley added a comment - Sorry, that patch was a mistake. Corrected one attached (same name)
Hide
Jim Crossley added a comment -

Regarding JBoss as JVM, I meant that JBoss, as well as other containers, is a single JVM process, with multiple ClassLoaders active, each responsible for an isolated, deployed app. And none of them are URLClassLoader instances, but they all are capable of returning a list of their classpath segments as URLs.

Show
Jim Crossley added a comment - Regarding JBoss as JVM, I meant that JBoss, as well as other containers, is a single JVM process, with multiple ClassLoaders active, each responsible for an isolated, deployed app. And none of them are URLClassLoader instances, but they all are capable of returning a list of their classpath segments as URLs.
Hide
Jim Crossley added a comment -

Rebased the patch to make it more clear

Show
Jim Crossley added a comment - Rebased the patch to make it more clear
Hide
Stuart Sierra added a comment -

Modified to avoid changes to existing public functions. Committed to master at 0b3401cc

Will build as version 0.2.2-SNAPSHOT, available via Sonatype repo.

Please test and confirm that this satisfies your use case.

Show
Stuart Sierra added a comment - Modified to avoid changes to existing public functions. Committed to master at 0b3401cc Will build as version 0.2.2-SNAPSHOT, available via Sonatype repo. Please test and confirm that this satisfies your use case.
Hide
Jim Crossley added a comment -

That looks good, Stuart, thanks! I have two followup questions:

1) Are you open to using this in tools.namespace?
2) Do you think it's worth obviating dynapath with java.classpath?

This jira gets you most of the way to #2 already. Lacking is the ability to invoke .addURL to expand a classloader's classpath at runtime. If you think it's a good idea, I'll add a jira and take a whack at it.

Show
Jim Crossley added a comment - That looks good, Stuart, thanks! I have two followup questions: 1) Are you open to using this in tools.namespace? 2) Do you think it's worth obviating dynapath with java.classpath? This jira gets you most of the way to #2 already. Lacking is the ability to invoke .addURL to expand a classloader's classpath at runtime. If you think it's a good idea, I'll add a jira and take a whack at it.
Hide
Stuart Sierra added a comment -

1. Yes, but I would prefer to keep it optional.

2. Not at this time.

Show
Stuart Sierra added a comment - 1. Yes, but I would prefer to keep it optional. 2. Not at this time.
Hide
Stuart Sierra added a comment -

in release 0.2.2

Show
Stuart Sierra added a comment - in release 0.2.2

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: