-
1. Re: jboss-modules usage
dmlloyd Sep 22, 2010 9:50 AM (in response to alesj)JBoss Modules is itself a much better example. If you're just looking to use it (from an end-user perspective), then the AS7 module repository is a good example of laying out how modules are assembled.
If you want to define your own module loader, look at the LocalModuleLoader and other implementations (though beware that the ModuleLoader API might change a little before things are final). Also, he Modules test cases have some good examples of building up a ModuleLoader programmatically.
-
2. Re: jboss-modules usage
jason.greene Sep 22, 2010 9:55 AM (in response to dmlloyd)I published the latest javadoc here:
http://jbossas.github.com/jboss-modules/
Note the javadoc needs some examples inline. We need to do this before it is released in final state:
https://jira.jboss.org/browse/MODULES-39
We should also add a user guide to the wiki.
-
3. Re: jboss-modules usage
jason.greene Sep 22, 2010 10:02 AM (in response to jason.greene)Note the official per release docs are here:
http://docs.jboss.org/jbossmodules/1.0.0.Beta6/api/
I use the github thing to push the *latest* master fairly frequently
-
4. Re: jboss-modules usage
alesj Sep 24, 2010 7:29 AM (in response to dmlloyd)Any reason why (Jar)FileResourceLoader is package private?
As I would need to create an instance of it, but don't wanna duplicate the logic.
-
5. Re: jboss-modules usage
alesj Sep 24, 2010 7:47 AM (in response to alesj)I would also need this filtering to be more flexible -- additional "system" packages ;-):
private Class<?> performLoadClass(String className, boolean exportsOnly, final boolean resolve) throws ClassNotFoundException {
if (className == null) {
throw new IllegalArgumentException("name is null");
}
if (className.startsWith("java.") || className.startsWith("sun.reflect.")) {
// always delegate to system
return findSystemClass(className);
} -
6. Re: jboss-modules usage
alesj Sep 24, 2010 8:06 AM (in response to alesj)I would also need this filtering to be more flexible -- additional "system" packages ;-):
private Class<?> performLoadClass(String className, boolean exportsOnly, final boolean resolve) throws ClassNotFoundException {
if (className == null) {
throw new IllegalArgumentException("name is null");
}
if (className.startsWith("java.") || className.startsWith("sun.reflect.")) {
// always delegate to system
return findSystemClass(className);
}I'll try to get past this by fallback loader.
-
7. Re: jboss-modules usage
alesj Sep 24, 2010 8:19 AM (in response to alesj)I'll try to get past this by fallback loader.
Actually adding system module as dependency + properly filtering it is better.