public MessageRoute OpenRoute(string machine, int thread, DateTime createdOn)
        {
            var processId = new ProcessId(machine, thread);
            MessageRoute messageRoute = MessageRoute.Open(bus, processId, createdOn);
            currentRoutes.Add(processId, messageRoute);

            return messageRoute;
        }
        MessageRoute(IEventBus bus, ProcessId processId, DateTime createdOn)
            : base(bus)
        {
            var id = new MessageRouteId();
            hierarchy = new MessageRouteHierarchy(this, id);
            this.processId = processId;

            PublishEvent(new MessageRouteStarted
            {
                Id = id,
                MachineName = processId.MachineName,
                Thread = processId.Thread,
                CreatedOn = createdOn
            });
        }
 public static MessageRoute Open(IEventBus bus, ProcessId processId, DateTime createdOn)
 {
     return new MessageRoute(bus, processId, createdOn);
 }
示例#4
0
 /// <summary>
 /// Remove process from blacklist
 /// </summary>
 public static void RemoveFromProcessBlacklist(ProcessId process)
 {
     if (processBlacklist != null)
     {
         processBlacklist = processBlacklist.Remove(process.Path);
     }
 }
示例#5
0
 /// <summary>
 /// Process blacklist
 /// Prevents javascript process access to server processes unless they're not on the blacklist
 /// NOTE: The blacklist and whitelist is an either/or situation, you must decide on whether to
 /// white or blacklist a set of processes.
 /// </summary>
 /// <param name="process">Process to add to the whitelist</param>
 public static void AddToProcessBlacklist(ProcessId process)
 {
     AddToProcessBlacklist(new[] { process });
 }
示例#6
0
 /// <summary>
 /// Process whitelist
 /// Prevents javascript process access to server processes unless they're on the whitelist
 /// NOTE: The blacklist and whitelist is an either/or situation, you must decide on whether to
 /// white or blacklist a set of processes.
 /// </summary>
 /// <param name="process">Process to add to the whitelist</param>
 public static void AddToProcessWhitelist(ProcessId process)
 {
     AddToProcessWhitelist( new[] { process } );
 }
示例#7
0
 private ProcessId EnsureProcessHub()
 {
     if (processHub.IsValid)
     {
         return processHub;
     }
     else
     {
         lock (sync)
         {
             if (processHub.IsValid) return processHub;
             processHub = spawn<OutboundRelayMsg>("process-hub-js", msg =>
             {
                 var conns = new List<string>();
                 conns.Add(msg.ConnectionId);
                 GlobalHost.ConnectionManager.GetHubContext<ProcessHub>().Clients.Clients(conns).onMessage(msg.Message);
             });
             return processHub;
         }
     }
 }
示例#8
0
 private static void Bouncer(ProcessId pid, Action f)
 {
     if (processWhitelist != null && !processWhitelist.Contains(pid.Path)) return;
     if (processBlacklist != null && processBlacklist.Contains(pid.Path)) return;
     f();
 }