Source Code Cross Referenced for Engine4Installer.java in  » ESB » open-esb » com » sun » jbi » ui » ant » test » engine4 » boot » 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.ui.ant.test.engine4.boot 
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:         * @(#)Engine4Installer.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.jbi.ui.ant.test.engine4.boot;
030:
031:        import javax.jbi.component.Bootstrap;
032:        import javax.jbi.component.InstallationContext;
033:        import java.util.logging.Logger;
034:        import javax.jbi.JBIException;
035:        import javax.jbi.management.MBeanNames;
036:        import javax.management.MBeanServer;
037:        import javax.management.ObjectName;
038:        import javax.management.StandardMBean;
039:
040:        /**
041:         * Class to install the  engine.
042:         *
043:         * @author Sun Microsystems, Inc.
044:         */
045:        public class Engine4Installer implements  Bootstrap {
046:
047:            /**
048:             * Internal handle to the logger instance
049:             */
050:            private Logger mLogger;
051:            /** fix it */
052:            private ObjectName mConfigMBeanName;
053:            /** fix it */
054:            private ConfigMBean mConfigMBean;
055:            /**
056:             * fix it
057:             */
058:            private InstallationContext mContext;
059:
060:            /**
061:             * Creates a new instance of StockQuoteEngineBootstrap
062:             */
063:            public Engine4Installer() {
064:                mLogger = Logger
065:                        .getLogger("com.sun.jbi.ui.ant.test.engine4.boot");
066:                mLogger.info("Engine4Installer Constructor called");
067:            }
068:
069:            /**
070:             * Cleans up any resources allocated by the bootstrap implementation,
071:             * including deregistration of the extension MBean, if applicable.
072:             * This method will be called after the onInstall() or onUninstall() method
073:             * is called, whether it succeeds or fails.
074:             * @throws javax.jbi.JBIException when cleanup processing fails to complete
075:             * successfully.
076:             */
077:            public void cleanUp() throws javax.jbi.JBIException {
078:                deregisterConfigMBean();
079:            }
080:
081:            /**
082:             * Called to initialize the BC bootstrap.
083:             * @param installContext is the context containing information
084:             * from the install command and from the BC jar file.
085:             * @throws javax.jbi.JBIException when there is an error requiring that
086:             * the installation be terminated.
087:             */
088:            public void init(InstallationContext installContext)
089:                    throws javax.jbi.JBIException {
090:                mLogger.info("Engine4Installer INIT Called");
091:                this .mContext = installContext;
092:                // throw JBIException("Test Error on Engine4Installer init");
093:                registerConfigMBean();
094:                return;
095:            }
096:
097:            /**
098:             * Get the JMX ObjectName for the optional installation configuration MBean
099:             * for this BC. If there is none, the value is null.
100:             * @return ObjectName the JMX object name of the installation configuration
101:             * MBean or null if there is no MBean.
102:             */
103:            public javax.management.ObjectName getExtensionMBeanName() {
104:                mLogger.info("Engine4Installer getExtensionMBeanName Called");
105:                return this .mConfigMBeanName;
106:            }
107:
108:            /**
109:             * Called at the beginning of installation of BPEL Engine. For this
110:             * Engine, all the required installation tasks have been taken care
111:             * by the InstallationService.
112:             * @throws javax.jbi.JBIException when there is an error requiring that
113:             * the installation be terminated.
114:             */
115:            public void onInstall() throws javax.jbi.JBIException {
116:                mLogger.info("Engine4Installer onInstall Called.");
117:
118:            }
119:
120:            /**
121:             * Called at the beginning of uninstallation of FileEngine . For this
122:             * file engine, all the required uninstallation tasks have been taken care
123:             * of by the InstallationService
124:             * @throws javax.jbi.JBIException when there is an error requiring that
125:             * the uninstallation be terminated.
126:             */
127:            public void onUninstall() throws javax.jbi.JBIException {
128:                mLogger.info("*** Engine4Installer onUninstall Called");
129:                // throw new JBIException("Test Error Engine4Installer on UnInstall");
130:            }
131:
132:            /**
133:             * fix it
134:             * @throws JBIException fix it
135:             */
136:            public void createConfigMBean() throws JBIException {
137:                try {
138:                    if (this .mConfigMBean == null) {
139:                        this .mConfigMBean = new ConfigMBeanImpl();
140:                    }
141:
142:                    if (this .mConfigMBeanName == null) {
143:                        MBeanNames mbnHndl = this .mContext.getContext()
144:                                .getMBeanNames();
145:
146:                        this .mConfigMBeanName = mbnHndl
147:                                .createCustomComponentMBeanName("InstallerConfig");
148:                    }
149:                } catch (Exception e) {
150:                    e.printStackTrace();
151:                    throw new JBIException(
152:                            "Ant Test Engine4 Installer ConfigurationMBean Creation Failed",
153:                            e);
154:                }
155:            }
156:
157:            /**
158:             * fix it
159:             * @throws JBIException fix it
160:             */
161:            public void registerConfigMBean() throws JBIException {
162:                createConfigMBean(); // make sure it is created.
163:
164:                try {
165:                    MBeanServer mbServer = this .mContext.getContext()
166:                            .getMBeanServer();
167:                    StandardMBean configBean = new StandardMBean(
168:                            this .mConfigMBean, ConfigMBean.class);
169:                    mbServer.registerMBean(configBean, this .mConfigMBeanName);
170:                } catch (Exception e) {
171:                    e.printStackTrace();
172:                    throw new JBIException(
173:                            "Ant Test Engine4 Installer Config MBean Registration Failed",
174:                            e);
175:                }
176:
177:            }
178:
179:            /**
180:             * fix it
181:             * @throws JBIException fix it
182:             */
183:            public void deregisterConfigMBean() throws JBIException {
184:                if (this .mConfigMBeanName == null) {
185:                    this .mLogger
186:                            .warning("trying to unregister null Installer Config MBean in Ant Test Engine 2 inst");
187:                }
188:
189:                try {
190:                    MBeanServer mbServer = this .mContext.getContext()
191:                            .getMBeanServer();
192:                    mbServer.unregisterMBean(this .mConfigMBeanName);
193:                    this .mConfigMBeanName = null;
194:                    this .mConfigMBean = null;
195:                } catch (Exception e) {
196:                    e.printStackTrace();
197:                    throw new JBIException("Ant Test Engine4"
198:                            + "Installer Config MBean Deregistration Failed", e);
199:                }
200:
201:            }
202:
203:            public interface ConfigMBean {
204:                public void setUser(String user);
205:
206:                public String getUser();
207:
208:                public void setPort(String port);
209:
210:                public String getPort();
211:
212:                public void setIntValue(int intValue);
213:
214:                public int getIntValue();
215:
216:                public void setIntegerValue(Integer integerValue);
217:
218:                public Integer getIntegerValue();
219:            }
220:
221:            public class ConfigMBeanImpl implements  ConfigMBean {
222:                private String mUser;
223:                private String mPort;
224:                private int mIntValue;
225:                private Integer mIntegerValue;
226:
227:                public String getUser() {
228:                    return mUser;
229:                }
230:
231:                public void setUser(String user) {
232:                    System.out
233:                            .println("Setting the ConfigMBean attribute \"User\" : "
234:                                    + user);
235:                    mUser = user;
236:                }
237:
238:                public String getPort() {
239:                    return mPort;
240:                }
241:
242:                public void setPort(String port) {
243:                    mLogger
244:                            .info("Setting the ConfigMBean attribute \"Port\" : "
245:                                    + port);
246:                    mPort = port;
247:                }
248:
249:                public int getIntValue() {
250:                    return this .mIntValue;
251:                }
252:
253:                public void setIntValue(int intValue) {
254:                    mLogger
255:                            .info("Setting the ConfigMBean attribute \"IntValue\" : "
256:                                    + intValue);
257:                    this .mIntValue = intValue;
258:                }
259:
260:                public Integer getIntegerValue() {
261:                    return this .mIntegerValue;
262:                }
263:
264:                public void setIntegerValue(Integer integerValue) {
265:                    mLogger
266:                            .info("Setting the ConfigMBean attribute \"IntegerValue\" : "
267:                                    + integerValue);
268:                    this.mIntegerValue = integerValue;
269:                }
270:
271:            }
272:        }
w___w__w___.j__a__v__a___2_s__.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.