• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

design question

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 for any suggestions!
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know if this is the correct answer, but once I did something like this:
in my jboss.xml I added this:

I had a class that was in charge only of sending emails. So whenever i needed to send an email (or many emails) I'd invoke this class, and my code did something like this:

there was another configuration file in which you added your SMTP sever, so you wouldn't need to hardcode it, but I cant remember which was
I don't know if this is the correct way, it's only a suggestion
 
reply
    Bookmark Topic Watch Topic
  • New Topic