示例#1
0
 /// <summary>
 /// Constructs the worker thread for the slave and starts it
 /// </summary>
 public virtual void BuildThreads()
 {
     Reader = new AnonymousClassThread(this);
     Writer = new AnonymousClassThread1(this);
     Writer.Start();
     Reader.Start();
 }
示例#2
0
 public virtual void  startShell()
 {
     if (shell == null)
     {
         SupportClass.ThreadClass shellThread = new AnonymousClassThread(this);
         shellThread.Start();
     }
 }
示例#3
0
        //creates list and starts thread to clean dead processors from it
        private void  initProcessorList()
        {
            myProcessors = new System.Collections.ArrayList();

            System.Collections.IList processors = myProcessors;
            SupportClass.ThreadClass cleaner    = new AnonymousClassThread(processors, this);
            cleaner.Start();
        }
        private void  RunTest(Directory dir)
        {
            // Run for ~7 seconds
            long stopTime = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) + 7000;

            SnapshotDeletionPolicy dp     = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
            IndexWriter            writer = new IndexWriter(dir, true, new StandardAnalyzer(), dp);

            // Force frequent commits
            writer.SetMaxBufferedDocs(2);

            SupportClass.ThreadClass t = new AnonymousClassThread(stopTime, writer, this);

            t.Start();

            // While the above indexing thread is running, take many
            // backups:
            while ((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) < stopTime)
            {
                BackupIndex(dir, dp);
                System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 20));
                if (!t.IsAlive)
                {
                    break;
                }
            }

            t.Join();

            // Add one more document to force writer to commit a
            // final segment, so deletion policy has a chance to
            // delete again:
            Document doc = new Document();

            doc.Add(new Field("content", "aaa", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
            writer.AddDocument(doc);

            // Make sure we don't have any leftover files in the
            // directory:
            writer.Close();
            TestIndexWriter.AssertNoUnreferencedFiles(dir, "some files were not deleted but should have been");
        }
示例#5
0
 public virtual void startShell()
 {
     if (shell == null)
     {
         SupportClass.ThreadClass shellThread = new AnonymousClassThread(this);
         shellThread.Start();
     }
 }
示例#6
0
        public LogPanel(JamochaGui gui)
            : base(gui)
        {
            InitBlock();
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            logChannel = gui.Engine.MessageRouter.openChannel("gui_log", InterestType.ALL);
            detailView = new JTextArea();
            detailView.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            detailView.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            cellRenderer = new LogTableCellRenderer(this);
            logTable = new AnonymousClassJTable(this, dataModel);
            logTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            logTable.SelectionModel.addListSelectionListener(this);
            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(logTable), new JScrollPane(detailView));
            pane.setDividerLocation(gui.Preferences.getInt("log.dividerlocation", 300));
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(pane, BorderLayout.CENTER);

            SupportClass.ThreadClass logThread = new AnonymousClassThread(this);
            logThread.Start();
            clearButton = new JButton("Clear Log", IconLoader.getImageIcon("monitor"));
            clearButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            buttonPanel.add(clearButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);
        }
示例#7
0
		//creates list and starts thread to clean dead processors from it     
		private void  initProcessorList()
		{
			myProcessors = new System.Collections.ArrayList();
			
			System.Collections.IList processors = myProcessors;
			SupportClass.ThreadClass cleaner = new AnonymousClassThread(processors, this);
			cleaner.Start();
		}