Source Code Cross Referenced for Event.java in  » Workflow-Engines » Bossa » com » bigbross » bossa » notify » 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 » Workflow Engines » Bossa » com.bigbross.bossa.notify 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Bossa Workflow System
003:         *
004:         * $Id: Event.java,v 1.7 2004/01/15 22:13:32 gdvieira Exp $
005:         *
006:         * Copyright (C) 2003,2004 OpenBR Sistemas S/C Ltda.
007:         *
008:         * This file is part of Bossa.
009:         *
010:         * Bossa is free software; you can redistribute it and/or modify it
011:         * under the terms of version 2 of the GNU General Public License as
012:         * published by the Free Software Foundation.
013:         *
014:         * This program is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
017:         * General Public License for more details.
018:         *
019:         * You should have received a copy of the GNU General Public
020:         * License along with this program; if not, write to the
021:         * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
022:         * Boston, MA 02111-1307, USA.
023:         */
024:
025:        package com.bigbross.bossa.notify;
026:
027:        import java.io.Serializable;
028:        import java.util.Collections;
029:        import java.util.Date;
030:        import java.util.Map;
031:
032:        /**
033:         * This class represents an event in the notification bus. <p>
034:         *
035:         * @author <a href="http://www.bigbross.com">BigBross Team</a>
036:         */
037:        public class Event implements  Comparable, Serializable {
038:
039:            private String id;
040:
041:            private int type;
042:
043:            private Map attributes;
044:
045:            private Date time;
046:
047:            /**
048:             * Constant to indicate a work item or activity related event type.
049:             */
050:            public static final int WFNET_EVENT = 1;
051:
052:            /**
053:             * Constant to indicate a resource manipulation event type.
054:             */
055:            public static final int RESOURCE_EVENT = 2;
056:
057:            /**
058:             * Creates an event. For a list of the possible event types, see the
059:             * constants defined in this class. <p>
060:             * 
061:             * The meaning of the id and of the attributes map are
062:             * defined by the generator of the event. The only exception is that a
063:             * event with type <code>WFNET_EVENT</code> <i>should</i> contain an
064:             * attribute named <code>WFNetEvents.ATTRIB_RESOURCE_ID</code>,
065:             * indicating the resource this event affects. Also all attribute
066:             * mappings are <code>String</code> id to <code>String</code> value. <p>
067:             * 
068:             * @param id the id of this event.
069:             * @param type the type os this event.
070:             * @param attributes a <code>Map</code> containing the attributes.
071:             * @param time the time this event happened.
072:             * @see com.bigbross.bossa.wfnet.WFNetEvents#ATTRIB_RESOURCE_ID
073:             */
074:            public Event(String id, int type, Map attributes, Date time) {
075:                this .id = id;
076:                this .type = type;
077:                this .attributes = attributes;
078:                this .time = (Date) time.clone();
079:            }
080:
081:            /**
082:             * Returns the id of this event. <p>
083:             * 
084:             * @return the id of this event.
085:             */
086:            public String getId() {
087:                return this .id;
088:            }
089:
090:            /**
091:             * Returns the type of this event. <p>
092:             * 
093:             * @return the type of this event.
094:             */
095:            public int getType() {
096:                return this .type;
097:            }
098:
099:            /**
100:             * Returns the attributes map of this event. <p>
101:             * 
102:             * Notice that it is not possible to change this map. If tried, an
103:             * UnsupportedOperationException will be thrown.
104:             * 
105:             * @return the attributes map of this event.
106:             */
107:            public Map getAttributes() {
108:                return Collections.unmodifiableMap(this .attributes);
109:            }
110:
111:            /**
112:             * Returns the time this event happened. <p>
113:             * 
114:             * @return the time this event happened.
115:             */
116:            public Date getTime() {
117:                return (Date) this .time.clone();
118:            }
119:
120:            /**
121:             * Note: this class has a natural ordering that is inconsistent with
122:             * equals. <p>
123:             * 
124:             * @see java.lang.Comparable#compareTo(java.lang.Object)
125:             */
126:            public int compareTo(Object o) {
127:                return this .time.compareTo(((Event) o).getTime());
128:            }
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.