Ejemplo n.º 1
0
 /// <summary>
 /// Constructs a new instance of the <see cref="CrawlWave.ServerPlugins.Initializer.InitializerPlugin"/> class.
 /// </summary>
 public InitializerPlugin()
 {
     dataDependent = true;
     description = "CrawlWave Initializer Plugin";
     enabled = true;
     host = null;
     name = "CrawlWave.ServerPlugins.Initializer";
     percent = 0;
     settingsPath = String.Empty;
     state = PluginState.Stopped;
     version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
     settings = PluginSettings.Instance();
     pluginThreads = null;
     outputStream = null;
     urlsToVisit = new Queue();
     mustStop = false;
     runningThreads = 0;
     totalDomains = 0;
     processedDomains = 0;
     banned = BannedHostsCache.Instance();
     dbcon = null;
     urlcmd = null;
     hostcmd = null;
     sync = new object();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Provides a global access point for the single instance of the <see cref="BannedHostsCache"/>
 /// class.
 /// </summary>
 /// <returns>A reference to the single instance of <see cref="BannedHostsCache"/>.</returns>
 public static BannedHostsCache Instance()
 {
     if (instance == null)
     {
         //Make sure the call is thread-safe.
         Mutex mutex = new Mutex();
         mutex.WaitOne();
         if (instance == null)
         {
             instance = new BannedHostsCache();
         }
         mutex.Close();
     }
     return(instance);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Provides a global access point for the single instance of the <see cref="BannedHostsCache"/>
 /// class.
 /// </summary>
 /// <returns>A reference to the single instance of <see cref="BannedHostsCache"/>.</returns>
 public static BannedHostsCache Instance()
 {
     if (instance==null)
     {
         //Make sure the call is thread-safe.
         Mutex mutex=new Mutex();
         mutex.WaitOne();
         if( instance == null )
         {
             instance = new BannedHostsCache();
         }
         mutex.Close();
     }
     return instance;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a new instance of the <see cref="CrawlWave.ServerPlugins.UrlSelection.UrlSelectorPlugin"/> class.
 /// </summary>
 public UrlSelectorPlugin()
 {
     dataDependent = true;
     description = "CrawlWave Url Selection Plugin";
     enabled = true;
     host = null;
     name = "CrawlWave.ServerPlugins.UrlSelection";
     percent = 0;
     settingsPath = String.Empty;
     state = PluginState.Stopped;
     version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
     settings = PluginSettings.Instance();
     dbcon = new SqlConnection(settings.DBConnectionString);
     pluginThread = null;
     mustStop = false;
     banned = BannedHostsCache.Instance();
     robots = RobotsCache.Instance();
 }