1 2 Previous Next 23 Replies Latest reply on Nov 14, 2008 8:35 AM by Jeff Mesnil

    creating integration layer

    Andy Taylor Master

      Currently core needs the following dependencies to build:

      netty/mina
      jboss security
      Jboss Logging and log4j
      Micro Container

      I'm going to move all these implementations into an integration layer which will exist similar to the jms layer i.e. org.jboss.messaging.integration.remoting.impl.netty.

      I'll then change the build to create multiple jars:

      jboss-messaging.jar
      jbm-transports.jar
      jbm-security.jar
      jbm-logging.jar
      jbm-bootstrap.jar
      jbm-util.jar

      I'll also go through all the current third party jars to check we actually need them all.

      Does any body have any views/comments.

        • 1. Re: creating integration layer
          Tim Fox Master

          I don't think util needs to be in its own jar.

          I'd go for:

          jbm-core.jar (pure core stuff)
          jbm-jms.jar (jms stuff)
          jbm-core-client.jar (pure core client stuff only)
          jbm-transports.jar
          jbm-jbossas-security.jar
          jbm-logging.jar
          jbm-bootstrap.jar

          • 2. Re: creating integration layer
            Clebert Suconic Master

            Begin brain storm...

            In my experience, when you break JARs you need to ensure the dependencies are aways one way.

            For example, if there is something on jbm_core referencing jbm_jms by accident like an unused import, it needs to be verified / fixed. Or else you will aways require to have all the jars no matter what you use.

            I can only think about testing it using compilation targets.


            ... end brain storm

            • 3. Re: creating integration layer
              Andy Taylor Master

               

              I don't think util needs to be in its own jar.


              Ok, I'll leave the util stuff in with core as all the other jars need this for compiling anyway.

              • 4. Re: creating integration layer
                Andy Taylor Master

                 

                In my experience, when you break JARs you need to ensure the dependencies are aways one way.


                I'll make sure the jars are created in the correct dependency order and also make sure i clean the build/classes dir between compilations.

                • 5. Re: creating integration layer
                  Tim Fox Master

                   

                  "clebert.suconic@jboss.com" wrote:
                  Begin brain storm...

                  In my experience, when you break JARs you need to ensure the dependencies are aways one way.


                  Yes, the dependencies are all one way.

                  jbm-core depends on nothing
                  everything depends on jbm-core

                  • 6. Re: creating integration layer
                    Andy Taylor Master

                    currently Logger is a concrete class. I was thinking of making this an interface and adding a LoggerFactory class for instantiation. Then provide 2 implementations the one we have, currently jboss logging, and a new one which just uses java.util.Logger. The factory would use the jboss one if it was on the classpath and if not fallback to the jdk one. I could also add asys pref check as well.

                    • 7. Re: creating integration layer
                      Tim Fox Master

                       

                      "ataylor" wrote:
                      currently Logger is a concrete class. I was thinking of making this an interface and adding a LoggerFactory class for instantiation. Then provide 2 implementations the one we have, currently jboss logging, and a new one which just uses java.util.Logger. The factory would use the jboss one if it was on the classpath and if not fallback to the jdk one. I could also add asys pref check as well.


                      The idea with logging in JBM 2.0 was to always use java.util.Logger so we don't pull in any other dependencies.

                      Then, if someone wants to use log4j or jboss logging, they can provide an "adapter" (I believe JUL logging allows this) which can be configured at run time to be used.

                      We could provide adapters for jboss logging and log4j

                      • 9. Re: creating integration layer
                        Tim Fox Master

                        We can create a formatter that a) uses log4j b) uses jboss logging c) something else?

                        • 10. Re: creating integration layer
                          Andy Taylor Master

                          sounds good, I'll do that as well

                          • 11. Re: creating integration layer
                            Clebert Suconic Master

                             

                            "timfox" wrote:
                            "clebert.suconic@jboss.com" wrote:
                            Begin brain storm...

                            In my experience, when you break JARs you need to ensure the dependencies are aways one way.


                            Yes, the dependencies are all one way.

                            jbm-core depends on nothing
                            everything depends on jbm-core


                            My point was, we need to ensure the dependencies are not broken. I mean.. we need to find eventual mistakes through compilation ant tasks.

                            • 12. Re: creating integration layer
                              Tim Fox Master

                               

                              "clebert.suconic@jboss.com" wrote:

                              My point was, we need to ensure the dependencies are not broken. I mean.. we need to find eventual mistakes through compilation ant tasks.


                              Yes, that's part of what Andy is doing.

                              E.g. jar is compiled by its own compile target which only allows the correct dependencies so it will catch these kind of errors.

                              • 13. Re: creating integration layer
                                Andy Taylor Master

                                I've checked in the refactoring for the new integration layer etc. Each layer is compiled separately and the result added to a separate jar, so we have.

                                JBM core, Core now has no dependencies on anything else. The resulting classes are archived in jbm-core.jar and jbm-client-core.jar. The latter still needs tidying up as it still contains some classes that probably should only be server side.

                                Transports. The netty and mina implementations of remoting now live under org.jboss.messaging.integration.transports. They depend on core and obviously netty and mina for compilation. These are the archived to jbm-transports.jar. I've left the invm transport in core i wasn't sure whether to do that or move it as well. If i do move then at least the pckage names would be consistent, wdyt?

                                Security, The jbossas security manager has been moved to org.jboss.messaging.integration.security. Again I've left the basic security manager in core as it has no dependencies, I'll move this if we decide to move the invm transport to be consistent.

                                Logging, Logger now uses java.util.Logger. I've also added to handlers under org.jboss.messaging.logging, one for the jboss logger and one for log4j. These can be used by changing the handlers configured in logging.properties under jre/lib. Ive added one under src/etc that uses the jboss logge We need this for when we bootstrap using the MC since if we don't provide a jboss logger plugin, aop defaults all of its logging to stdout. the tests/examples etc use the default java.util.logger.

                                I still have a bit more tidying up to do, i need to test all the examples etc still work. Any issues let me know.

                                • 14. Re: creating integration layer
                                  Tim Fox Master

                                  Looks good :)

                                  That's cool, now, with just jbm-core.jar you have a fully functioning messaging system with zero dependencies on anything other than standard JDK library :)

                                  Quick question - do we still need to drag in all the dependencies in build-thirdparty.xml?

                                  If so, could they be put into sections into the file with a comment, e.g. "these dependencies are required to run jms tests etc "

                                  1 2 Previous Next