Update of /var/cvs/src/org/mmbase/bridge/implementation
In directory james.mmbase.org:/tmp/cvs-serv10042
Modified Files:
BasicCloud.java
Log Message:
using 'getAccount', avoid NPE on line 306, which I saw happening
See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/bridge/implementation
Index: BasicCloud.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/bridge/implementation/BasicCloud.java,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -b -r1.184 -r1.185
--- BasicCloud.java 13 Jun 2008 09:58:26 -0000 1.184
+++ BasicCloud.java 4 Jul 2008 10:11:50 -0000 1.185
@@ -29,7 +29,7 @@
* @author Rob Vermeulen
* @author Pierre van Rooden
* @author Michiel Meeuwissen
- * @version $Id: BasicCloud.java,v 1.184 2008/06/13 09:58:26 nklasens Exp $
+ * @version $Id: BasicCloud.java,v 1.185 2008/07/04 10:11:50 michiel Exp $
*/
public class BasicCloud implements Cloud, Cloneable, Comparable<Cloud>,
SizeMeasurable, Serializable {
@@ -209,9 +209,9 @@
public Node getNode(String nodeNumber) throws NotFoundException {
MMObjectNode node;
try {
- node = BasicCloudContext.tmpObjectManager.getNode(account,
nodeNumber);
+ node = BasicCloudContext.tmpObjectManager.getNode(getAccount(),
nodeNumber);
} catch (RuntimeException e) {
- throw new NotFoundException("Something went wrong while getting
node with number '" + nodeNumber + "': " + e.getMessage() + " by cloud with
account " + account, e);
+ throw new NotFoundException("Something went wrong while getting
node with number '" + nodeNumber + "': " + e.getMessage() + " by cloud with
account " + getAccount(), e);
}
if (node == null) {
throw new NotFoundException("Node with number '" + nodeNumber + "'
does not exist.");
@@ -249,7 +249,7 @@
private boolean hasNode(String nodeNumber, boolean isrelation) {
MMObjectNode node;
try {
- node = BasicCloudContext.tmpObjectManager.getNode(account,
nodeNumber);
+ node = BasicCloudContext.tmpObjectManager.getNode(getAccount(),
nodeNumber);
} catch (Throwable e) {
return false; // error - node inaccessible or does not exist
}
@@ -303,7 +303,10 @@
}
BasicNodeManager getBasicNodeManager(String nodeManagerName) throws
NotFoundException {
- MMObjectBuilder bul =
BasicCloudContext.mmb.getMMObject(nodeManagerName);
+ if (BasicCloudContext.mmb == null || (!
BasicCloudContext.mmb.getState())) {
+ throw new NotFoundException("MMBase not yet, or not successfully
initialized (check mmbase log)");
+ }
+ MMObjectBuilder bul =
BasicCloudContext.mmb.getBuilder(nodeManagerName);
// always look if builder exists, since otherwise
if (bul == null) {
throw new NotFoundException("Node manager with name '" +
nodeManagerName + "' does not exist.");
@@ -844,7 +847,7 @@
public boolean mayRead(String nodeNumber) {
MMObjectNode node;
try {
- node = BasicCloudContext.tmpObjectManager.getNode(account,
nodeNumber);
+ node = BasicCloudContext.tmpObjectManager.getNode(getAccount(),
nodeNumber);
} catch (RuntimeException e) {
throw new NotFoundException("Something went wrong while getting
node with number '" + nodeNumber + "': " + e.getMessage(), e);
}
@@ -1113,4 +1116,8 @@
UserContext uc = getUser();
return n + " '" + getName() + "' of " + (uc != null ?
uc.getIdentifier() : "NO USER YET") + " @" + Integer.toHexString(hashCode());
}
+
+ public Cloud getNonTransactionalCloud() {
+ return this;
+ }
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs