Exemplo n.º 1
0
 /// <summary>
 /// 查找一个服务层
 /// </summary>
 /// <param name="_uuid"> 服务层唯一识别码</param>
 /// <returns>找到的服务层</returns>
 protected Service findService(string _uuid)
 {
     Service.Inner inner = board_.getServiceCenter().FindUnit(_uuid);
     if (null == inner)
     {
         return(null);
     }
     return(inner.getUnit());
 }
Exemplo n.º 2
0
 /// <summary>
 /// 查找一个服务层
 /// </summary>
 /// <param name="_uuid"> 服务层唯一识别码</param>
 /// <returns>找到的服务层</returns>
 protected Service findService(string _uuid)
 {
     Service.Inner inner = board_.serviceCenter.FindService(_uuid);
     if (null == inner)
     {
         return(null);
     }
     return(inner.service);
 }
Exemplo n.º 3
0
 public Error Register(string _uuid, Service.Inner _inner)
 {
     board_.getLogger().Info("register {0}", _uuid);
     if (units_.ContainsKey(_uuid))
     {
         return(Error.NewAccessErr("{0} exists", _uuid));
     }
     units_[_uuid] = _inner;
     return(Error.OK);
 }
Exemplo n.º 4
0
 /// <summary>删除服务层</summary>
 /// <param name="_uuid">服务层唯一识别码</param>
 /// <returns>错误</returns>
 public Error PopService(string _uuid)
 {
     Service.Inner inner = board_.getServiceCenter().FindUnit(_uuid);
     if (null == inner)
     {
         return(Error.NewAccessErr("controller {0} not found", _uuid));
     }
     inner.Dismantle();
     return(board_.getServiceCenter().Cancel(_uuid));
 }
Exemplo n.º 5
0
        /// <summary>添加服务层</summary>
        /// <param name="_uuid">服务层唯一识别码</param>
        /// <param name="_view">服务层实列</param>
        /// <returns>错误</returns>
        public Error PushService(string _uuid, Service _service)
        {
            Service.Inner inner = new Service.Inner(_service);
            Error         err   = board_.getServiceCenter().Register(_uuid, inner);

            if (!Error.IsOK(err))
            {
                return(err);
            }
            inner.Setup(board_);
            return(Error.OK);
        }
Exemplo n.º 6
0
 public Service.Inner FindUnit(string _uuid)
 {
     Service.Inner inner = null;
     units_.TryGetValue(_uuid, out inner);
     return(inner);
 }
Exemplo n.º 7
0
 /// <summary>注册服务层</summary>
 /// <param name="_uuid">服务层唯一识别码</param>
 /// <param name="_model">服务层实例</param>
 /// <returns>错误</returns>
 public Error RegisterService(string _uuid, Service _service)
 {
     Service.Inner inner = new Service.Inner(_service);
     return(board_.serviceCenter.Register(_uuid, inner));
 }