6 Replies Latest reply on Mar 5, 2011 3:19 AM by Tom Fennelly

    Loading custom class

    Madhu CM Newbie


      Is there any possibilites i can load my custom class during ESB start-up? .

      I have written a java class which has all the constants defined in it and i want to load this file during ESB start-up.

      Or any cache i can put it .




      Madhu CM

        • 1. Loading custom class
          Tom Cunningham Master

          I'm a little unsure what you're doing here, but you can definitely load a cache before your ESB archive starts up.

          • 2. Loading custom class
            Madhu CM Newbie

            Hi tom,

            My requirnment is to use/load some commonly used java constants which will be used by other ESB projects.

            So i thought of including some commonly used java classes inside the cache. And i am not aware how to do it using JBOSS ESB.

            If you can provide me some example on this that will really help me.



            Madhu CM

            • 3. Loading custom class
              Michael Martinsen Newbie

              Hi Madhu


              JBoss also has a properties service where you can set system properties and make them available to both ESB deployments (jboss-esb.xml) and off course in your code. But, it depends a bit on what you want to do. The properties service is an option if you want more platform like options across your ESB projects...



              • 4. Loading custom class
                Tom Fennelly Master

                Are you talking about commonly used Java code constants, or configuration constants/parameters?


                If you're just talking about common utility code that you do not want to have to bundle in all your ESB apps, then you could probably bundle that code and drop it into the AS lib dir.  If you are talking about shared application/config data that you want visible to all apps before startup, then I think this really depends on your requirements... how is this data stored/read etc?

                • 5. Loading custom class
                  Madhu CM Newbie

                  Thanks Tom,


                  I am talking about commonly used Java code constants so that i can uses these constants in my ESB projects, constants = name-value pair..

                  I dont want to include these constants as a part of ESB project. This Java Code utility or any property files must be loaded before any other ESB project loads.

                  How can i achieve this.



                  Madhu CM

                  • 6. Loading custom class
                    Tom Fennelly Master

                    So it's just common java utility code then it seems i.e. compiled and bundled/jar'd java classes.  The fact that it's code defining constants etc is irrelevant.


                    You should be able to just drop the jar in e.g. the server/default/lib folder.