CALL FOR: Email changes: drop email classes and Interface from the core
Called by: Daniel Ockeloen Total tally on this call : -1 (VETOED)
YEA (4) : Pierre van Rooden, Rob van Maris, Michiel Meeuwissen, Nico Klasens
ABSTAIN (0) :
NAY (0) :
VETO (1) : Kees Jongenburger
No votes, assumed abstained (10): Eduard Witteveen, Jaco de Groot, Marcel Maatkamp, David van Zeventer,
Johannes Verelst, Daniel Ockeloen, Rob Vermeulen, Kees Jongenburger, Rico Jansen,
Vincent van der Locht, Gerard van Enk, Mark Huijser
CALL FOR: Allowing startup of MMBase by a cloud call
Called by: Eduard Witteveen Total tally on this call : +10
YEA (10) : Marcel Maatkamp, Kees Jongenburger, Pierre van Rooden, Rico Jansen, Gerard van Enk, Michiel Meeuwissen, Jaco de Groot, Rob Vermeulen, Daniel Ockeloen, Rob van Maris
ABSTAIN (0) :
NAY (0) :
VETO (0) :
No votes, assumed abstained (3): Johannes Verelst, Nico Klasens, Mark Huijser
Result:
The hack is accepted.
Note:
- The hack will be added after the 1.7.0 release, and be available in 1.8 and 1.7.1 and onwards
- No code samples were included in this hack, therefor the code itself has not yet been approved. Code must follow the MMBase code conventions, limit itself to this hack, and may be subject to changes by the MMC and core developers if problems arise due to its inclusion.
Eduard Witteveen wrote:
CALL BY: Eduard Witteveen CALL FOR: Allowing startup of MMBase by a cloud call
INTRODUCTION
============
When MMBase has not been started, and the following lines are executed:
CloudContext cx = LocalContext.getCloudContext();
Cloud cl = cx.getCloud("mmbase");
The last line will throw an exception with the the following error: "MMBase has not been started, and cannot be started by this Class." In the new situation this will not cause an exception IF the config directory is set by using the system properties.
This propery was earlier called the make.flax.happy, but since specifying an 'mmbase.config' propery implies that you are running mmbase outside the servlet environment(http://www.mmbase.org/development/mailarchive/msg97481.html).
ADVANTAGES
==========
When this modication has been made it has the following advantages:
- MMBase can be run from the commandline, by using a small console application. This way automated tests can be done to test the database layer(s)
- Debugging the "core" can be done without the need of a servlet enviourment
- Much easier for me to write new database implementations ;-)
SAMPLE
======
After the change, the following code can be used to start MMBase:
<code>
import org.mmbase.bridge.*;
public class ConsoleStart { public ConsoleStart() {} public static void main(String[] args) throws Exception {
// load the hsqldb driver
java.sql.DriverManager.registerDriver(new org.hsqldb.jdbcDriver()); // set the config dir with the property
String configPath = java.lang.System.getProperty("user.dir") + java.io.File.separatorChar + "config";
java.lang.System.setProperty("mmbase.config", configPath); // try to get the cloud
CloudContext cx = LocalContext.getCloudContext();
Cloud cl = cx.getCloud("mmbase");
} }
</code>
CHANGES
=======
The changes will not break any backwards compatability. The following changes are needed in BasicCloudContext.java:
<changes>
Index: implementation/BasicCloudContext.java
===================================================================
RCS file: /usr/local/cvs/src/org/mmbase/bridge/implementation/BasicCloudContext.java,v
retrieving revision 1.32
diff -r1.32 BasicCloudContext.java
55a56
> /*
80a82,133
> */ > Iterator i=org.mmbase.module.Module.getModules();
> // check if MMBase is already runnign > if (i == null) {
> // build the error message, since it has very less overhead (only entered once incase of startup)
> String message = "MMBase has not been started, and cannot be started by this Class. (" + getClass().getName() + " : no propery mmbase.config found)"; > > // MMBase may only be started from the bridge when the property mmbase.config was provided
> if (java.lang.System.getProperty("mmbase.config") == null) {
> // when mmbase.config is empty fill it with current working dir + /config
> // this way there is no need to provide the info on the commandline > // java.lang.System.setProperty("mmbase.config", java.lang.System.getProperty("user.dir") + java.io.File.separatorChar + "config");
> log.error(message);
> throw new BridgeException(message); > } > > // when MMBase is not running, try to start it!
> try {
> // init the MMBaseContext,... > org.mmbase.module.core.MMBaseContext.init();
> > // try to start MMBase now,...
> org.mmbase.module.core.MMBase.getMMBase();
> > // now re-assign the values agina
> i = org.mmbase.module.Module.getModules();
> }
> catch(java.lang.Exception ex) {
> log.error("Error while trying to start MMBase from the bridge:" + Logging.stackTrace(ex));
> }
> > // if still null,.. give error!
> if(i == null) {
> log.error(message);
> throw new BridgeException(message);
> } > } > // get the core module!
> mmb = org.mmbase.module.core.MMBase.getMMBase();
> > // create transaction manager and temporary node manager
> tmpObjectManager = new TemporaryNodeManager(mmb);
> transactionManager = new TransactionManager(mmb,tmpObjectManager);
> > // create module list
> while(i.hasNext()) {
> Module mod = ModuleHandler.getModule((org.mmbase.module.Module)i.next(),this);
> localModules.put(mod.getName(),mod);
> }
> > // set all the names of all accessable clouds..
> localClouds.add("mmbase"); </changes>
START OF CALL: 20/02/2004 17:15 END OF CALL: 25/02/2004 17:15?
-- Pierre van Rooden Mediapark, C 107 tel. +31 (0)35 6772815 "Never summon anything bigger than your head."
