Source Code Cross Referenced for AbstractRefiner.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » transfer » 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.transfer 
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 in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:        package org.griphyn.cPlanner.transfer;
016:
017:        import org.griphyn.cPlanner.transfer.Refiner;
018:
019:        import org.griphyn.cPlanner.classes.ADag;
020:        import org.griphyn.cPlanner.classes.SubInfo;
021:        import org.griphyn.cPlanner.classes.PlannerOptions;
022:
023:        import org.griphyn.cPlanner.common.PegasusProperties;
024:        import org.griphyn.cPlanner.common.LogManager;
025:        import org.griphyn.cPlanner.common.TPT;
026:
027:        import org.griphyn.cPlanner.provenance.pasoa.XMLProducer;
028:        import org.griphyn.cPlanner.provenance.pasoa.producer.XMLProducerFactory;
029:
030:        /**
031:         * An abstract implementation that implements some of the common functions
032:         * in the Refiner Interface and member variables that are required by all the
033:         * refiners.
034:         *
035:         * @author Karan Vahi
036:         * @version $Revision: 244 $
037:         */
038:
039:        public abstract class AbstractRefiner implements  Refiner {
040:
041:            /**
042:             * The stage-in transfer implementation that the refiner requires.
043:             */
044:            protected Implementation mTXStageInImplementation;
045:
046:            /**
047:             * The inter transfer implementation that the refiner requires.
048:             */
049:            protected Implementation mTXInterImplementation;
050:
051:            /**
052:             * The stage-out transfer implementation that the refiner requires.
053:             */
054:            protected Implementation mTXStageOutImplementation;
055:
056:            /**
057:             * The ADag object associated with the Dag. This is the object to
058:             * which the transfer nodes are added. This object is initialised in the
059:             * TransferEngine.
060:             */
061:            protected ADag mDAG;
062:
063:            /**
064:             * The handle to the properties object holding the properties relevant to
065:             * Pegasus.
066:             */
067:            protected PegasusProperties mProps;
068:
069:            /**
070:             * The options passed to the planner at runtime.
071:             */
072:            protected PlannerOptions mPOptions;
073:
074:            /**
075:             * The logging object which is used to log all the messages.
076:             *
077:             * @see org.griphyn.cPlanner.common.LogManager
078:             */
079:            protected LogManager mLogger;
080:
081:            /**
082:             * The handle to the Third Party State machinery.
083:             */
084:            protected TPT mTPT;
085:
086:            /**
087:             * The XML Producer object that records the actions.
088:             */
089:            protected XMLProducer mXMLStore;
090:
091:            /**
092:             * The overloaded constructor.
093:             *
094:             * @param dag        the workflow to which transfer nodes need to be added.
095:             * @param properties the <code>PegasusProperties</code> object containing all
096:             *                   the properties required by Pegasus.
097:             * @param options    the options passed to the planner.
098:             */
099:            public AbstractRefiner(ADag dag, PegasusProperties properties,
100:                    PlannerOptions options) {
101:                mLogger = LogManager.getInstance();
102:                mDAG = dag;
103:                mProps = properties;
104:                mPOptions = options;
105:                mTPT = new TPT(properties);
106:                mTPT.buildState();
107:                mXMLStore = XMLProducerFactory.loadXMLProducer(properties);
108:            }
109:
110:            /**
111:             * Returns a reference to the workflow that is being refined by the refiner.
112:             *
113:             *
114:             * @return ADAG object.
115:             */
116:            public ADag getWorkflow() {
117:                return this .mDAG;
118:            }
119:
120:            /**
121:             * Returns a reference to the XMLProducer, that generates the XML fragment
122:             * capturing the actions of the refiner. This is used for provenace
123:             * purposes.
124:             *
125:             * @return XMLProducer
126:             */
127:            public XMLProducer getXMLProducer() {
128:                return this .mXMLStore;
129:            }
130:
131:            /**
132:             * Returns whether a Site is third party enabled or not.
133:             *
134:             * @param site  the name of the site.
135:             * @param type  the type of transfer job for which the URL is being constructed.
136:             *              Should be one of the following:
137:             *                              stage-in
138:             *                              stage-out
139:             *                              inter-pool transfer
140:             *
141:             * @return true pool is third party enabled
142:             *         false pool is not third party enabled.
143:             *
144:             * @see SubInfo#STAGE_IN_JOB
145:             * @see SubInfo#INTER_POOL_JOB
146:             * @see SubInfo#STAGE_OUT_JOB
147:             *
148:             * @throws IllegalArgumentException
149:             */
150:            public boolean isSiteThirdParty(String site, int type) {
151:                Implementation implementation;
152:                //the value from the properties file
153:                //later on maybe picked up as profiles
154:                boolean useTPT = false;
155:                if (type == SubInfo.STAGE_IN_JOB) {
156:                    implementation = mTXStageInImplementation;
157:                    useTPT = mTPT.stageInThirdParty(site);
158:                } else if (type == SubInfo.INTER_POOL_JOB) {
159:                    implementation = mTXInterImplementation;
160:                    useTPT = mTPT.interThirdParty(site);
161:                } else if (type == SubInfo.STAGE_OUT_JOB) {
162:                    implementation = mTXStageOutImplementation;
163:                    useTPT = mTPT.stageOutThirdParty(site);
164:                } else {
165:                    throw new java.lang.IllegalArgumentException(
166:                            "Invalid implementation type passed " + type);
167:                }
168:
169:                return implementation.useThirdPartyTransferAlways() || useTPT;
170:            }
171:
172:            /**
173:             * Returns whether the third party transfers for a particular site are to
174:             * be run on the remote site or the submit host.
175:             *
176:             * @param site  the name of the site.
177:             * @param type  the type of transfer job for which the URL is being constructed.
178:             *              Should be one of the following:
179:             *                              stage-in
180:             *                              stage-out
181:             *                              inter-pool transfer
182:             *
183:             * @return true if the transfers are to be run on remote site, else false.
184:             *
185:             * @see SubInfo#STAGE_IN_JOB
186:             * @see SubInfo#INTER_POOL_JOB
187:             * @see SubInfo#STAGE_OUT_JOB
188:             */
189:            public boolean runTPTOnRemoteSite(String site, int type) {
190:                Implementation implementation;
191:                //the value from the properties file
192:                //later on maybe picked up as profiles
193:                boolean remoteTPT = false;
194:                if (type == SubInfo.STAGE_IN_JOB) {
195:                    implementation = mTXStageInImplementation;
196:                    remoteTPT = mTPT.stageInThirdPartyRemote(site);
197:                } else if (type == SubInfo.INTER_POOL_JOB) {
198:                    implementation = mTXInterImplementation;
199:                    remoteTPT = mTPT.interThirdPartyRemote(site);
200:                } else if (type == SubInfo.STAGE_OUT_JOB) {
201:                    implementation = mTXStageOutImplementation;
202:                    remoteTPT = mTPT.stageOutThirdPartyRemote(site);
203:                } else {
204:                    throw new java.lang.IllegalArgumentException(
205:                            "Invalid implementation type passed " + type);
206:                }
207:
208:                return remoteTPT;
209:
210:            }
211:
212:            /**
213:             * Logs configuration messages regarding the type of implementations loaded
214:             * for various type of transfer node creations.
215:             */
216:            protected void logConfigMessages() {
217:                //log a message
218:                mLogger.log("Transfer Implementation loaded for Stage-In   ["
219:                        + mTXStageInImplementation.getDescription() + "]",
220:                        LogManager.CONFIG_MESSAGE_LEVEL);
221:                mLogger.log("Transfer Implementation loaded for Inter Site ["
222:                        + mTXInterImplementation.getDescription() + "]",
223:                        LogManager.CONFIG_MESSAGE_LEVEL);
224:                mLogger.log("Transfer Implementation loaded for Stage-Out  ["
225:                        + mTXStageOutImplementation.getDescription() + "]",
226:                        LogManager.CONFIG_MESSAGE_LEVEL);
227:
228:            }
229:
230:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.