// Add servant to ASM and parent's _contents map. public void activate(Ice.ObjectAdapter a) { var thisNode = NodePrxHelper.uncheckedCast(a.add(this, _id)); if (_parent != null) { _parent.addChild(thisNode); } }
// Slice find() operation. public override NodeDesc find(string name, Current c) { lock (this) { if (_destroyed) { throw new ObjectNotExistException(); } NodeI p = (NodeI)_contents[name]; if (p == null) { throw new NoSuchName(name); } NodeDesc d = new NodeDesc(); d.name = name; d.type = p is FileI ? NodeType.FileType : NodeType.DirType; d.proxy = NodePrxHelper.uncheckedCast(c.adapter.createProxy(p.id())); return(d); } }
// Slice list() operation. public override NodeDesc[] list(Current c) { lock (this) { if (_destroyed) { throw new ObjectNotExistException(); } var ret = new NodeDesc[_contents.Count]; int i = 0; foreach (var e in _contents) { var p = e.Value; ret[i] = new NodeDesc(); ret[i].name = e.Key; ret[i].type = p is FileI ? NodeType.FileType : NodeType.DirType; ret[i].proxy = NodePrxHelper.uncheckedCast(c.adapter.createProxy(p.id())); ++i; } return(ret); } }
// Add servant to ASM and parent's _contents map. public void activate(Ice.ObjectAdapter a) { NodePrx thisNode = NodePrxHelper.uncheckedCast(a.add(this, _id)); _parent.addChild(thisNode); }