Note Invoking this notifier in case of error is left for you to accomplish. As you can consider error handling a
crosscutting concern, AOP would be an ideal solution to this problem. You can write an after throwing advice to
invoke this notifier.
Next, you can implement this interface to send a notification in a way of your choice. The most
common way is to send e-mail. Before you implement the interface in this way, you may need a local
e-mail server that supports the Simple Mail Transfer Protocol (SMTP) for testing purposes. We
recommend installing Apache James Server ( http://james.apache.org/server/index.html ), which is
very easy to install and configure.
Note You can download Apache James Server (e.g., version 2.3.2) from the Apache James web site and
extract it to a directory of your choice to complete the installation. To start it, just execute the run script (located in
the bin directory).
Let's create two user accounts for sending and receiving e-mail with this server. By default, the
remote manager service of James listens on port 4555. You can telnet, using a console, to this port and
run the following commands (displayed in bold) to add the users system and admin , whose passwords
are 12345 :
JAMES Remote Administration Tool 2.3.1
Please enter your login and password
Welcome root. HELP for a list of commands
adduser system 12345
User system added
adduser admin 12345
User admin added
Existing accounts 2