13 Replies Latest reply on Jun 20, 2003 11:08 AM by Viet

    Quotes Module Upload

    timothyb Newbie

      Hi Cooper,

      I have attached the quotes module to this post.

      Tim

        • 1. Re: Quotes Module Upload
          Viet Master

          thank you. no time to integrate it right now. I wil look forward toing that in the week later.

          but don't be afraid, I always check in people stuff :-)

          julien

          • 2. Re: Quotes Module Upload
            timothyb Newbie

            OK...no rush.

            BTW...is there anyone working on the polls module? Let me know if there is, otherwise I will take a stab at it.

            tim

            • 3. Re: Quotes Module Upload
              Viet Master

              go for it.

              now it is possible to create blocks dynamcly. just look at org.jboss.nukes.system.JDBCDeploymentScannerMBean

              it can creates and deploy a block there is an exampleof that in the org.jboss.nukes.system.JDBCDeploymentScannerMBean$TestModule. it creates a dynamicly a block.

              julien

              • 4. Re: Quotes Module Upload
                Roger Ackroyd Newbie

                Tim. I would be interested in looking at the Quotes module. As I am a fairly new to all of this, you might sent me a few supporting instructs. on how to correctly build/deploy it. (I will try it by myself meantime)
                For me, also a good excersise now would be to follow the process of constructing module/blocks etc, i.e. Polls module. May be able to help with some testing perhaps?.
                I might then become more of a contributor on the forum as opposed to the 'sender of long posts'.
                Rgds
                Roger

                • 5. Re: Quotes Module Upload
                  timothyb Newbie

                  Roger,

                  Its fairly simple to get the quotes module working, assuming you can already build nukes itself from source and get it running.

                  1. After you unpack the file, cd to nukes/quotes/src/resources/hsqldb and use setup.ddl to create the nuke_quotes table. I basically followed the insturctions posted here http://www.jboss.org/index.html?module=html&op=userdisplay&id=developers/projects/nukes/hsqldb

                  2. To build the quotes module you need to set the environment variable JBOSS_HOME to the root of your JBoss directory. I mostly tested on 3.2.1. Then just type ./build.sh from the nukes/quotes dir or build.bat on win32.

                  3. Once it builds copy nukes/quotes/output/lib/nukes-quotes.ear to your jboss deploy folder (e.g. JBOSS_HOME/server/default/deploy).

                  After that JBoss will deploy the module, you will see the item "Quotes" in your menu and the Quotes block will be on the right side. To construct the quotes module I basically copied the structure of adminmessages and worked from there.

                  I will post the polls module when I start making some progress, and would be glad to have your help testing.

                  tim

                  • 6. Re: Quotes Module Upload
                    Viet Master

                    I will integrate it today I think.

                    julien

                    • 7. code commited
                      Viet Master

                      I have just finished to integrate your work, good job.

                      julien

                      • 8. Re: code commited
                        Tim Newbie

                        cool, I'm making slow progress on the polls module, because of time constraints, but I'm finding it much more interesting that the quotes code.

                        tim

                        • 9. Re: code commited
                          Viet Master

                          you're doing poll ? great

                          • 10. Re: code commited
                            Tim Newbie

                            I used another user id by accident, but yes I'm working on polls. Right now I'm learning about the dynamic deployment part of nukes.

                            tim

                            • 11. Re: code commited
                              Viet Master

                              ok, it does not work perfectly but all should be there. if you need changes, do them.

                              btw, I changed quotes in some ways to handle better performances. could you have a look at the commited version please ?

                              thank you

                              julien

                              • 12. Re: code commited
                                Tim Newbie

                                julien,

                                I had a look at your changes to the quotes moudule, and they all look really good. I couldn't figure out how to get the jboss query order by clause to work, so I used a comparator. Anyway, now I see my mistake. The getRandomQuote function is also nice, maybe if I keep writing open source I will learn to write simple code.

                                thanks...tim

                                • 13. Re: code commited
                                  Viet Master

                                  the most important is to cache the data pulled by the block. Now every quotes is precalculated and put in the cache, so now the block simply pull a string for the module and no EJB is used to do that.

                                  also I added read only methods on EJB on the getters, these are *really* important since they remove the locking done by the container.

                                  everyone must understand that when you are using an EJB directly you generate locking on that EJB.

                                  specially when you only read it, you generate unnecessary locking. so it's important to tag read only method with the jboss special tag (look at userEJB) to remove the locking.

                                  too much locking lead to application failures.

                                  julien