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); }
/// <summary> /// Remove process from blacklist /// </summary> public static void RemoveFromProcessBlacklist(ProcessId process) { if (processBlacklist != null) { processBlacklist = processBlacklist.Remove(process.Path); } }
/// <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 }); }
/// <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 } ); }
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; } } }
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(); }