lazyj.notifications
Class Notifier
java.lang.Object
lazyj.notifications.Notifier
- All Implemented Interfaces:
- java.util.Observer
public final class Notifier
- extends java.lang.Object
- implements java.util.Observer
Notification hub. The actual senders are defined in a ExtProperties object. The structure must be:
senders=N
for (I in 1..N)
sender_I.class=classname
sender_I.key1=value1
...
The class must be an instance of Sender. See subclasses of Sender for details
on what keys and values are expected for each.
If you want the code to react to file changes please make sure ExtProperties.setAutoReload(long) is called
for the instance you give here.
- Since:
- Nov 16, 2007 (1.0.3)
- Author:
- costing
|
Constructor Summary |
Notifier(ExtProperties prop)
|
Notifier(ExtProperties prop,
java.lang.ClassLoader loader)
If you want to load arbitrary classes from one of the senders you should use this method, giving as argument
this.getClass().getClassLoader(). |
|
Method Summary |
boolean |
send(Message m)
Send a message though all the defined channels |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Notifier
public Notifier(ExtProperties prop)
- Parameters:
prop -
Notifier
public Notifier(ExtProperties prop,
java.lang.ClassLoader loader)
- If you want to load arbitrary classes from one of the senders you should use this method, giving as argument
this.getClass().getClassLoader(). You should also use this constructor if you want to
load custom Sender classes that reside inside a webapp zone (or anywhere else where it is not
accessible through the default class loader).
- Parameters:
prop - loader -
send
public boolean send(Message m)
- Send a message though all the defined channels
- Parameters:
m -
- Returns:
- true if the sending was successful with all the defined senders
update
public void update(java.util.Observable o,
java.lang.Object arg)
- Specified by:
update in interface java.util.Observer