<< Back to previous view

[CLASSPATH-5] Make extensible to any ClassLoader, not just URLClassLoader derivatives Created: 07/Jan/14  Updated: 10/Jan/14  Resolved: 08/Jan/14

Status: Closed
Project: java.classpath
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Jim Crossley Assignee: Stuart Sierra
Resolution: Completed Votes: 0
Labels: None

Attachments: File classpath-5.diff    
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.



 Comments   
Comment by Jim Crossley [ 07/Jan/14 3:58 PM ]

Attached patch file: classpath-5.diff

Comment by Stuart Sierra [ 07/Jan/14 4:14 PM ]

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.

Comment by Jim Crossley [ 07/Jan/14 4:23 PM ]

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

Comment by Jim Crossley [ 07/Jan/14 4:26 PM ]

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.

Comment by Jim Crossley [ 07/Jan/14 4:35 PM ]

Rebased the patch to make it more clear

Comment by Stuart Sierra [ 07/Jan/14 5:01 PM ]

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.

Comment by Jim Crossley [ 07/Jan/14 5:34 PM ]

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.

Comment by Stuart Sierra [ 07/Jan/14 7:53 PM ]

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

2. Not at this time.

Comment by Stuart Sierra [ 10/Jan/14 11:26 AM ]

in release 0.2.2

Generated at Fri Oct 24 08:50:59 CDT 2014 using JIRA 4.4#649-r158309.