Source Code Cross Referenced for BindingBootstrapUpgrade.java in  » ESB » open-esb » com » sun » jbi » framework » 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 » ESB » open esb » com.sun.jbi.framework 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)BindingBootstrapUpgrade.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.jbi.framework;
030:
031:        import java.io.File;
032:        import java.util.List;
033:
034:        /**
035:         * This is an implementation of the bootstrap class for a Binding Component
036:         * that is purely for unit testing. It does nothing but log messages when
037:         * its methods are called.
038:         *
039:         * @author Sun Microsystems, Inc.
040:         */
041:        public class BindingBootstrapUpgrade extends BindingBootstrap {
042:            /**
043:             * Perform an upgrade of the component.
044:             * @param workspaceRoot the workspace root for the new version of the
045:             * component that will replace the currently installed version. This is
046:             * populated with the contents of the original workspace root and the
047:             * component must update it to match the new version of the component.
048:             * @param serviceUnitRoots a list of directory paths to all of the Service
049:             * Units currently deployed to the component. The component must update all
050:             * of these to match the new version of the component.
051:             * @throws javax.jbi.JBIException when there is an error requiring that the
052:             * upgrade be terminated.
053:             */
054:            public void upgrade(String workspaceRoot,
055:                    List<String> serviceUnitRoots)
056:                    throws javax.jbi.JBIException {
057:                String name = System
058:                        .getProperty(Constants.PROPERTY_COMPONENT_NAME);
059:                mLog.info(name + " upgrade started");
060:                if (name.equals(Constants.BC_NAME_BAD_BOOTSTRAP_UPGRADE)) {
061:                    throw new javax.jbi.JBIException(
062:                            "unable to complete upgrade");
063:                }
064:
065:                // Write a file in the workspace root so that the junit test can
066:                // verify that the upgrade succeeded.
067:
068:                writeFile(workspaceRoot, Constants.UPGRADED_FILE_NAME);
069:                mLog.info("workspace root " + workspaceRoot + " upgraded");
070:
071:                // Write a file in each SU root so that the junit test can verify
072:                // that the upgrade succeeded.
073:
074:                for (String suRoot : serviceUnitRoots) {
075:                    writeFile(suRoot, Constants.UPGRADED_FILE_NAME);
076:                    mLog.info("SU root " + suRoot + " upgraded");
077:                }
078:
079:                mLog.info(name + " upgrade complete");
080:            }
081:
082:            /**
083:             * Utility method to write a file, overwriting it if it already exists.
084:             *
085:             * @param path the full path to the directory where the file is to be
086:             * written.
087:             * @param name the name of the file to be created.
088:             */
089:            private void writeFile(String path, String name) {
090:                File f = new File(path + "/" + name);
091:                if (f.exists()) {
092:                    f.delete();
093:                }
094:                try {
095:                    if (!f.createNewFile()) {
096:                        mLog.warning("Unable to create file "
097:                                + f.getAbsolutePath());
098:                    }
099:                } catch (java.io.IOException ioEx) {
100:                    mLog.warning("Unable to create file " + f.getAbsolutePath()
101:                            + " due to exception: " + ioEx.getMessage());
102:                }
103:            }
104:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.