6 Replies Latest reply on Mar 17, 2012 7:36 PM by rcernich

    SwitchYard Console Refactoring

    rcernich

      Hey all,

       

      I've recently been working on integrating the SwitchYard console into the AS7 console.  As part of that effort, I have significantly restructured the console project.  Before issuing pull requests, I thought it best to put the changes up for a wider review.  If you're interested, please respond with any questions, comments, criticism.

       

      Some background... Prior to these changes, the SY console was built as a standalone console, which reused some infrastructure from the AS7 console.  In order to make things work, the project was a bit messy (including selected source from the AS7 project, sprinkle in a little bridge code, rewrite some other code...).  With the recent upgrade to AS 7.1.0CR1b, the SY console was broken and because of the way we were reusing the AS7 source, it looked like it was going to require some effort to fix it.  As we've been wanting to move the SY console into the AS7 console, it seemed like the right time to try integrating the two consoles.

       

      The first challenge was figuring out how to make the AS console extensible.  Once that was done, the SY console needed to be converted to be an extension (plug-in) to the AS console.  Then the release needed to be updated to use the new consolidated console.  Below is a brief summary of the changes.

      • Updated the maven groupId to org.switchyard.console. (housekeeping)
      • All AS console specific code was moved from the SY console project (console/gwt) and moved into its own project (console/as7-core).  As the extension mechansim has not yet been incorporated into the AS console project, this project serves to package the AS console as a jar/gwt module that can be used by downstream projects.  It also incorporates the few changes needed to make it extensible (two modified files and a few new files).  This project is named switchyard-console-as7-core
      • The SY console is now packaged as a jar/gwt module and only includes code specific to the SY console pages.  It still lives in console/gwt, but the project name has changed to switchyard-console-extension
      • A new project was created to package the two sets of console functionality into a single war.  This project lives in console/app and is named switchyard-console-application.  (I haven't mentioned any of the details behind the design of the extension mechanism, but, if you're interested, here's a link that describes the approach, along with some example code: https://github.com/rcernich/fools-errands/tree/master/modular-mvp)
      • The release has been modified to:
        • use switchyard-console-application.war (was switchyard-console-gwt.war)
        • place the war in module/org/jboss/as/console/main
        • update the module.xml file to use the cosolidated console

       

      All of these changes can be found here:

       

      Any questions, comments, concerns appreciated.

       

      Best,

      Rob

        • 1. Re: SwitchYard Console Refactoring
          rcernich

          Some screenshots.

           

           

          console_details.jpg

           

          console_applications.jpg

           

          console_services.jpg

          • 2. Re: SwitchYard Console Refactoring
            kcbabo

            Yeah, this is pretty much awesome.

            • 3. Re: SwitchYard Console Refactoring
              mageshbk

              Hi Rob,

               

              When I build the console project under Windows, I get a bloated war that is around 46 MB. Looks like it includes *.gz files too. Could you tell me the magic of the recently released war having only 10 MB? Don't tell me the obvious, to use nix system.

              • 4. Re: SwitchYard Console Refactoring
                rcernich

                Hey Magesh,

                 

                As far as I know, there is no secret.  I build simply using "mvn clean install." Nothing fancy there.

                 

                That said, the war plugin is configured to exclude everything in the WEB-INF directory, so maybe that's where the funkiness is coming frome.  Wild, unsubstantiated guess.

                 

                Sorry I couldn't be of more help.

                 

                Best,

                Rob

                • 5. Re: SwitchYard Console Refactoring
                  mageshbk

                  Okay, my short story. I was upgrading AS7 version to 7.1.1.Final. I notice there are two compilations errors and fixed them. But building console with this version of AS 7 and

                  <version.jbossas.console>1.1.0.FINAL</version.jbossas.console>
                  

                  gives me that bloated war, although that war works fine.

                   

                  It is the same case in Fedora too. Could you please have a look?

                  • 6. Re: SwitchYard Console Refactoring
                    rcernich

                    Hey Magesh,

                     

                    The core console is weighing in at almost 44MB.  Those gz files are compressed versions of the JS (notice they have the same name as the html files).  I don't know why it's so big all of a sudden.  I suspect it may have to do with localization.  (GWT compiles JS for each locale, so if we went from one to four or two to eight, that's roughly a four fold increase in size.)

                     

                    I guess, I'd say there's no problem here.  That's just the way it is.  We may need to decide whether we still want to include the console in the SwitchYard bundle.  (It won't make a difference for the distribution, since we provide the SY console and leave out the default AS console, so no real difference in size.)

                     

                    Best,

                    Rob