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


001:        /*
002:         * Bossa Workflow System
003:         *
004:         * $Id: ResourceEvents.java,v 1.4 2004/01/29 17:07:10 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.resource;
026:
027:        import java.util.HashMap;
028:        import java.util.Map;
029:
030:        import com.bigbross.bossa.Bossa;
031:        import com.bigbross.bossa.notify.Event;
032:        import com.bigbross.bossa.notify.NotificationQueue;
033:
034:        /**
035:         * This class holds as static constants all ids of resource events. It also
036:         * provides methods used by the resource classes to create and notify these
037:         * events. <p>
038:         *
039:         * @author <a href="http://www.bigbross.com">BigBross Team</a>
040:         */
041:        public class ResourceEvents extends NotificationQueue {
042:
043:            /**
044:             * Constant to indicate the event of a resource creation in the
045:             * resource manager. <p>
046:             * 
047:             * This event contains the following attributes: ATTRIB_RESOURCE_ID <p>
048:             * 
049:             * @see ResourceEvents#ATTRIB_RESOURCE_ID
050:             */
051:            public static final String ID_CREATE_RESOURCE = "create_resource";
052:
053:            /**
054:             * Constant to indicate the event of a resource removal from the
055:             * resource manager. <p>
056:             * 
057:             * This event contains the following attributes: ATTRIB_RESOURCE_ID <p>
058:             * 
059:             * @see ResourceEvents#ATTRIB_RESOURCE_ID
060:             */
061:            public static final String ID_REMOVE_RESOURCE = "remove_resource";
062:
063:            /**
064:             * Constant to indicate the event of a resource being added to the
065:             * include list of another resource. <p>
066:             * 
067:             * This event contains the following attributes: ATTRIB_RESOURCE_ID and
068:             * ATTRIB_HOST_RESOURCE_ID <p>
069:             * 
070:             * @see ResourceEvents#ATTRIB_RESOURCE_ID
071:             * @see ResourceEvents#ATTRIB_HOST_RESOURCE_ID
072:             */
073:            public static final String ID_INCLUDE_IN_RESOURCE = "inc_in_resource";
074:
075:            /**
076:             * Constant to indicate the event of a resource being added to the
077:             * exclude list of another resource. <p>
078:             * 
079:             * This event contains the following attributes: ATTRIB_RESOURCE_ID and
080:             * ATTRIB_HOST_RESOURCE_ID <p>
081:             * 
082:             * @see ResourceEvents#ATTRIB_RESOURCE_ID
083:             * @see ResourceEvents#ATTRIB_HOST_RESOURCE_ID
084:             */
085:            public static final String ID_EXCLUDE_IN_RESOURCE = "exc_in_resource";
086:
087:            /**
088:             * Constant to indicate the event of a resource being removed from the
089:             * lists of another resource. <p>
090:             * 
091:             * This event contains the following attributes: ATTRIB_RESOURCE_ID and
092:             * ATTRIB_HOST_RESOURCE_ID <p>
093:             * 
094:             * @see ResourceEvents#ATTRIB_RESOURCE_ID
095:             * @see ResourceEvents#ATTRIB_HOST_RESOURCE_ID
096:             */
097:            public static final String ID_REMOVE_FROM_RESOURCE = "rem_from_resource";
098:
099:            /**
100:             * Constant to indicate the resource id attribute.
101:             */
102:            public static final String ATTRIB_RESOURCE_ID = "resource_id";
103:
104:            /**
105:             * Constant to indicate the host resource id attribute.
106:             */
107:            public static final String ATTRIB_HOST_RESOURCE_ID = "host_resource_id";
108:
109:            /**
110:             * Creates a single resource event and puts it in the queue. <p>
111:             * 
112:             * @param bossa the root of the bossa system.
113:             * @param notificationId the id of this event.
114:             * @param resource the resource involved.
115:             */
116:            void newSingleResourceEvent(Bossa bossa, String notificationId,
117:                    Resource resource) {
118:                if (bossa != null) {
119:                    Map attrib = new HashMap();
120:                    attrib.put(ATTRIB_RESOURCE_ID, resource.getId());
121:                    addEvent(new Event(notificationId, Event.RESOURCE_EVENT,
122:                            attrib, bossa.getTimeSource().getTime()));
123:                }
124:            }
125:
126:            /**
127:             * Creates an event with two resources and puts it in the queue. <p>
128:             * 
129:             * @param bossa the root of the bossa system.
130:             * @param notificationId the id of this event.
131:             * @param resource the resource being added or removed.
132:             * @param host the resource being manipulated.
133:             */
134:            void newTwoResourcesEvent(Bossa bossa, String notificationId,
135:                    Resource resource, Resource host) {
136:                if (bossa != null) {
137:                    Map attrib = new HashMap();
138:                    attrib.put(ATTRIB_RESOURCE_ID, resource.getId());
139:                    attrib.put(ATTRIB_HOST_RESOURCE_ID, host.getId());
140:                    addEvent(new Event(notificationId, Event.RESOURCE_EVENT,
141:                            attrib, bossa.getTimeSource().getTime()));
142:                }
143:            }
144:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.