01: /*
02: * Helma License Notice
03: *
04: * The contents of this file are subject to the Helma License
05: * Version 2.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://adele.helma.org/download/helma/license.txt
08: *
09: * Copyright 1998-2003 Helma Software. All Rights Reserved.
10: *
11: * $RCSfile$
12: * $Author: root $
13: * $Revision: 8604 $
14: * $Date: 2007-09-28 15:16:38 +0200 (Fre, 28 Sep 2007) $
15: */
16:
17: package helma.extensions;
18:
19: import helma.framework.core.Application;
20: import helma.main.Server;
21: import helma.scripting.ScriptingEngine;
22: import java.util.HashMap;
23:
24: /**
25: * Helma extensions have to subclass this. The extensions to be loaded are
26: * defined in <code>server.properties</code> by setting <code>extensions =
27: * packagename.classname, packagename.classname</code>.
28: */
29: public abstract class HelmaExtension {
30: /**
31: * called by the Server at startup time. should check wheter the needed classes
32: * are present and throw a ConfigurationException if not.
33: */
34: public abstract void init(Server server)
35: throws ConfigurationException;
36:
37: /**
38: * called when an Application is started. This should be <b>synchronized</b> when
39: * any self-initialization is performed.
40: */
41: public abstract void applicationStarted(Application app)
42: throws ConfigurationException;
43:
44: /**
45: * called when an Application is stopped.
46: * This should be <b>synchronized</b> when any self-destruction is performed.
47: */
48: public abstract void applicationStopped(Application app);
49:
50: /**
51: * called when an Application's properties are have been updated.
52: * note that this will be called at startup once *before* applicationStarted().
53: */
54: public abstract void applicationUpdated(Application app);
55:
56: /**
57: * called by the ScriptingEngine when it is initizalized. Throws a ConfigurationException
58: * when this type of ScriptingEngine is not supported. New methods and prototypes can be
59: * added to the scripting environment. New global vars should be returned in a HashMap
60: * with pairs of varname and ESObjects. This method should be <b>synchronized</b>, if it
61: * performs any other self-initialization outside the scripting environment.
62: */
63: public abstract HashMap initScripting(Application app,
64: ScriptingEngine engine) throws ConfigurationException;
65:
66: /**
67: *
68: *
69: * @return ...
70: */
71: public abstract String getName();
72: }
|