示例#1
0
 /**
  * The overloaded method for now is used to allow RpcManager to be replaced
  * by MockRpcManager in unit tests.
  */
 public void Update(Node node, RpcManager rpc) {
   _rpc = rpc;
   _node = node;
   _xrm = new XmlRpcManager(_node, _rpc);
   _rpc.AddHandler("xmlrpc", _xrm);
   RemotingServices.Marshal(_xrm, "xm.rem");
 }
示例#2
0
 public new static MockRpcManager GetInstance(Node node) {
   if(_instance == null) {
     ReqrepManager rrm = ReqrepManager.GetInstance(node);
     _instance = new MockRpcManager(rrm);
   }
   return _instance;
 }
示例#3
0
 public XmlRpcManager(Node node, RpcManager rpc) {
   _node = node;
   _rpc = rpc;
 }
示例#4
0
 public void Update(Node node)
 {
   RpcManager rpc = RpcManager.GetInstance(node);
   Update(node, rpc);
 }
示例#5
0
 public new static MockRpcManager GetInstance(Node node) {
   if(_instance == null) {
     _instance = new MockRpcManager(node.Rrm);
   }
   return _instance;
 }
示例#6
0
 /**
  * @param url the URL of the XML-RPC service.
  * @param rpc The XmlRpcManager instance that the handler uses.
  */
 public XmlRpcHandler(string url, Node node) {
   this.Url = url;
   _node = node;
   _rpc = _node.Rpc;
 }
示例#7
0
 /// <summary>
 /// Allows nodes to be registered by whatever URI the user provides
 /// </summary>
 /// <param name="node"></param>
 /// <param name="uri"></param>
 public void Add(Node node, string uri) {
   var xrm = new XmlRpcManager(node, node.Rpc, uri);
   lock (_sync_root) {
     // throw an exception if this mapping exists...
     _xrm_mappings.Add(node, xrm);
     RemotingServices.Marshal(xrm, uri);
     CheckAndSetDefaultManager();
   }
   // We only add this if there is no exception above...
   node.Rpc.AddHandler("xmlrpc", xrm);
 }
示例#8
0
 /// <summary>
 /// The overloaded method for now is used to allow RpcManager to be replaced
 /// by MockRpcManager in unit tests.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="rpc"></param>
 /// <param name="uri"></param>
 internal void Add(Node node, RpcManager rpc, string uri) {
   var xrm = new XmlRpcManager(node, rpc);
   lock (_sync_root) {
     // throw an exception if this mapping exists...
     _xrm_mappings.Add(node, xrm);
     RemotingServices.Marshal(xrm, uri);
     CheckAndSetDefaultManager();
   }
   rpc.AddHandler("xmlrpc", xrm);
 }
示例#9
0
 /// <summary>
 /// Adds the specified node to listen to XMLRPC proxy calls.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <remarks>Uses a node's string version of Brunet address plus ".rem" as the 
 /// relative Uri.</remarks>
 public virtual void Add(Node node) {
   Add(node, string.Format("{0}.rem", node.Address.ToString()));
 }
示例#10
0
 /// <summary>
 /// Stops the specified node from listening to XMLRPC proxy calls.
 /// </summary>
 /// <param name="node">The node.</param>
 public void Remove(Node node) {
   lock (_sync_root) {
     RemotingServices.Disconnect(_xrm_mappings[node]);
     node.Rpc.RemoveHandler("xmlrpc");
     _xrm_mappings.Remove(node);
     CheckAndSetDefaultManager();
   }
 }
示例#11
0
 public XmlRpcManager(Node node, RpcManager rpc, string uri) {
   Uri = uri;
   _node = node;
   _rpc = rpc;
 }
示例#12
0
 /**
  * The overloaded method for now is used to allow distinct Uri for multiple XmlRpcManagerServer.
  */
 public void Update(Node node, string type) {
   RpcManager rpc = RpcManager.GetInstance(node);
   _rpc = rpc;
   _node = node;
   _xrm = new XmlRpcManager(_node, _rpc);
   _rpc.AddHandler("xmlrpc", _xrm);
   string svc_name = type + "xm.rem";
   RemotingServices.Marshal(_xrm, svc_name);
 }
示例#13
0
 /**
  * The overloaded method for now is used to allow RpcManager to be replaced
  * by MockRpcManager in unit tests.
 public void Update(Node node, RpcManager rpc) {
   _rpc = rpc;
   _node = node;
   _xrm = new XmlRpcManager(_node, _rpc);
   _rpc.AddHandler("xmlrpc", _xrm);
   RemotingServices.Marshal(_xrm, "xm.rem");
 }
  */
 public void Update(Node node, RpcManager rpc) {
   Update(node,"");
 }
 public void Update(Node node, BrunetSecurityOverlord bso)
 {
   RpcManager rpc = RpcManager.GetInstance(node);
   _rpc = rpc;
   _node = node;
   _xrm = new XmlRpcManager(_node, _rpc, bso);
   _rpc.AddHandler("xmlrpc", _xrm);
   RemotingServices.Marshal(_xrm, "xm.rem");
 }
 public XmlRpcManager(Node node, RpcManager rpc, BrunetSecurityOverlord bso) :
   this(node, rpc)
 {
   _bso = bso;
 }