Source Code Cross Referenced for JSpiderEvent.java in  » Web-Crawler » jspider » net » javacoding » jspider » api » event » 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 » jspider » net.javacoding.jspider.api.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.javacoding.jspider.api.event;
002:
003:        import java.util.Date;
004:
005:        /**
006:         * Base class of all JSpider API events.  All events that will be dispatched
007:         * towards JSpider modules will extends directly or indirectly from this
008:         * class.
009:         *
010:         * $Id: JSpiderEvent.java,v 1.5 2003/03/23 15:44:48 vanrogu Exp $
011:         *
012:         * @author  Günther Van Roey
013:         */
014:        public abstract class JSpiderEvent implements  EventVisitable {
015:
016:            public static final String EVENT_PACKAGE = "net.javacoding.jspider.api.event.";
017:
018:            /** Event type used for events related to the JSpider engine. */
019:            public static final int EVENT_TYPE_ENGINE = 1;
020:
021:            /** Event type used for events related to monitoring. */
022:            public static final int EVENT_TYPE_MONITORING = 2;
023:
024:            /** Event type used for real spider events. */
025:            public static final int EVENT_TYPE_SPIDER = 3;
026:
027:            /** Timestamp of the event. */
028:            protected Date date;
029:
030:            /**
031:             * Public constructor.
032:             */
033:            public JSpiderEvent() {
034:                date = new Date();
035:            }
036:
037:            /**
038:             * Returns the name of the event
039:             * @return name of the event
040:             */
041:            public String getName() {
042:                return getClass().getName().substring(EVENT_PACKAGE.length());
043:            }
044:
045:            /**
046:             * Returns a Date object containing the event's timestamp
047:             * @return Date object containing the event's timestamp
048:             */
049:            public Date getRaisedDate() {
050:                return date;
051:            }
052:
053:            /**
054:             * Returns optional comments on the event.
055:             * @return comment on the event.
056:             */
057:            public abstract String getComment();
058:
059:            /**
060:             * Returns whether this event describes some sort of error situation.
061:             * @return boolean that is true if this event describes an error
062:             */
063:            public boolean isError() {
064:                return false;
065:            }
066:
067:            /**
068:             * Returns whether this event can be filtered out.  Only the most critical
069:             * events will return FALSE.
070:             * @return whether this event can be filtered out
071:             */
072:            public boolean isFilterable() {
073:                return true;
074:            }
075:
076:            /**
077:             * Returns the type of the event.
078:             * @return the type of the Event - Engine / Monitoring / Spider
079:             */
080:            public int getType() {
081:                // By default, it will be a normal spider event.
082:                return JSpiderEvent.EVENT_TYPE_SPIDER;
083:            }
084:
085:            /**
086:             * Accept method for the Visitor-pattern that's used for handling events.
087:             * @param visitor the visitor instance that wants to visit the event
088:             */
089:            public void accept(EventVisitor visitor) {
090:                visitor.visit(this );
091:            }
092:
093:            /**
094:             * Object's overridden toString() method.
095:             * @return String representation of the event
096:             */
097:            public String toString() {
098:                return this.getClass().getName();
099:            }
100:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.