Java Doc for AbstractTracker.java in  » Web-Crawler » heritrix » org » archive » crawler » framework » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » heritrix » org.archive.crawler.framework 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.archive.crawler.settings.ModuleType
   org.archive.crawler.framework.AbstractTracker

All known Subclasses:   org.archive.crawler.admin.StatisticsTracker,
AbstractTracker
abstract public class AbstractTracker extends ModuleType implements StatisticsTracking,CrawlStatusListener,Serializable(Code)
A partial implementation of the StatisticsTracking interface.

It covers the thread handling. (Launching, pausing etc.) Included in this is keeping track of the total time spent (actually) crawling. Several methods to access the time started, finished etc. are provided.

To handle the thread work the class implements the CrawlStatusListener and uses it's events to pause, resume and stop logging of statistics. The run() method will call logActivity() at intervals specified in the crawl order.

Implementation of logActivity (the actual logging) as well as listening for CrawlURIDisposition events is not addressed.
author:
   Kristinn Sigurdsson
See Also:   org.archive.crawler.framework.StatisticsTracking
See Also:   org.archive.crawler.admin.StatisticsTracker



Field Summary
final public static  StringATTR_STATS_INTERVAL
    
final public static  IntegerDEFAULT_STATISTICS_REPORT_INTERVAL
    
protected transient  CrawlControllercontroller
     A reference to the CrawlContoller of the crawl that we are to track statistics for.
protected  longcrawlerEndTime
    
protected  longcrawlerPauseStarted
    
protected  longcrawlerStartTime
    
protected  longcrawlerTotalPausedTime
    
protected  longlastLogPointTime
    
protected  booleanshouldrun
    

Constructor Summary
public  AbstractTracker(String name, String description)
    

Method Summary
public  longcrawlDuration()
    
public  voidcrawlEnded(String sExitMessage)
    
public  voidcrawlEnding(String sExitMessage)
    
public  voidcrawlPaused(String statusMessage)
    
public  voidcrawlPausing(String statusMessage)
    
public  voidcrawlResuming(String statusMessage)
    
public  voidcrawlStarted(String message)
    
protected  voiddumpReports()
     Dump reports, if any, on request or at crawl end.
protected  voidfinalCleanup()
     Cleanup resources used, at crawl end.
public  longgetCrawlEndTime()
     If crawl has ended it will return the time it ended (given by System.currentTimeMillis() at that time).
public  longgetCrawlPauseStartedTime()
     Get the time when the the crawl was last paused/suspended (as given by System.currentTimeMillis() at that time).
public  longgetCrawlStartTime()
     Get the starting time of the crawl (as given by System.currentTimeMillis() when the crawl started).
public  longgetCrawlTotalPauseTime()
     Returns the number of milliseconds that the crawl spent paused or otherwise in a nonactive state. the number of msec.
public  longgetCrawlerTotalElapsedTime()
    
protected  intgetLogWriteInterval()
     The number of seconds to wait between writing snapshot data to log file.
public  voidinitialize(CrawlController c)
     Sets up the Logger (including logInterval) and registers with the CrawlController for CrawlStatus and CrawlURIDisposition events.
Parameters:
  c - A crawl controller instance.
throws:
  FatalConfigurationException - Not thrown here.
protected  voidlogNote(String note)
    
public  voidnoteStart()
     Notify tracker that crawl has begun.
protected synchronized  voidprogressStatisticsEvent(EventObject e)
     A method for logging current crawler state. This method will be called by run() at intervals specified in the crawl order file.
public  StringprogressStatisticsLegend()
    
public  voidrun()
     Start thread.
protected  voidtallyCurrentPause()
    

Field Detail
ATTR_STATS_INTERVAL
final public static String ATTR_STATS_INTERVAL(Code)
Attribute name for logging interval in seconds setting



DEFAULT_STATISTICS_REPORT_INTERVAL
final public static Integer DEFAULT_STATISTICS_REPORT_INTERVAL(Code)
Default period between logging stat values



controller
protected transient CrawlController controller(Code)
A reference to the CrawlContoller of the crawl that we are to track statistics for.



crawlerEndTime
protected long crawlerEndTime(Code)



crawlerPauseStarted
protected long crawlerPauseStarted(Code)



crawlerStartTime
protected long crawlerStartTime(Code)



crawlerTotalPausedTime
protected long crawlerTotalPausedTime(Code)



lastLogPointTime
protected long lastLogPointTime(Code)
Timestamp of when this logger last wrote something to the log



shouldrun
protected boolean shouldrun(Code)




Constructor Detail
AbstractTracker
public AbstractTracker(String name, String description)(Code)

Parameters:
  name -
Parameters:
  description -




Method Detail
crawlDuration
public long crawlDuration()(Code)

See Also:   org.archive.crawler.framework.StatisticsTracking.crawlDuration



crawlEnded
public void crawlEnded(String sExitMessage)(Code)

See Also:   org.archive.crawler.event.CrawlStatusListener.crawlEnded(java.lang.String)



crawlEnding
public void crawlEnding(String sExitMessage)(Code)



crawlPaused
public void crawlPaused(String statusMessage)(Code)



crawlPausing
public void crawlPausing(String statusMessage)(Code)

See Also:   org.archive.crawler.event.CrawlStatusListener.crawlPausing(java.lang.String)



crawlResuming
public void crawlResuming(String statusMessage)(Code)



crawlStarted
public void crawlStarted(String message)(Code)



dumpReports
protected void dumpReports()(Code)
Dump reports, if any, on request or at crawl end.



finalCleanup
protected void finalCleanup()(Code)
Cleanup resources used, at crawl end.



getCrawlEndTime
public long getCrawlEndTime()(Code)
If crawl has ended it will return the time it ended (given by System.currentTimeMillis() at that time).
If crawl is still going on it will return the same as System.currentTimeMillis() at the time of the call. The time of the crawl ending or the current time if the crawl hasnot ended.



getCrawlPauseStartedTime
public long getCrawlPauseStartedTime()(Code)
Get the time when the the crawl was last paused/suspended (as given by System.currentTimeMillis() at that time). Will be 0 if the crawl is not currently paused. time of the crawl's last pause/suspend or 0 if the crawl is notcurrently paused.



getCrawlStartTime
public long getCrawlStartTime()(Code)
Get the starting time of the crawl (as given by System.currentTimeMillis() when the crawl started). time fo the crawl's start



getCrawlTotalPauseTime
public long getCrawlTotalPauseTime()(Code)
Returns the number of milliseconds that the crawl spent paused or otherwise in a nonactive state. the number of msec. that the crawl was paused or otherwisesuspended.



getCrawlerTotalElapsedTime
public long getCrawlerTotalElapsedTime()(Code)



getLogWriteInterval
protected int getLogWriteInterval()(Code)
The number of seconds to wait between writing snapshot data to log file. the number of seconds to wait between writing snapshot data tolog file.



initialize
public void initialize(CrawlController c) throws FatalConfigurationException(Code)
Sets up the Logger (including logInterval) and registers with the CrawlController for CrawlStatus and CrawlURIDisposition events.
Parameters:
  c - A crawl controller instance.
throws:
  FatalConfigurationException - Not thrown here. For overrides thatgo to settings system for configuration.
See Also:   CrawlStatusListener
See Also:   org.archive.crawler.event.CrawlURIDispositionListener



logNote
protected void logNote(String note)(Code)



noteStart
public void noteStart()(Code)
Notify tracker that crawl has begun. Must be called outside tracker's own thread, to ensure it is noted before other threads start interacting with tracker.



progressStatisticsEvent
protected synchronized void progressStatisticsEvent(EventObject e)(Code)
A method for logging current crawler state. This method will be called by run() at intervals specified in the crawl order file. It is also invoked when pausing or stopping a crawl to capture the state at that point. Default behavior is call to CrawlController.logProgressStatistics so CrawlController can act on progress statistics event.

It is recommended that for implementations of this method it be carefully considered if it should be synchronized in whole or in part
Parameters:
  e - Progress statistics event.




progressStatisticsLegend
public String progressStatisticsLegend()(Code)
legend for progress-statistics lines/log



run
public void run()(Code)
Start thread. Will call logActivity() at intervals specified by logInterval



tallyCurrentPause
protected void tallyCurrentPause()(Code)
For a current pause (if any), add paused time to total and reset



Methods inherited from org.archive.crawler.settings.ModuleType
public Type addElement(CrawlerSettings settings, Type type) throws InvalidAttributeValueException(Code)(Java Doc)
protected void listUsedFiles(List<String> list)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.