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