Source Code Cross Referenced for ActivityUniqueKey.java in  » Workflow-Engines » wfmopen-2.1.1 » de » danet » an » workflow » api » 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 » wfmopen 2.1.1 » de.danet.an.workflow.api 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the WfMOpen project.
003:         * Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
004:         * All rights reserved.
005:         *
006:         * This program is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU General Public License as published by
008:         * the Free Software Foundation; either version 2 of the License, or
009:         * (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         * $Id: ActivityUniqueKey.java,v 1.2 2006/09/29 12:32:07 drmlipp Exp $
021:         *
022:         * $Log: ActivityUniqueKey.java,v $
023:         * Revision 1.2  2006/09/29 12:32:07  drmlipp
024:         * Consistently using WfMOpen as projct name now.
025:         *
026:         * Revision 1.1.1.1  2003/06/30 20:05:13  drmlipp
027:         * Initial import
028:         *
029:         * Revision 1.6  2003/06/27 08:51:46  lipp
030:         * Fixed copyright/license information.
031:         *
032:         * Revision 1.5  2002/11/26 11:23:30  lipp
033:         * Modified RemoteException comment.
034:         *
035:         * Revision 1.4  2002/10/02 10:58:13  lipp
036:         * Modifications for tool invocation.
037:         *
038:         * Revision 1.3  2002/07/05 20:35:12  lipp
039:         * Redefined ActivityUniqueKey constructor parameter sequence.
040:         *
041:         * Revision 1.2  2002/06/26 21:45:43  lipp
042:         * Added equals and hash.
043:         *
044:         * Revision 1.1  2002/06/15 19:02:02  lipp
045:         * New utility type.
046:         *
047:         */
048:        package de.danet.an.workflow.api;
049:
050:        import java.io.Serializable;
051:
052:        import java.rmi.RemoteException;
053:
054:        import de.danet.an.workflow.omgcore.WfActivity;
055:        import de.danet.an.workflow.omgcore.WfProcess;
056:
057:        /**
058:         * This class implements a unique activity key. The OMG interface defines
059:         * the key returned by the
060:         * {@link de.danet.an.workflow.omgcore.WfExecutionObject#key
061:         * <code>key()</code>} method as unique within the scope of the containing 
062:         * process only. The key of a process in turn is unique only among the 
063:         * processes with a common process manager.<P>
064:         *
065:         * This class therefore combines the activity key, the process key and
066:         * the process manager name to a unique activity key.
067:         *
068:         * @author <a href="mailto:mnl@mnl.de">Michael N. Lipp</a>
069:         * @version $Revision: 1.2 $
070:         */
071:
072:        public class ActivityUniqueKey implements  Serializable {
073:
074:            private String mgrName;
075:            private String procKey;
076:            private String actKey;
077:
078:            /**
079:             * Creates an instance of <code>ActivityUniqueKey</code>
080:             * for the given activity.
081:             *
082:             * @param activity the <code>WfActivity</code>.
083:             * @throws RemoteException if a system-level error occurs.
084:             */
085:            public ActivityUniqueKey(WfActivity activity)
086:                    throws RemoteException {
087:                actKey = activity.key();
088:                WfProcess proc = activity.container();
089:                procKey = proc.key();
090:                String mgrName = proc.manager().name();
091:            }
092:
093:            /**
094:             * Creates an instance of <code>ActivityUniqueKey</code>
095:             * from the given partial keys.
096:             *
097:             * @param managerName the process manager name.
098:             * @param processKey the process key.
099:             * @param activityKey the activity key.
100:             */
101:            public ActivityUniqueKey(String managerName, String processKey,
102:                    String activityKey) {
103:                if (activityKey == null || processKey == null
104:                        || managerName == null) {
105:                    throw new IllegalArgumentException();
106:                }
107:                mgrName = managerName;
108:                procKey = processKey;
109:                actKey = activityKey;
110:            }
111:
112:            /**
113:             * Two <code>ActivityUniqueKey</code>s are equal, if all
114:             * attributes are equal.
115:             *
116:             * @param other a <code>ActivityUniqueKey</code> value
117:             * @return <code>true</code> if objects are equal.
118:             */
119:            public boolean equals(Object other) {
120:                ActivityUniqueKey o = (ActivityUniqueKey) other;
121:                return actKey.equals(o.actKey) && procKey.equals(o.procKey)
122:                        && mgrName.equals(o.mgrName);
123:            }
124:
125:            /**
126:             * Calculate a hash code for a <code>ActivityUniqueKey</code>
127:             * object.
128:             *
129:             * @return the hash code.
130:             */
131:            public int hashCode() {
132:                return actKey.hashCode() ^ procKey.hashCode()
133:                        ^ mgrName.hashCode();
134:            }
135:
136:            /**
137:             * Return the activity key.
138:             *
139:             * @return the activity key.
140:             */
141:            public String activityKey() {
142:                return actKey;
143:            }
144:
145:            /**
146:             * Return the process key.
147:             *
148:             * @return the process key.
149:             */
150:            public String processKey() {
151:                return procKey;
152:            }
153:
154:            /**
155:             * Return the process manager name.
156:             *
157:             * @return the process manager name.
158:             */
159:            public String managerName() {
160:                return mgrName;
161:            }
162:
163:            /**
164:             * Generate a string representation for debugging purposes.
165:             * @return a string representation.
166:             */
167:            public String toString() {
168:                return "Activity[" + mgrName + "/" + procKey + "/" + actKey
169:                        + "]";
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.