7 Replies Latest reply on Sep 24, 2010 8:19 AM by alesj

    jboss-modules usage

    alesj

      Looking at the AS7 code, I guess this "org.jboss.as.deployment.module" is where I see how to use jboss-modules?
      Or is there some other code that deals with it as well?

      Any docs, wiki, guide, faq, etc I happened to miss?

        • 1. Re: jboss-modules usage
          dmlloyd

          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

            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

              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

                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

                  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

                    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
                      I'll try to get past this by fallback loader.

                      Actually adding system module as dependency + properly filtering it is better.