Source Code Cross Referenced for DeployBuilder.java in  » J2EE » enhydra-IDE-plugin » org » enhydra » kelp » common » deployer » 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 » J2EE » enhydra IDE plugin » org.enhydra.kelp.common.deployer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         *
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         *
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         *
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         *
019:         * Contributor(s):
020:         * Paul Mahar
021:         *
022:         */
023:        package org.enhydra.kelp.common.deployer;
024:
025:        // Toolbox imports
026:        import org.enhydra.tool.common.PathHandle;
027:        import org.enhydra.tool.common.event.ProgressListener;
028:
029:        // Kelp imports
030:        import org.enhydra.kelp.common.AbstractEchoBuilder;
031:        import org.enhydra.kelp.common.event.WriteEvent;
032:        import org.enhydra.kelp.common.event.WriteListener;
033:        import org.enhydra.kelp.common.node.OtterProject;
034:        import org.enhydra.kelp.common.node.OtterNode;
035:
036:        // Standard imports
037:        import java.awt.Window;
038:        import java.util.ResourceBundle;
039:        import javax.swing.JOptionPane;
040:
041:        //
042:        public class DeployBuilder extends AbstractEchoBuilder {
043:            static ResourceBundle res = ResourceBundle
044:                    .getBundle("org.enhydra.kelp.common.Res"); // nores
045:
046:            //
047:            private OtterNode[] inputNodes = null;
048:            private Window owner = null;
049:            private boolean doneDialog = false;
050:
051:            public static void preBuild(Object source, OtterProject project,
052:                    WriteListener listener) {
053:                PathHandle path = null;
054:                WriteEvent event = null;
055:
056:                path = PathHandle.createPathHandle(project.getDeployRootPath());
057:                if (!path.isDirectory()) {
058:                    path.getFile().mkdirs();
059:                    event = new WriteEvent(source, WriteEvent.OUTPUT,
060:                            "Created directory: " + path.getPath());
061:                    listener.onWrite(event);
062:                }
063:            }
064:
065:            public DeployBuilder() {
066:                super (null);
067:            }
068:
069:            public DeployBuilder(WriteListener listener) {
070:                super (listener);
071:            }
072:
073:            public DeployBuilder(WriteListener listener, boolean buffer) {
074:                super (listener, buffer);
075:            }
076:
077:            public void setInputNodes(OtterNode[] n) {
078:                inputNodes = n;
079:            }
080:
081:            public OtterNode[] getInputNodes() {
082:                return inputNodes;
083:            }
084:
085:            public void buildInput() {
086:                InputBuilder builder = null;
087:
088:                builder = new InputBuilder(getWriteListener());
089:                if (getInputNodes() != null) {
090:                    builder.setNodes(getInputNodes());
091:                }
092:                invoke(builder);
093:            }
094:
095:            public void buildContent() {
096:                ContentBuilder builder = null;
097:
098:                builder = new ContentBuilder(getWriteListener());
099:                invoke(builder);
100:            }
101:
102:            public void buildArchives() {
103:                ArchiveBuilder builder = null;
104:
105:                builder = new ArchiveBuilder(getWriteListener());
106:                invoke(builder);
107:            }
108:
109:            public void buildRun() {
110:                RunBuilder builder = null;
111:
112:                builder = new RunBuilder(getWriteListener());
113:                invoke(builder);
114:            }
115:
116:            /**
117:             * Make content, policy file, process templates, configure project for
118:             * running enhydra and create archive.
119:             */
120:            public void buildImpl() {
121:                Exception ex = null;
122:
123:                try {
124:                    echo(new String());
125:                    refreshProgress(5, res.getString("Deployment_starting"));
126:                    echo(res.getString("_Deployment_starting"));
127:                    if (isFresh()) {
128:                        refreshProgress(5, res.getString("Processing_input"));
129:                        echo(res.getString("Processing_input"));
130:                        buildInput();
131:                    }
132:                    if (isFresh()) {
133:                        refreshProgress(30, res.getString("Deploying_content"));
134:                        echo(res.getString("Deploying_content"));
135:                        buildContent();
136:                    }
137:                    if (isFresh()) {
138:                        refreshProgress(60, "Creating archives");
139:                        echo("Creating archives");
140:                        buildArchives();
141:                    }
142:                    if (isFresh()) {
143:                        if (getProject().isDeployRun()) {
144:                            refreshProgress(90, "Configuring project run");
145:                            echo("Configuring project run");
146:                            buildRun();
147:                        } else {
148:                            refreshProgress(90, "");
149:                        }
150:                    }
151:                    echo("--- Kelp Deployer finished --- ");
152:                } catch (Exception e) {
153:                    ex = e;
154:                    echo(ex);
155:                }
156:                refreshProgress(100, new String());
157:                if (isDoneDialog()) {
158:                    StringBuffer buf = new StringBuffer();
159:
160:                    if (ex == null) {
161:                        buf.append("Deployment Complete");
162:                    } else {
163:                        buf.append("Exception during deployment:\n");
164:                        if (ex.getMessage() == null) {
165:                            buf.append(ex.toString());
166:                        } else {
167:                            buf.append(ex.getMessage());
168:                        }
169:                        buf.append("\n");
170:                        buf.append("See messages for more information.\n");
171:                    }
172:                    JOptionPane.showMessageDialog(getOwner(), buf.toString());
173:                }
174:            }
175:
176:            //
177:
178:            protected void setOwner(Window w) {
179:                owner = w;
180:            }
181:
182:            protected Window getOwner() {
183:                return owner;
184:            }
185:
186:            protected boolean isDoneDialog() {
187:                boolean canDone = doneDialog;
188:
189:                if (getOwner() == null) {
190:                    canDone = false;
191:                }
192:                return canDone;
193:            }
194:
195:            protected void setDoneDialog(boolean d) {
196:                doneDialog = d;
197:            }
198:
199:            //
200:            //
201:
202:            private void invoke(AbstractEchoBuilder builder) {
203:                ProgressListener[] pl = getProgressListeners();
204:
205:                if (pl != null) {
206:                    for (int i = 0; i < pl.length; i++) {
207:                        builder.addProgressListener(pl[i]);
208:                    }
209:                }
210:                builder.setProject(getProject());
211:                builder.setEcho(isEcho());
212:                builder.buildInCurrentThread();
213:                if (pl != null) {
214:                    for (int i = 0; i < pl.length; i++) {
215:                        builder.removeProgressListener(pl[i]);
216:                    }
217:                }
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.