public Server(ChildInitializer childInitializer, ChannelInboundHandler parentHandler, LogProvider debugLogProvider, LogProvider userLogProvider, ListenSocketAddress listenAddress, string serverName) : base(debugLogProvider.GetLog(typeof(Server))) { this._childInitializer = childInitializer; this._parentHandler = parentHandler; this._listenAddress = listenAddress; this._debugLog = debugLogProvider.getLog(this.GetType()); this._userLog = userLogProvider.getLog(this.GetType()); this._serverName = serverName; this._threadFactory = new NamedThreadFactory(serverName); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public AsyncRequestLog(org.neo4j.io.fs.FileSystemAbstraction fs, java.time.ZoneId logTimeZone, String logFile, long rotationSize, int rotationKeepNumber) throws java.io.IOException public AsyncRequestLog(FileSystemAbstraction fs, ZoneId logTimeZone, string logFile, long rotationSize, int rotationKeepNumber) { NamedThreadFactory threadFactory = new NamedThreadFactory("HTTP-Log-Rotator", true); ExecutorService rotationExecutor = Executors.newCachedThreadPool(threadFactory); _outputSupplier = new RotatingFileOutputStreamSupplier(fs, new File(logFile), rotationSize, 0, rotationKeepNumber, rotationExecutor); FormattedLogProvider logProvider = FormattedLogProvider.withZoneId(logTimeZone).toOutputStream(_outputSupplier); _asyncLogProcessingExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("HTTP-Log-Writer")); _asyncEventProcessor = new AsyncEvents <AsyncLogEvent>(this, this); AsyncLogProvider asyncLogProvider = new AsyncLogProvider(_asyncEventProcessor, logProvider); _log = asyncLogProvider.GetLog("REQUEST"); }
public void Can_dump_tracked_threads() { var factory = new NamedThreadFactory("Can_dump_managed_threads"); var thread = factory.New(() => { while (true) { Debug.Assert("This".Equals("This")); } }); thread.Start(); Console.WriteLine(CLRProfiler.DumpTrackedThreads()); }