Source Code Cross Referenced for DeployBinding.java in  » ESB » open-esb » deploytest » 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 » deploytest 
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:         * @(#)DeployBinding.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package deploytest;
030:
031:        import java.util.logging.Logger;
032:
033:        import javax.jbi.component.Bootstrap;
034:        import javax.jbi.component.Component;
035:        import javax.jbi.component.ComponentContext;
036:        import javax.jbi.component.ComponentLifeCycle;
037:        import javax.jbi.component.ServiceUnitManager;
038:
039:        /**
040:         * Dummy binding component used to test deployment.
041:         *
042:         * @author Sun Microsystems, Inc.
043:         */
044:        public class DeployBinding implements  Component, ComponentLifeCycle,
045:                ServiceUnitManager, Bootstrap {
046:            /**
047:             * Local copy of the component name.
048:             */
049:            protected String mComponentName;
050:
051:            /**
052:             * Type of component.
053:             */
054:            protected String mComponentType = "Binding";
055:
056:            /**
057:             * Local handle to the ComponentContext.
058:             */
059:            protected ComponentContext mContext;
060:
061:            /**
062:             * Logger instance.
063:             */
064:            protected Logger mLog = Logger.getLogger("com.sun.jbi.management");
065:
066:            //
067:            // Component methods
068:            //
069:
070:            /**
071:             * Get the ComponentLifeCycle implementation instance for this Binding
072:             * Component.
073:             * @return the life cycle implementation instance.
074:             */
075:            public ComponentLifeCycle getLifeCycle() {
076:                mLog.info(mComponentType + " getLifeCycle called");
077:                return this ;
078:            }
079:
080:            /**
081:             * Get the ServiceUnitManager implementation instance for this Binding
082:             * Component.
083:             * @return the Service Unit manager implementation instance.
084:             */
085:            public ServiceUnitManager getServiceUnitManager() {
086:                mLog.info(mComponentType + " " + mComponentName
087:                        + " getServiceUnitManager called");
088:                return this ;
089:            }
090:
091:            /**
092:             * Resolve descriptor details for the specified reference, which is for a
093:             * service provided by this component.
094:             * @param ref the endpoint reference to be resolved.
095:             * @return the description for the specified reference.
096:             */
097:            public org.w3c.dom.Document getServiceDescription(
098:                    javax.jbi.servicedesc.ServiceEndpoint ref) {
099:                mLog.info(mComponentType + " " + mComponentName
100:                        + " getServiceDescription called");
101:                return null;
102:            }
103:
104:            /**
105:             * This method is called by JBI to check if this component, in the role of
106:             * provider of the service indicated by the given exchange, can actually 
107:             * perform the operation desired. 
108:             */
109:            public boolean isExchangeWithConsumerOkay(
110:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
111:                    javax.jbi.messaging.MessageExchange exchange) {
112:                mLog.info(mComponentType + " " + mComponentName
113:                        + " isExchangeWithConsumerOkay called");
114:                return true;
115:            }
116:
117:            /**
118:             * This method is called by JBI to check if this component, in the role of
119:             * consumer of the service indicated by the given exchange, can actually 
120:             * interact with the the provider completely. 
121:             */
122:            public boolean isExchangeWithProviderOkay(
123:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
124:                    javax.jbi.messaging.MessageExchange exchange) {
125:                mLog.info(mComponentType + " " + mComponentName
126:                        + " isExchangeWithProviderOkay called");
127:                return true;
128:            }
129:
130:            /**
131:             * Resolve the given endpoint reference, given the capabilities of the
132:             * given consumer. This is called by JBI when it is attempting to resolve
133:             * the given endpoint reference on behalf of a component.
134:             * @param epr the endpoint reference, in some XML dialect understood by the
135:             * appropriate component (usually a Binding Component).
136:             * @return the service endpoint for the endpoint reference;
137:             * <code>null</code> if the endpoint reference cannot be resolved.
138:             */
139:            public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(
140:                    org.w3c.dom.DocumentFragment epr) {
141:                mLog.info(mComponentType + " " + mComponentName
142:                        + " resolveEndpointReference called");
143:                return null;
144:            }
145:
146:            //
147:            // ComponentLifeCycle methods
148:            //
149:
150:            /**
151:             * Initialize the Binding Component.
152:             * @param context the JBI component context created by the JBI framework.
153:             * @throws javax.jbi.JBIException if an error occurs.
154:             */
155:            public void init(ComponentContext context)
156:                    throws javax.jbi.JBIException {
157:                mComponentName = context.getComponentName();
158:            }
159:
160:            /**
161:             * Get the JMX ObjectName for any additional MBean for this BC. This
162:             * implementation always returns null.
163:             * @return javax.management.ObjectName is always null.
164:             */
165:            public javax.management.ObjectName getExtensionMBeanName() {
166:                mLog.info(mComponentType + " " + mComponentName
167:                        + " getExtensionMBeanName called");
168:                return null;
169:            }
170:
171:            /**
172:             * Start the Binding Component.
173:             * @throws javax.jbi.JBIException if an error occurs.
174:             */
175:            public void start() throws javax.jbi.JBIException {
176:                mLog.info(mComponentType + " " + mComponentName
177:                        + " start called");
178:            }
179:
180:            /**
181:             * Stop the Binding Component.
182:             * @throws javax.jbi.JBIException if an error occurs.
183:             */
184:            public void stop() throws javax.jbi.JBIException {
185:                mLog.info(mComponentType + " " + mComponentName
186:                        + " stop called");
187:            }
188:
189:            /**
190:             * Shut down the Binding Component.
191:             * @throws javax.jbi.JBIException if an error occurs.
192:             */
193:            public void shutDown() throws javax.jbi.JBIException {
194:                mLog.info(mComponentType + " " + mComponentName
195:                        + " shutDown called");
196:            }
197:
198:            //
199:            // ServiceUnitManager methods
200:            //
201:
202:            /**
203:             * Deploy a Service Unit.
204:             * @param serviceUnitName the name of the Service Unit being deployed.
205:             * @param serviceUnitRootPath the full path to the Service Unit artifact
206:             * root directory.
207:             * @return a deployment status message.
208:             * @throws javax.jbi.management.DeploymentException if the deployment
209:             * operation is unsuccessful.
210:             */
211:            public String deploy(String serviceUnitName,
212:                    String serviceUnitRootPath)
213:                    throws javax.jbi.management.DeploymentException {
214:                mLog.info(mComponentType + " " + mComponentName
215:                        + " deployed Service Unit " + serviceUnitName);
216:
217:                return createDeployResult("deploy", true);
218:            }
219:
220:            /**
221:             * Initialize the deployment.
222:             * @param serviceUnitName the name of the Service Unit being initialized.
223:             * @param serviceUnitRootPath the full path to the Service Unit artifact
224:             * root directory.
225:             * @throws javax.jbi.management.DeploymentException if the Service Unit is
226:             * not deployed, or is in an incorrect state.
227:             */
228:            public void init(String serviceUnitName, String serviceUnitRootPath)
229:                    throws javax.jbi.management.DeploymentException {
230:                mLog.info(mComponentType + " " + mComponentName
231:                        + " initialized Service Unit " + serviceUnitName);
232:            }
233:
234:            /**
235:             * Shut down the deployment.
236:             * @param serviceUnitName the name of the Service Unit being shut down.
237:             * @throws javax.jbi.management.DeploymentException if the Service Unit
238:             * is not deployed, or is in an incorrect state.
239:             */
240:            public void shutDown(String serviceUnitName)
241:                    throws javax.jbi.management.DeploymentException {
242:                mLog.info(mComponentType + " " + mComponentName
243:                        + " shut down Service Unit " + serviceUnitName);
244:            }
245:
246:            /**
247:             * Start the deployment.
248:             * @param serviceUnitName the name of the Service Unit being started.
249:             * @throws javax.jbi.management.DeploymentException if the Service Unit
250:             * is not deployed, or is in an incorrect state.
251:             */
252:            public void start(String serviceUnitName)
253:                    throws javax.jbi.management.DeploymentException {
254:                mLog.info(mComponentType + " " + mComponentName
255:                        + " started Service Unit " + serviceUnitName);
256:            }
257:
258:            /**
259:             * Stop the deployment.
260:             * @param serviceUnitName the name of the Service Unit being stopped.
261:             * @throws javax.jbi.management.DeploymentException if the Service Unit
262:             * is not deployed, or is in an incorrect state.
263:             */
264:            public void stop(String serviceUnitName)
265:                    throws javax.jbi.management.DeploymentException {
266:                mLog.info(mComponentType + " " + mComponentName
267:                        + " stopped Service Unit " + serviceUnitName);
268:            }
269:
270:            /**
271:             * Undeploy a Service Unit from the component.
272:             * @param serviceUnitName the name of the Service Unit being undeployed.
273:             * @param serviceUnitRootPath the full path to the Service Unit artifact
274:             * root directory.
275:             * @return an undeployment status message.
276:             * @throws javax.jbi.management.DeploymentException if the undeployment
277:             * operation is unsuccessful.
278:             */
279:            public String undeploy(String serviceUnitName,
280:                    String serviceUnitRootPath)
281:                    throws javax.jbi.management.DeploymentException {
282:                mLog.info(mComponentType + " " + mComponentName
283:                        + " undeployed Service Unit " + serviceUnitName);
284:                return createDeployResult("undeploy", true);
285:            }
286:
287:            public void onUninstall() throws javax.jbi.JBIException {
288:            }
289:
290:            public void onInstall() throws javax.jbi.JBIException {
291:
292:            }
293:
294:            public void init(
295:                    javax.jbi.component.InstallationContext installationContext)
296:                    throws javax.jbi.JBIException {
297:
298:            }
299:
300:            public void cleanUp() throws javax.jbi.JBIException {
301:
302:            }
303:
304:            /** Creates a (un)deployment result string.
305:             *  @param task 'deploy' or 'undeploy'
306:             */
307:            private String createDeployResult(String task, boolean isSuccess) {
308:                return "<component-task-result xmlns=\"http://java.sun.com/xml/ns/jbi/management-message\">"
309:                        + "<component-name>"
310:                        + mComponentName
311:                        + "</component-name>"
312:                        + "<component-task-result-details>"
313:                        + "<task-result-details>"
314:                        + "<task-id>"
315:                        + task
316:                        + "</task-id>"
317:                        + "<task-result>"
318:                        + (isSuccess ? "SUCCESS" : "FAILURE")
319:                        + "</task-result>"
320:                        + "</task-result-details>"
321:                        + "</component-task-result-details>"
322:                        + "</component-task-result>";
323:            }
324:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.