示例#1
0
 /// <summary>
 /// The public access point of the object
 /// </summary>
 /// <returns>The single instance</returns>
 public static WordExtractor Instance()
 {
     if (instance == null)
     {
         // Only one thread can obtain a mutex
         Mutex imutex = new Mutex();
         imutex.WaitOne();
         if (instance == null)
         {
             instance = new WordExtractor();
         }
         imutex.Close();
     }
     return(instance);
 }
 /// <summary>
 /// Create a new instance of the <see cref="WordExtractorPlugin"/> class.
 /// </summary>
 public WordExtractorPlugin()
 {
     mutex = new Mutex();
     settings = PluginSettings.Instance();
     name = "CrawlWave.ServerPlugins.WordExtraction";
     description = "CrawlWave Word Extraction Plugin";
     dataDependent = false;
     state = PluginState.Stopped;
     enabled = true;
     version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
     percent = 0;
     mustStop = false;
     pluginThread = null;
     if(settings.UseDatabase)
     {
         dbProvider = DBConnectionStringProvider.Instance();
         settings.DBConnectionString = dbProvider.ProvideDBConnectionString(name);
         dbcon = new SqlConnection(settings.DBConnectionString);
     }
     wordExtractor = WordExtractor.Instance();
     cache = WordsCache.Instance();
     backoff = new Backoff(BackoffSpeed.Slow, 30000);
 }
示例#3
0
 /// <summary>
 /// Create a new instance of the <see cref="WordExtractorPlugin"/> class.
 /// </summary>
 public WordExtractorPlugin()
 {
     mutex         = new Mutex();
     settings      = PluginSettings.Instance();
     name          = "CrawlWave.ServerPlugins.WordExtraction";
     description   = "CrawlWave Word Extraction Plugin";
     dataDependent = false;
     state         = PluginState.Stopped;
     enabled       = true;
     version       = Assembly.GetExecutingAssembly().GetName().Version.ToString();
     percent       = 0;
     mustStop      = false;
     pluginThread  = null;
     if (settings.UseDatabase)
     {
         dbProvider = DBConnectionStringProvider.Instance();
         settings.DBConnectionString = dbProvider.ProvideDBConnectionString(name);
         dbcon = new SqlConnection(settings.DBConnectionString);
     }
     wordExtractor = WordExtractor.Instance();
     cache         = WordsCache.Instance();
     backoff       = new Backoff(BackoffSpeed.Slow, 30000);
 }
示例#4
0
 /// <summary>
 /// The public access point of the object
 /// </summary>
 /// <returns>The single instance</returns>
 public static WordExtractor Instance()
 {
     if(instance==null)
     {
         // Only one thread can obtain a mutex
         Mutex imutex = new Mutex();
         imutex.WaitOne();
         if(instance==null)
         {
             instance=new WordExtractor();
         }
         imutex.Close();
     }
     return instance;
 }