Source Code Cross Referenced for Text.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » poolinfo » 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.cPlanner.poolinfo 
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.cPlanner.poolinfo;
018:
019:        import org.griphyn.cPlanner.classes.PoolConfig;
020:        import org.griphyn.cPlanner.classes.PoolConfigException;
021:        import org.griphyn.cPlanner.classes.PoolConfigParser2;
022:
023:        import org.griphyn.cPlanner.common.LogManager;
024:
025:        import java.io.FileReader;
026:        import java.io.IOException;
027:
028:        /**
029:         * It gets the information about a pool by reading the multiline site
030:         * catalog that is in a multiline format.
031:         *
032:         * @author Gaurang Mehta gmehta@isi.edu
033:         * @author Karan Vahi vahi@isi.edu
034:         * @version $Revision: 50 $
035:         */
036:        public class Text extends Abstract {
037:
038:            /**
039:             * The internal singleton handle.
040:             */
041:            private static Text mPoolHandle = null;
042:
043:            /**
044:             * The private constructor that is called only once, when the Singleton is
045:             * invoked for the first time.
046:             *
047:             * @param poolProvider  the path to the file that contains the pool
048:             *                      information in the multiline text format.
049:             */
050:            private Text(String poolProvider) {
051:                loadSingletonObjects();
052:                if (poolProvider == null) {
053:                    throw new RuntimeException(
054:                            " Wrong Call to the Singleton invocation of Site Catalog");
055:                }
056:                this .mPoolProvider = poolProvider;
057:                mPoolConfig = new PoolConfig();
058:                try {
059:                    String msg = "Reading " + this .mPoolProvider;
060:                    mLogger.log(msg, LogManager.DEBUG_MESSAGE_LEVEL);
061:                    PoolConfigParser2 p = new PoolConfigParser2(new FileReader(
062:                            this .mPoolProvider));
063:                    mPoolConfig = p.parse();
064:                    mLogger.logCompletion(msg, LogManager.DEBUG_MESSAGE_LEVEL);
065:                } catch (PoolConfigException pce) {
066:                    mLogger.log(this .mPoolProvider + ": 1" + pce.getMessage(),
067:                            LogManager.ERROR_MESSAGE_LEVEL);
068:                } catch (IOException ioe) {
069:                    mLogger.log(this .mPoolProvider + ": 2" + ioe.getMessage(),
070:                            LogManager.ERROR_MESSAGE_LEVEL);
071:                } catch (Exception e) {
072:                    mLogger.log(this .mPoolProvider + ": 3" + e.getMessage(),
073:                            LogManager.ERROR_MESSAGE_LEVEL);
074:                }
075:                mLogger.log("SC Mode being used is " + this .getPoolMode(),
076:                        LogManager.CONFIG_MESSAGE_LEVEL);
077:                mLogger.log("SC File being used is " + this .mPoolProvider,
078:                        LogManager.CONFIG_MESSAGE_LEVEL);
079:                mLogger.log(mPoolConfig.getSites().size()
080:                        + " sites loaded in memory",
081:                        LogManager.DEBUG_MESSAGE_LEVEL);
082:
083:            }
084:
085:            /**
086:             * The private constructor that is called to return a non singleton instance
087:             * of the class.
088:             *
089:             * @param poolProvider  the path to the file that contains the pool
090:             *                      information in the xml format.
091:             * @param propFileName  the name of the properties file that needs to be
092:             *                      picked up from PEGASUS_HOME/etc directory.If it is null,
093:             *                      then the default properties file should be picked up.
094:             *
095:             */
096:            private Text(String poolProvider, String propFileName) {
097:                loadNonSingletonObjects(propFileName);
098:                this .mPoolProvider = poolProvider;
099:                mPoolConfig = new PoolConfig();
100:                try {
101:                    String msg = "Reading " + this .mPoolProvider;
102:                    mLogger.log(msg, LogManager.DEBUG_MESSAGE_LEVEL);
103:                    PoolConfigParser2 p = new PoolConfigParser2(new FileReader(
104:                            this .mPoolProvider));
105:                    mPoolConfig = p.parse();
106:                    mLogger.logCompletion(msg, LogManager.DEBUG_MESSAGE_LEVEL);
107:                } catch (PoolConfigException pce) {
108:                    mLogger.log(this .mPoolProvider + ": 1" + pce.getMessage(),
109:                            LogManager.ERROR_MESSAGE_LEVEL);
110:                } catch (IOException ioe) {
111:                    mLogger.log(this .mPoolProvider + ": 2" + ioe.getMessage(),
112:                            LogManager.ERROR_MESSAGE_LEVEL);
113:                } catch (Exception e) {
114:                    mLogger.log(this .mPoolProvider + ": 3" + e.getMessage(),
115:                            LogManager.ERROR_MESSAGE_LEVEL);
116:                }
117:                mLogger.log("SC Mode being used is " + this .getPoolMode(),
118:                        LogManager.CONFIG_MESSAGE_LEVEL);
119:                mLogger.log("SC File being used is " + this .mPoolProvider,
120:                        LogManager.CONFIG_MESSAGE_LEVEL);
121:                mLogger.log(mPoolConfig.getSites().size()
122:                        + " sites loaded in memory",
123:                        LogManager.DEBUG_MESSAGE_LEVEL);
124:
125:            }
126:
127:            /**
128:             * Returns a textual description about the pool mode that is
129:             * implemented by this class. It is purely informative.
130:             *
131:             * @return String corresponding to the description.
132:             */
133:            public String getPoolMode() {
134:                String st = "Multiple Line Site Catalog";
135:                return st;
136:            }
137:
138:            /**
139:             * The method returns a singleton instance of the derived InfoProvider class.
140:             *
141:             * @param poolProvider  the path to the file containing the pool information.
142:             * @param propFileName  the name of the properties file that needs to be
143:             *                      picked up from PEGASUS_HOME/etc directory. In the singleton
144:             *                      case only the default properties file is picked up.
145:             *
146:             * @return  a singleton instance of this class.
147:             */
148:            public static PoolInfoProvider singletonInstance(
149:                    String poolProvider, String propFileName) {
150:
151:                if (mPoolHandle == null) {
152:                    mPoolHandle = new Text(poolProvider);
153:                }
154:                return mPoolHandle;
155:            }
156:
157:            /**
158:             * The method that returns a Non Singleton instance of the dervived
159:             * InfoProvider class. This method if invoked should also ensure that all
160:             * other internal Pegasus objects like PegasusProperties are invoked in a non
161:             * singleton manner.
162:             *
163:             * @param poolProvider  the path to the file containing the pool information.
164:             * @param propFileName  the name of the properties file that needs to be
165:             *                      picked up from PEGASUS_HOME/etc directory. If it is null,
166:             *                      then the default file should be picked up.
167:             *
168:             * @return the non singleton instance of the pool provider.
169:             *
170:             */
171:            public static PoolInfoProvider nonSingletonInstance(
172:                    String poolProvider, String propFileName) {
173:                mPoolHandle = new Text(poolProvider, propFileName);
174:                return mPoolHandle;
175:            }
176:
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.