Author: michiel Date: 2010-05-18 16:41:01 +0200 (Tue, 18 May 2010) New Revision: 42216
Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/bridge/mock/MockCloudContext.java mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SystemEvent.java mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/MMBase.java Log: Added SystemEvent.BuildersReader Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/bridge/mock/MockCloudContext.java =================================================================== --- mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/bridge/mock/MockCloudContext.java 2010-05-18 14:32:10 UTC (rev 42215) +++ mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/bridge/mock/MockCloudContext.java 2010-05-18 14:41:01 UTC (rev 42216) @@ -18,6 +18,7 @@ import org.mmbase.bridge.implementation.*; import org.mmbase.storage.search.*; import org.mmbase.security.*; +import org.mmbase.core.event.*; import org.mmbase.util.*; import org.mmbase.util.logging.*; import org.xml.sax.InputSource; @@ -108,6 +109,7 @@ LOG.service("Builder with name '" + buil + "' already exists"); } } + EventManager.getInstance().propagateEvent(new SystemEvent.BuildersRead(this)); } protected int getTypeDefNode(String name) { @@ -123,6 +125,7 @@ } nodeManagers.put(name, new NodeManagerDescription(name, m, getTypeDefNode(name))); + EventManager.getInstance().propagateEvent(new SystemEvent.BuildersRead(this)); } public void addNodeManager(InputSource source) { @@ -130,6 +133,7 @@ MockBuilderReader reader = new MockBuilderReader(source, this); addNodeManager(reader); } + EventManager.getInstance().propagateEvent(new SystemEvent.BuildersRead(this)); } protected void addNodeManager(MockBuilderReader reader) { @@ -153,6 +157,7 @@ } } } + EventManager.getInstance().propagateEvent(new SystemEvent.BuildersRead(this)); } public synchronized int addNode(String type, Map<String, Object> map) { Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SystemEvent.java =================================================================== --- mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SystemEvent.java 2010-05-18 14:32:10 UTC (rev 42215) +++ mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/core/event/SystemEvent.java 2010-05-18 14:41:01 UTC (rev 42216) @@ -38,6 +38,32 @@ } + /** + * An BuilderReader system event is and should be issued after one or more builders are added to the system. + */ + public static class BuildersRead extends Collectable { + private final String uri; + private final String name; + public BuildersRead() { + this(org.mmbase.bridge.ContextProvider.getDefaultCloudContext()); + } + public BuildersRead(org.mmbase.bridge.CloudContext cc){ + this(cc.getUri(), cc.getCloudNames().get(0)); + } + public BuildersRead(String u, String n) { + uri = u; + name = n; + } + public String getUri() { + return uri; + } + public String getName() { + return name; + } + + } + + public static class ServletContext extends Collectable { private final javax.servlet.ServletContext servletContext; public ServletContext(javax.servlet.ServletContext sc) { Modified: mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/MMBase.java =================================================================== --- mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/MMBase.java 2010-05-18 14:32:10 UTC (rev 42215) +++ mmbase/branches/MMBase-1_9/core/src/main/java/org/mmbase/module/core/MMBase.java 2010-05-18 14:41:01 UTC (rev 42216) @@ -840,6 +840,7 @@ String resourceDirectory = ResourceLoader.getDirectory(builderXml) + "/"; loadBuilderFromXML(resourceName, resourceDirectory); } + EventManager.getInstance().propagateEvent(new SystemEvent.BuildersRead(org.mmbase.bridge.LocalContext.getCloudContext())); log.debug("Starting Cluster Builder"); clusterBuilder = new ClusterBuilder(this); _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs