コード例 #1
0
        public MessageSubscription[] GetMessageSubscriptions(ServerConfig3 server)
        {
            IViewSubscriptions sc = null;

            if (server.ServiceBus == _mgr.ServiceBusName &&
                server.ServiceBusVersion == _mgr.ServiceBusVersion &&
                server.ServiceBusQueueType == _mgr.MessageQueueType)
            {
                sc = _mgr as IViewSubscriptions;
            }
            else
            {
                var mgr = ServiceBusFactory.CreateManager(server.ServiceBus, server.ServiceBusVersion, server.ServiceBusQueueType);
                sc = mgr as IViewSubscriptions;
            }

            if (sc != null)
            {
                return(sc.GetMessageSubscriptions(server.ConnectionSettings, server.MonitorQueues.Select(q => q.Name)));
            }
            else
            {
                return(new MessageSubscription[0]);
            }
        }
コード例 #2
0
        public Type[] GetAvailableCommands(string messageBus, string version, string queueType, string[] asmPaths, CommandDefinition cmdDef, bool suppressErrors)
        {
            var mgr = ServiceBusFactory.CreateManager(messageBus, version, queueType) as ISendCommand;

            if (mgr != null)
            {
                return(mgr.GetAvailableCommands(asmPaths, cmdDef, suppressErrors));
            }
            else
            {
                return(new Type[0]);
            }
        }
コード例 #3
0
        private void Initialize()
        {
            AppDomain.CurrentDomain.AssemblyResolve += SbmqmDomain_AssemblyResolve;
            _monitorState = new SbmqmMonitorState();

            Config = SystemConfig.Load();

            Config.StartCount += 1;

            _mgr = ServiceBusFactory.CreateManager(Config.MessageBus, Config.MessageBusQueueType);
            _mgr.ErrorOccured += System_ErrorOccured;
            _mgr.ItemsChanged += System_ItemsChanged;

            _mgr.Initialize(Config.MonitorServer, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

            CanSendCommand       = (_mgr as ISendCommand) != null;
            CanViewSubscriptions = (_mgr as IViewSubscriptions) != null;

            _history = new CommandHistoryManager(Config);

            AppInfo = new ApplicationInfo(Config.Id, Assembly.GetEntryAssembly());
        }
コード例 #4
0
        private void CreateServiceBusManager(string serviceBus, string version, string queueType)
        {
            _mgr = ServiceBusFactory.CreateManager(serviceBus, version, queueType);
            _mgr.ErrorOccured   += System_ErrorOccured;
            _mgr.WarningOccured += System_WarningOccured;
            _mgr.ItemsChanged   += System_ItemsChanged;

            var cmdSender = (_mgr as ISendCommand);

            if (cmdSender != null)
            {
                cmdSender.CommandContentFormat = Config.CurrentServer.CommandContentType;
            }

            lock (_itemsLock)
                _items.Clear();

            _mgr.Initialize(Config.CurrentServer.ConnectionSettings, Config.MonitorQueues.Select(mq => new Queue(mq.Name, mq.Type, mq.Color)).ToArray(), _monitorState);

            CanSendCommand       = (_mgr as ISendCommand) != null;
            CanViewSubscriptions = (_mgr as IViewSubscriptions) != null;

            _serviceBusHistory.Add(ServiceBusInfo.Create(serviceBus, version, queueType));
        }