File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

design question

 
Harm de Laat
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic