Exemplo n.º 1
0
 protected IsolationAppServer(string serverTypeName, StatusInfoAttribute[] serverStatusMetadata)
 {
     State = ServerState.NotInitialized;
     ServerTypeName = serverTypeName;
     m_ServerStatusMetadata = PrepareStatusMetadata(serverStatusMetadata);
 }
Exemplo n.º 2
0
 protected override IWorkItem CreateWorkItemInstance(string serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
 {
     return new AppDomainAppServer(serviceTypeName, serverStatusMetadata);
 }
Exemplo n.º 3
0
        private StatusInfoAttribute[] PrepareStatusMetadata(StatusInfoAttribute[] serverStatusMetadata)
        {
            if (!StatusMetadataExtended)
                return serverStatusMetadata;

            var additionalAttrs = this.GetType()
                            .GetCustomAttributes(typeof(StatusInfoAttribute), true)
                            .OfType<StatusInfoAttribute>()
                            .ToArray();

            if (additionalAttrs.Length == 0)
                return serverStatusMetadata;

            var list = serverStatusMetadata.ToList();
            list.AddRange(additionalAttrs);
            return list.ToArray();
        }
Exemplo n.º 4
0
 /// <summary>
 /// 创建AppServer工作项实例
 /// </summary>
 protected virtual IWorkItem CreateWorkItemInstance(string serviceTypeName, StatusInfoAttribute[] serverStatusMetadata)
 {
     var serviceType = Type.GetType(serviceTypeName, true);
     return Activator.CreateInstance(serviceType) as IWorkItem;
 }