What is the best way to load a property file into memory so that it is available to all packages across the IS? I have tried a few different ways with no success.
Used psUtilities/hashtable, don’t like the way that works… could be simpler IMHO
Used psUtilities/memory, get exceptions with this one; suspect that there is a problem with class casting;
Could use system properties, but that is not preferred and a last resort.
Consider usage such as log4j, would like behavior like that.
Fairly new to webMethods, any hints, suggestions, or examples would be appreciated.
Define a get Java service to retrieve a specific property.
On the Shared tab, declare and define a static Properties object. Use a static initializer to load a file into that object.
In the get service, retrieve the value of the property from the Properties object. Any service from any thread can call this service.
If you need to refresh the object, do not assign null to the Properties object and create a new one. Instead, call clear and then reload. That will be thread safe.
To me, using custom items in extended settings is like using system properties and not preferred.
I do have something useful cooked - after much discussion with teammates regarding using hash and IData objects I decided on the simpler approach using properties. Willing to share, it is appropriate to post code? (still new!