On Mon, 2002-07-22 at 13:34, Michiel de Mare wrote:
> I need to get a reference to the MMBase object in order to register a
> listener for the caching stuff, but I can't seem to find the right method. I
> cannot find a single "new MMBase" in the entire source, and the getMMBase
> method below doesn't exist yet (or not anymore :) ) in the 1.5.1 release
> (and I like to stick to release versions).
>
> Can I create a new MMBase object, or is there supposed to be only one MMBase
> object in the JVM at the time?
> > <% org.mmbase.module.core.MMBase.getMMBase(); %>
<% org.mmbase.module.Module.getModule("mmbase"); %> should also do the
trick.
If you happen to compile your own source code, you can also put the
following code inside the
org/mmbase/bridge/implementation/BasicCloudContext.java file (replacing
the old code) :
protected BasicCloudContext() {
mmb =
(org.mmbase.module.core.MMBase)org.mmbase.module.getModule("mmbase");
// create transaction manager and temporary node manager
tmpObjectManager = new TemporaryNodeManager(mmb);
transactionManager = new
TransactionManager(mmb,tmpObjectManager);
Iterator i=org.mmbase.module.Module.getModules();
// 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");
}
When done this way, a call to the core is no longer needed.....
--
Eduard Witteveen Systeem Ontwikkelaar
NOS Internet, Gateway C Kamer 107
+31(0)356772910 http://www.omroep.nl/
Sed quis custodiet ipsos custodes? : The sixth Satire from Juvenal