IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Loading properties file in static object

  • 1.  Loading properties file in static object

    Posted Sun March 07, 2004 05:24 PM

    hey guys,

    im trying to load a properties file in the memory by loading it in a object. So i created a static object (singleton called Trans) with two methods :

    1. Trans.init : loads the file in a Properties object
    2. Trans.getInstance : gets a reference to the object.

    Problem is that i would like to read the file in in one package (init method) and get a reference in another package(getInstance) so i can access to the file loaded in the static object…

    But that doesn’t seem to work… Does anybody know why not?

    Is there another way to easily load a file into memory, so that is accessible in all packages??

    Greetz,

    Wout


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Loading properties file in static object

    Posted Sun March 07, 2004 07:08 PM

    Don’t call your getInstance method directly. Instead, create a service in the package that contains your singleton object which returns the data you want. You might as well have that service convert the data to a IS document format, although I suppose you could return the Java object directly. Your other package can then call this service to get the data you need.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services