final JS js;
private Message m = null;
+ private String filePath = null;
public Script(String filePath) throws JSExn, IOException {
+ this.filePath = filePath;
js = JS.cloneWithNewParentScope(JS.fromReader(filePath, 0, new InputStreamReader(new FileInputStream(filePath))),
new ScriptScope()); }
}
}
- public synchronized void accept(Message m) throws IOException, MailException {
+ public void accept(Message m) throws IOException, MailException {
+ try {
+ new Script(filePath).reallyAccept(m);
+ } catch (JSExn e) {
+ Log.error(this, e);
+ throw new MailException(e.toString());
+ }
+ }
+
+ private synchronized void reallyAccept(Message m) throws IOException, MailException, JSExn {
this.m = m;
try {
Log.info(this, "invoking config...");