Source Code Cross Referenced for TCMode.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » common » catalog » transformation » 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 » pegasus 2.1.0 » org.griphyn.common.catalog.transformation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found at $PEGASUS_HOME/GTPL or
004:         * http://www.globus.org/toolkit/download/license.html.
005:         * This notice must appear in redistributions of this file
006:         * with or without modification.
007:         *
008:         * Redistributions of this Software, with or without modification, must reproduce
009:         * the GTPL in:
010:         * (1) the Software, or
011:         * (2) the Documentation or
012:         * some other similar material which is provided with the Software (if any).
013:         *
014:         * Copyright 1999-2004
015:         * University of Chicago and The University of Southern California.
016:         * All rights reserved.
017:         */package org.griphyn.common.catalog.transformation;
018:
019:        import org.griphyn.cPlanner.common.LogManager;
020:        import org.griphyn.cPlanner.common.PegasusProperties;
021:        import org.griphyn.common.catalog.TransformationCatalog;
022:        import org.griphyn.common.util.DynamicLoader;
023:
024:        /**
025:         *  This class defines all the constants
026:         *     referring to the various interfaces
027:         *     to the transformation catalog, and
028:         *     used by the Concrete Planner.
029:         *
030:         * @author Gaurang Mehta
031:         * @version $Revision: 50 $
032:         */
033:        public class TCMode {
034:
035:            /**
036:             * Constants for backward compatibility.
037:             */
038:
039:            public static final String SINGLE_READ = "single";
040:
041:            public static final String MULTIPLE_READ = "multiple";
042:
043:            public static final String OLDFILE_TC_CLASS = "OldFile";
044:
045:            public static final String DEFAULT_TC_CLASS = "File";
046:            /**
047:             * Default PACKAGE PATH for the TC implementing classes
048:             */
049:            public static final String PACKAGE_NAME = "org.griphyn.common.catalog.transformation.";
050:
051:            private static LogManager mLogger = LogManager.getInstance();
052:
053:            //add your constants here.
054:
055:            /**
056:             * This method just checks and gives the correct classname if a user provides the classname in a different case.
057:             * @param tcmode String
058:             * @return String
059:             */
060:            private static String getImplementingClass(String tcmode) {
061:
062:                if (tcmode.trim().equalsIgnoreCase(SINGLE_READ)
063:                        || tcmode.trim().equalsIgnoreCase(MULTIPLE_READ)) {
064:                    return OLDFILE_TC_CLASS;
065:                } else {
066:                    //no match to any predefined constant
067:                    //assume that the value of readMode is the
068:                    //name of the implementing class
069:                    return tcmode;
070:                }
071:            }
072:
073:            /**
074:             * The overloaded method which is to be used internally in Pegasus.
075:             *
076:             * @return TCMechanism
077:             */
078:            public static TransformationCatalog loadInstance() {
079:                PegasusProperties mProps = PegasusProperties.getInstance();
080:                TransformationCatalog tc = null;
081:                String tcClass = getImplementingClass(mProps.getTCMode());
082:
083:                //if (tcClass.equals(FILE_TC_CLASS)) {
084:                //  String[] args = {mProps.getTCPath()};
085:                // return loadInstance(tcClass, args);
086:                // } else {
087:                String[] args = new String[0];
088:                tc = loadInstance(tcClass, args);
089:                if (tc == null) {
090:                    mLogger.log("Unable to load TC",
091:                            LogManager.FATAL_MESSAGE_LEVEL);
092:                    System.exit(1);
093:                }
094:                return tc;
095:                //  }
096:            }
097:
098:            /**
099:             * Loads the appropriate TC implementing Class with the given arguments.
100:             * @param tcClass String
101:             * @param args String[]
102:             * @return TCMechanism
103:             */
104:            public static TransformationCatalog loadInstance(String tcClass,
105:                    Object[] args) {
106:
107:                TransformationCatalog tc = null;
108:                String methodName = "getInstance";
109:                //get the complete name including
110:                //the package if the package name not
111:                //specified
112:                if (tcClass.indexOf(".") == -1) {
113:                    tcClass = PACKAGE_NAME + tcClass;
114:                }
115:
116:                DynamicLoader d = new DynamicLoader(tcClass);
117:
118:                try {
119:                    tc = (TransformationCatalog) d.static_method(methodName,
120:                            args);
121:
122:                    //This identifies the signature for
123:                    //the method
124:
125:                } catch (Exception e) {
126:                    mLogger.log(d.convertException(e),
127:                            LogManager.FATAL_MESSAGE_LEVEL);
128:                    System.exit(1);
129:                }
130:                return tc;
131:
132:            }
133:
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.