Source Code Cross Referenced for Engine2Runtime.java in  » ESB » open-esb » com » sun » jbi » ui » cli » test » engine2 » rt » 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.cli.test.engine2.rt 
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:         * @(#)Engine2Runtime.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.cli.test.engine2.rt;
030:
031:        import com.sun.jbi.management.ManagementMessageBuilder;
032:        import java.util.logging.Logger;
033:        import javax.jbi.JBIException;
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:        import javax.jbi.management.MBeanNames;
039:        import javax.jbi.servicedesc.ServiceEndpoint;
040:        import javax.management.MBeanServer;
041:        import javax.management.ObjectName;
042:        import javax.management.StandardMBean;
043:
044:        /**
045:         * This is an implementation of a Business Process Engine that is purely for
046:         * unit testing. It does nothing other than log messages when its methods
047:         * are called.
048:         *
049:         * @author Sun Microsystems, Inc.
050:         */
051:        public class Engine2Runtime implements  Component, ComponentLifeCycle {
052:            /**
053:             * Local copy of the component ID
054:             */
055:            private String mComponentId;
056:
057:            /**
058:             * fix it
059:             */
060:            private ComponentContext mContext;
061:            /**
062:             * fix it
063:             */
064:            private ManagementMessageBuilder mMgmtMsgBuilder;
065:
066:            /**
067:             * fix it
068:             */
069:            private Engine2Deployer mDeployer;
070:
071:            /**
072:             * Logger instance
073:             */
074:            private Logger mLog = Logger
075:                    .getLogger("com.sun.jbi.ui.cli.test.engine2");
076:
077:            /**
078:             * Get the required life cycle control implementation for this component.
079:             * @return the life cycle control implementation for this component.
080:             */
081:            public ComponentLifeCycle getLifeCycle() {
082:                return this ;
083:            }
084:
085:            /**
086:             * Get the Service Unit manager for this component. If this component
087:             * does not support deployments, return <code>null</code>.
088:             * @return the Service Unit manager for this component, or <code>null</code>
089:             * if there is none.
090:             */
091:            public ServiceUnitManager getServiceUnitManager() {
092:                return mDeployer;
093:            }
094:
095:            /**
096:             * Resolve descriptor details for the specified reference, which is for a
097:             * service provided by this component.
098:             * @param ref the endpoint reference to be resolved.
099:             * @return the description for the specified reference.
100:             */
101:            public org.w3c.dom.Document getServiceDescription(
102:                    ServiceEndpoint ref) {
103:                return null;
104:            }
105:
106:            /**
107:             * Initialize the Business Process Engine.
108:             * @param context the JBI environment context created
109:             * by the JBI framework
110:             * @throws JBIException if an error occurs
111:             */
112:            public void init(ComponentContext context) throws JBIException {
113:
114:                if (context == null) {
115:                    throw new JBIException("Null argument received for "
116:                            + "EngineContext");
117:                }
118:
119:                this .mLog = Logger.getLogger("com.sun.jbi.ui.cli.test.engine2");
120:
121:                this .mContext = context;
122:                this .mComponentId = context.getComponentName();
123:
124:                try {
125:                    this .mMgmtMsgBuilder = ((com.sun.jbi.component.ComponentContext) mContext)
126:                            .getManagementMessageFactory()
127:                            .newBuildManagementMessage();
128:                } catch (Exception e) {
129:                    throw new JBIException("Unable to create Mmgt Msg Builder",
130:                            e);
131:                }
132:
133:                createDeployer();
134:
135:                mLog.info("Engine " + mComponentId + " initialized");
136:            }
137:
138:            /**
139:             * Get the JMX ObjectName for any additional MBean for this BPE. If there
140:             * is none, return null.
141:             * @return ObjectName the JMX object name of the additional MBean or null
142:             * if there is no additional MBean.
143:             */
144:            public ObjectName getExtensionMBeanName() {
145:                return null;
146:            }
147:
148:            /**
149:             * Start the Business Process Engine.
150:             * @throws JBIException if an error occurs
151:             */
152:            public void start() throws JBIException {
153:                mLog.info("Engine " + mComponentId + " started");
154:            }
155:
156:            /**
157:             * Stop the Business Process Engine.
158:             * @throws JBIException if an error occurs
159:             */
160:            public void stop() throws JBIException {
161:                mLog.info("Engine " + mComponentId + " stopped");
162:            }
163:
164:            /**
165:             * Shut down the Business Process Engine.
166:             * @throws JBIException if an error occurs
167:             */
168:            public void shutDown() throws JBIException {
169:                mLog.info("Engine " + mComponentId + " shut down");
170:            }
171:
172:            /**
173:             * fix it
174:             * @return fix it
175:             */
176:            public Logger getLogger() {
177:                return this .mLog;
178:            }
179:
180:            /**
181:             * fix it
182:             * @return fix it
183:             */
184:            public String getId() {
185:                return this .mComponentId;
186:            }
187:
188:            /**
189:             * fix it
190:             * @return fix it
191:             */
192:            public ComponentContext getContext() {
193:                return this .mContext;
194:            }
195:
196:            /**
197:             * fix it
198:             * @return fix it
199:             */
200:            public ManagementMessageBuilder getMgmtMsgBuilder() {
201:                return this .mMgmtMsgBuilder;
202:            }
203:
204:            /**
205:             * fix it
206:             * @throws JBIException fix it
207:             */
208:            public void createDeployer() throws JBIException {
209:                try {
210:                    if (this .mDeployer == null) {
211:                        this .mDeployer = new Engine2Deployer(this );
212:                    }
213:                } catch (Exception e) {
214:                    throw new JBIException(
215:                            "cli Test Engine2 Deployer Creation Failed", e);
216:                }
217:            }
218:
219:            /** This method is called by JBI to check if this component, in the role of
220:             *  provider of the service indicated by the given exchange, can actually 
221:             *  perform the operation desired. 
222:             */
223:            public boolean isExchangeWithConsumerOkay(
224:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
225:                    javax.jbi.messaging.MessageExchange exchange) {
226:                return true;
227:            }
228:
229:            /** This method is called by JBI to check if this component, in the role of
230:             *  consumer of the service indicated by the given exchange, can actually 
231:             *  interact with the the provider completely. 
232:             */
233:            public boolean isExchangeWithProviderOkay(
234:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
235:                    javax.jbi.messaging.MessageExchange exchange) {
236:                return true;
237:            }
238:
239:            /**
240:             * Resolve the given endpoint reference, given the capabilities of the
241:             * given consumer. This is called by JBI when it is attempting to resolve
242:             * the given endpoint reference on behalf of a component.
243:             * @param epr the endpoint reference, in some XML dialect understood by the
244:             * appropriate component (usually a Binding Component).
245:             * @return the service endpoint for the endpoint reference;
246:             * <code>null</code> if the endpoint reference cannot be resolved.
247:             */
248:            public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(
249:                    org.w3c.dom.DocumentFragment epr) {
250:                return null;
251:            }
252:        }
w___w__w.__j_a___v__a__2_s.__c__o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.