Source Code Cross Referenced for Package.java in  » Workflow-Engines » JaWE » org » enhydra » shark » xpdl » elements » 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 » JaWE » org.enhydra.shark.xpdl.elements 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.shark.xpdl.elements;
002:
003:        import java.util.ArrayList;
004:        import java.util.Collection;
005:        import java.util.Iterator;
006:
007:        import org.enhydra.shark.utilities.SequencedHashMap;
008:        import org.enhydra.shark.xpdl.XMLAttribute;
009:        import org.enhydra.shark.xpdl.XMLComplexElement;
010:        import org.enhydra.shark.xpdl.XMLElement;
011:        import org.enhydra.shark.xpdl.XMLElementChangeInfo;
012:
013:        /**
014:         *  Represents coresponding element from XPDL schema.
015:         *
016:         *  @author Sasa Bojanic
017:         */
018:        public class Package extends XMLComplexElement {
019:
020:            protected Namespaces namespaces;
021:            protected String internalVersion;
022:            protected boolean isTransient;
023:
024:            protected SequencedHashMap extPkgRefsToIds = new SequencedHashMap();
025:
026:            //transient static int pkgno=0;
027:            //transient int pno;
028:            //transient static ArrayList createdPKGs=new ArrayList();
029:            //transient static ArrayList destroyedPKGs=new ArrayList();
030:
031:            public Package() {
032:                super (null, true);
033:                //      pno=++pkgno;
034:                //      System.err.println("PKG "+(pno)+" created, hc="+hashCode());
035:                //      createdPKGs.add(new Integer(pno));
036:                namespaces = new Namespaces(this );
037:                internalVersion = "-1";
038:                isTransient = false;
039:            }
040:
041:            public void makeAs(XMLElement el) {
042:                super .makeAs(el);
043:                this .namespaces.makeAs(((Package) el).namespaces);
044:                extPkgRefsToIds = new SequencedHashMap(
045:                        ((Package) el).extPkgRefsToIds);
046:                this .isTransient = ((Package) el).isTransient;
047:            }
048:
049:            protected void fillStructure() {
050:                XMLAttribute attrId = new XMLAttribute(this , "Id", true); // required
051:                XMLAttribute attrName = new XMLAttribute(this , "Name", false);
052:                PackageHeader refPackageHeader = new PackageHeader(this );
053:                RedefinableHeader refRedefinableHeader = new RedefinableHeader(
054:                        this ); // min=0
055:                ConformanceClass refConformanceClass = new ConformanceClass(
056:                        this ); // min=0
057:                Script refScript = new Script(this ); // min=0
058:                ExternalPackages refExternalPackages = new ExternalPackages(
059:                        this ); // min=0
060:                TypeDeclarations refTypeDeclarations = new TypeDeclarations(
061:                        this ); // min=0
062:                Participants refParticipants = new Participants(this );
063:                Applications refApplications = new Applications(this ); // min=0
064:                DataFields refDataFields = new DataFields(this ); // min=0
065:                WorkflowProcesses refWorkflowProcesses = new WorkflowProcesses(
066:                        this ); // min=0
067:                ExtendedAttributes refExtendedAttributes = new ExtendedAttributes(
068:                        this );
069:
070:                add(attrId);
071:                add(attrName);
072:                add(refPackageHeader);
073:                add(refRedefinableHeader);
074:                add(refConformanceClass);
075:                add(refScript);
076:                add(refExternalPackages);
077:                add(refTypeDeclarations);
078:                add(refParticipants);
079:                add(refApplications);
080:                add(refDataFields);
081:                add(refWorkflowProcesses);
082:                add(refExtendedAttributes);
083:            }
084:
085:            public boolean isTransient() {
086:                return isTransient;
087:            }
088:
089:            public void setTransient(boolean trans) {
090:                this .isTransient = trans;
091:            }
092:
093:            public String getInternalVersion() {
094:                return internalVersion;
095:            }
096:
097:            public void setInternalVersion(String internalVersion) {
098:                this .internalVersion = internalVersion;
099:            }
100:
101:            public void addExternalPackageMapping(String epRef, String epId) {
102:                extPkgRefsToIds.put(epRef, epId);
103:            }
104:
105:            public void removeExternalPackageMapping(String epRef) {
106:                extPkgRefsToIds.remove(epRef);
107:            }
108:
109:            public String getExternalPackageId(String epRef) {
110:                return (String) extPkgRefsToIds.get(epRef);
111:            }
112:
113:            public Collection getExternalPackageIds() {
114:                return new ArrayList(extPkgRefsToIds.values());
115:            }
116:
117:            public ExternalPackage getExternalPackage(String id) {
118:                ExternalPackage toRet = null;
119:                Iterator it = getExternalPackages().toElements().iterator();
120:                while (it.hasNext()) {
121:                    ExternalPackage ep = (ExternalPackage) it.next();
122:                    String href = ep.getHref();
123:                    String epId = getExternalPackageId(href);
124:                    if (epId != null && epId.equals(id)) {
125:                        toRet = ep;
126:                        break;
127:                    }
128:                }
129:                return toRet;
130:            }
131:
132:            public WorkflowProcess getWorkflowProcess(String Id) {
133:                return getWorkflowProcesses().getWorkflowProcess(Id);
134:            }
135:
136:            public Application getApplication(String Id) {
137:                return getApplications().getApplication(Id);
138:            }
139:
140:            public Participant getParticipant(String Id) {
141:                return getParticipants().getParticipant(Id);
142:            }
143:
144:            public DataField getDataField(String Id) {
145:                return getDataFields().getDataField(Id);
146:            }
147:
148:            public TypeDeclaration getTypeDeclaration(String Id) {
149:                return getTypeDeclarations().getTypeDeclaration(Id);
150:            }
151:
152:            public String getId() {
153:                return get("Id").toValue();
154:            }
155:
156:            public void setId(String id) {
157:                set("Id", id);
158:            }
159:
160:            public String getName() {
161:                return get("Name").toValue();
162:            }
163:
164:            public void setName(String name) {
165:                set("Name", name);
166:            }
167:
168:            public Applications getApplications() {
169:                return (Applications) get("Applications");
170:            }
171:
172:            public ConformanceClass getConformanceClass() {
173:                return (ConformanceClass) get("ConformanceClass");
174:            }
175:
176:            public DataFields getDataFields() {
177:                return (DataFields) get("DataFields");
178:            }
179:
180:            public ExtendedAttributes getExtendedAttributes() {
181:                return (ExtendedAttributes) get("ExtendedAttributes");
182:            }
183:
184:            public ExternalPackages getExternalPackages() {
185:                return (ExternalPackages) get("ExternalPackages");
186:            }
187:
188:            public PackageHeader getPackageHeader() {
189:                return (PackageHeader) get("PackageHeader");
190:            }
191:
192:            public Participants getParticipants() {
193:                return (Participants) get("Participants");
194:            }
195:
196:            public RedefinableHeader getRedefinableHeader() {
197:                return (RedefinableHeader) get("RedefinableHeader");
198:            }
199:
200:            public Script getScript() {
201:                return (Script) get("Script");
202:            }
203:
204:            public TypeDeclarations getTypeDeclarations() {
205:                return (TypeDeclarations) get("TypeDeclarations");
206:            }
207:
208:            public WorkflowProcesses getWorkflowProcesses() {
209:                return (WorkflowProcesses) get("WorkflowProcesses");
210:            }
211:
212:            public Namespaces getNamespaces() {
213:                return namespaces;
214:            }
215:
216:            public void setNotifyMainListeners(boolean notify) {
217:                super .setNotifyMainListeners(notify);
218:                namespaces.setNotifyMainListeners(notify);
219:            }
220:
221:            public void setReadOnly(boolean ro) {
222:                super .setReadOnly(ro);
223:                namespaces.setReadOnly(ro);
224:            }
225:
226:            public Object clone() {
227:                //      System.out.println("Cloning package "+this.hashCode()+", listeners="+listeners);
228:                Package d = (Package) super .clone();
229:                //      System.out.println("cloned pkg="+d.hashCode()+", list="+listeners);
230:                d.namespaces = (Namespaces) this .namespaces.clone();
231:                d.namespaces.setParent(d);
232:                d.extPkgRefsToIds = new SequencedHashMap(extPkgRefsToIds);
233:                d.isTransient = isTransient;
234:                d.clearCaches();
235:                if (d.isReadOnly)
236:                    d.initCaches();
237:                return d;
238:            }
239:
240:            public boolean equals(Object e) {
241:                boolean equals = super .equals(e);
242:                if (equals) {
243:                    Package el = (Package) e;
244:                    equals = (this .namespaces.equals(el.namespaces) && this .internalVersion
245:                            .equals(el.internalVersion));
246:                    //         System.out.println("Package's ns or int ver equal - "+equals);
247:                }
248:                return equals;
249:            }
250:
251:            protected boolean isMainElement() {
252:                return true;
253:            }
254:
255:            protected void notifyMainListeners(XMLElementChangeInfo info) {
256:                if (parent == null)
257:                    return;
258:                super .notifyMainListeners(info);
259:            }
260:
261:            //   public void finalize () throws Throwable {
262:            //      super.finalize();
263:            //      destroyedPKGs.add(new Integer(pno));
264:            //      System.err.println("PKG "+(pno)+" destroyed, hc="+hashCode());
265:            //   }
266:
267:            public static void dbg() {
268:                System.gc();
269:                //      System.err.println("Created pkgs: "+createdPKGs);
270:                //      System.err.println("Destroyed pkgs: "+destroyedPKGs);
271:                //      ArrayList inMem=new ArrayList(createdPKGs);
272:                //      inMem.removeAll(destroyedPKGs);
273:                //      System.err.println("Packages in memory: "+inMem);
274:            }
275:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.