private static int LockCount(Locks locks) { LockCountVisitor lockCountVisitor = new LockCountVisitor(); locks.Accept(lockCountVisitor); return(lockCountVisitor.LockCount); }
private static string GetLocksDescriptionFunction(Locks locks) { StringWriter stringWriter = new StringWriter(); locks.Accept(new DumpLocksVisitor(FormattedLog.withUTCTimeZone().toWriter(stringWriter))); return(stringWriter.ToString()); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public java.io.File dumpState(Locks lm, LockWorker... workers) throws java.io.IOException public virtual File DumpState(Locks lm, params LockWorker[] workers) { FileStream @out = new FileStream(_file, false); FormattedLogProvider logProvider = FormattedLogProvider.withoutAutoFlush().toOutputStream(@out); try { // * locks held by the lock manager lm.Accept(new DumpLocksVisitor(logProvider.GetLog(typeof(LockWorkFailureDump)))); // * rag manager state; // * workers state Log log = logProvider.getLog(this.GetType()); foreach (LockWorker worker in workers) { // - what each is doing and have up to now log.Info("Worker %s", worker); } return(_file); } finally { @out.Flush(); @out.Close(); } }