1 2 3 Previous Next 35 Replies Latest reply on Jun 30, 2010 11:31 PM by dan.j.allen Go to original post
      • 30. Re: Courting Fakereplace to JBoss.org
        dan.j.allen

        Great news Stuart. Obviously, we are really hoping that the Weld integration will be the most attractive to tackle first because that's the one many people have been asking about. Plus, CDI is so pervasive that you will hit a wide audience, though that is certainly true of Hibernate as well.

         

        Also, good news. We got the approval to create a Hot Deployment subspace under JBoss AS. That's likely where discussion of this tool will move, and it will also ensure a lot of exposure (and likely help as well).

         

        I'd like to share some information that Stuart sent me today about how to actually use fakereplace. Assuming you have a Maven 2 example of Seam 2 running on Jetty (the holy grail, right?). My socialize example fits these requirements.

         

        Assume that $FAKEREPLACE_PARENT points to the fakereplace-parent project.

         

        export MAVEN_OPTS=' -javaagent:$FAKEREPLACE_PARENT/bundle/target/fakereplace.jar -Dorg.fakereplace.packages=com.socialize'

         

        You also need to disable jetty hot deployment in pom.xml (otherwise the reloaded classes just get discarded straight away):
         <scanIntervalSeconds>0</scanIntervalSeconds>

         

        Now start Jetty on the project:

         

        mvn jetty:run

         

        After making a change to a Java class, just run 'mvn compile' (or let your IDE compile the class) and fakereplace should replace the classes.

        • 31. Re: Courting Fakereplace to JBoss.org
          dan.j.allen

          Here's some information I found from Stuart in the Weld forums about how fakereplace compares to regular server hot deployment.

           

           

          The approach recompiles your classes on the fly as they are loaded into the JVM to allow them to be replaced later.

           

          Compared to hotswap (in Weblogic)

           

          Hotswap only allows you to replace method bodies. Fakreplace can allow you to replace much more, including methods, fields and annotations. It does not however allow you to change superclasses or interfaces.

           

          Compared to app server hot deploy

           

          It is much faster than an application server hot deploy, as it only replaces the modified classes and does not totally re-initialise the application. However an app server hot deploy allows you to change everything about your class including superclasses / interfaces.

          • 32. Re: Courting Fakereplace to JBoss.org
            swd847

             

            Compared to hotswap (in Weblogic)

             

            Hotswap only allows you to replace method bodies. Fakreplace can allow you to replace much more, including methods, fields and annotations. It does not however allow you to change superclasses or interfaces.

             


            Actually hotswap is not Weblogic specific,  but a JVM feature (hotswap is what fakereplace uses internally to swap out method bodies).

             

            Weblogic has a feature called fastswap, that allows you to add methods and fields, however it does not have reflection support, so the synthetic methods that they add to support this are visible at runtime, and changes made to the classes are not visible through reflection (At least this is what I gather from their website, I have never actually used it).

             

             

            With regard to the Weld integration I probably will attempt it first, but I think that I will need to put specific hooks into weld to make it happen. It would be really complicated and messy to try and hook everything in without direct support from Weld, and prone to breakage every time a new version is released.

            • 33. Re: Courting Fakereplace to JBoss.org
              swd847

              I just did a new release that should have full support for adding virtual methods, and quite a few bug fixes.

               

              I have also added a hacking.txt file, that gives more detail on how it works and how to start playing with the code (this is still a work in progress).

               

              From now on I will move all discussion into the newly created 'Hot Deployment' subspace, under jboss AS.

              • 34. Re: Courting Fakereplace to JBoss.org
                dan.j.allen

                Awesome news. I'm glad that our request to create the new Hot Deployment space was granted, because I can anticipate some great conversations happening there. See ya in Hot Deployment!

                • 35. Re: Courting Fakereplace to JBoss.org
                  dan.j.allen
                  Actually hotswap is not Weblogic specific, but a JVM feature (hotswap is what fakereplace uses internally to swap out method bodies).

                   

                  Doh! That's right, I was getting my terminology mixed up.

                   

                  Weblogic has a feature called fastswap, that allows you to add methods and fields, however it does not have reflection support, so the synthetic methods that they add to support this are visible at runtime, and changes made to the classes are not visible through reflection (At least this is what I gather from their website, I have never actually used it).

                   

                  That's one of the things that really impressed me about fakereplace.

                   

                  With regard to the Weld integration I probably will attempt it first, but I think that I will need to put specific hooks into weld to make it happen. It would be really complicated and messy to try and hook everything in without direct support from Weld, and prone to breakage every time a new version is released.

                   

                  Indeed. And this is a good time to work with the Weld team as they have a release out the door that is stable for JBoss AS 6 and are looking at the horizon.

                  1 2 3 Previous Next