Add a URL as Classpath to "Java Project" Class Loading [message #261275] |
Fri, 17 July 2009 14:40  |
Eclipse User |
|
|
|
Hi,
My application has a design time and a runtime component. The design time
(Eclipse WorkBench) environment generates java code and publishes to a
nominated database. The runtime system loads these classes from the
database for execution. For design time usage of generated java classes,
they need to be in the project classpath. This currently involves
packaging those generated components as reference jars which are added
to the Java Project classpath.
So, operations like crtl+space, Crtl+shift+O etc work.
I was looking for a mechanism whereby the classes added to the database
are automatically available by means of an extension to the Project
ClassLoader. This way, the newly published classes are available to
developers for use without the need to package them in jars.
I have created a URLClassLoader, which if invoked will retrieve the class
details from the Database. I tried the Adapter-OSGI route, but am able to
configure hooks for bundles only. My application is not OSGI based.
I am looking for a mechanism to add the classes from my Database to the
classpath of my Eclipse Project. I hope there is one.
Any thoughts?
Much appreciated.
Cheers
arun
|
|
|
Re: Add a URL as Classpath to "Java Project" Class Loading [message #261378 is a reply to message #261275] |
Mon, 27 July 2009 09:18  |
Eclipse User |
|
|
|
> I am looking for a mechanism to add the classes from my Database to the
> classpath of my Eclipse Project. I hope there is one.
That's not an easy task, since JDT currently depends on .class or .java
files being present somewhere in the file system.
The classpath of a Java project can be extended by a plug-in that
contributes to the org.eclipse.jdt.core.classpathContainerInitializer
extension point, but the implementation again has to point to class
files or jars.
I guess the only way to implement this is to plug in your own file
system, see the org.eclipse.core.filesystem.filesystems extension point
and the help (Platform Plug-in Developer Guide > Programmer's Guide >
Advanced resource concepts > Alternate file systems).
HTH,
Markus
|
|
|
Powered by
FUDForum. Page generated in 0.24207 seconds