http://opensymphony.com/propertyset/
Hope it helps,
Tim ---------
To make the coding a little easier we just added in one extra class file "SettingsProxy" which allowed settings retrieval like this:
SettingsProxy.getString(SettingsProxy.EMAIL_SUBJECT);
Those functions then called code like the below:
private static final String PROPERTY_SET_MANAGER = "ejb";
public static final String EMAIL_SUBJECT = "EMAIL_SUBJECT"; // Safer to have this here to ensure setting is valid.
public static String getString(String name) { return getPropertySet(name).getString(name); }
private static PropertySet getPropertySet(String name) throws FatalCharaException
{
PropertySet ps;
HashMap args = new HashMap();
args.put("entityName", name); ps = PropertySetManager.getInstance(PROPERTY_SET_MANAGER, args);
// Check if the property exists or not
if (!ps.exists(name))
{
String errMessage = "getPropertySet() - Property [" + name + "] does not exist!";
TRACE.warn(errMessage);
throw new FatalCharaException(errMessage); // Is this correct? Do we want to do this?
}
return ps;
}
Hi all,
I have a J2EE application running in JBoss.
In my application I need some configuration. For instance, we have to email certain recepients when a action occurs. (For instance, when a certain entity bean is removed we have to send an email to a person). In this email we need to have a configurable messagebody, subject, recipients, reply-address etc... etc...
I cannot use the bean environment entries because these only get read at deploy time. I need to be able to change the configuration during run-time.
What would be a good way to make this as configurable as possible?
Thanks,
Harm de Laat Informatiefabriek
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user