Source Code Cross Referenced for PrivateNamespaceTestEngine.java in  » ESB » open-esb » classloaderregresstests » privatelibtest » engine » 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 » classloaderregresstests.privatelibtest.engine.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:         * @(#)PrivateNamespaceTestEngine.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package classloaderregresstests.privatelibtest.engine.rt;
030:
031:        import javax.jbi.component.ServiceUnitManager;
032:        import javax.jbi.component.ComponentLifeCycle;
033:        import java.util.logging.*;
034:        import java.io.IOException;
035:        import javax.management.ObjectName;
036:        import javax.jbi.JBIException;
037:        import library1.QuoteEngine;
038:        import classloaderregresstests.util.*;
039:
040:        /**
041:         * This is an implementation of a Business Process Engine used to 
042:         * test the various use cases of the classloader design
043:         * In particular it tests if a private library specified in the "componentClassPath"
044:         * element of jbi.xml
045:         *
046:         * @author Sun Microsystems, Inc.
047:         */
048:        public class PrivateNamespaceTestEngine implements 
049:                javax.jbi.component.ComponentLifeCycle,
050:                javax.jbi.component.Component {
051:            /**
052:             * Local copy of the component Name
053:             */
054:            private String mComponentName;
055:
056:            /**
057:             * Local handle to the EngineContext
058:             */
059:            private javax.jbi.component.ComponentContext mContext;
060:
061:            /**
062:             * Logger instance
063:             */
064:            private String logStr = "classloaderregresstests.privatelibtest.engine.rt";
065:            private Logger mLog = Logger.getLogger(logStr);
066:            private int msgCount = 0;
067:
068:            /**
069:             * Initialize the Business Process Engine.
070:             * @param context the JBI engine environment context created
071:             * by the JBI framework
072:             * @throws JBIException if an error occurs
073:             */
074:            public void init(javax.jbi.component.ComponentContext context)
075:                    throws javax.jbi.JBIException {
076:                if (null != context) {
077:                    mComponentName = context.getComponentName();
078:
079:                    // setup the logger
080:                    try {
081:                        Utils.setUpLogger(mLog, new FileHandler(
082:                                getLogFileName()), new SimpleFormatter(),
083:                                Level.INFO);
084:                        mLog.info("Engine " + mComponentName + " initialized");
085:                    } catch (IOException ioe) {
086:                        System.out.println("Could not setup logger");
087:                    }
088:                } else {
089:                    throw new javax.jbi.JBIException(
090:                            "Null argument received for " + "EngineContext");
091:                }
092:            }
093:
094:            /**
095:             * Get the JMX ObjectName for the DeploymentMBean for this BPE. If there
096:             * is none, return null.
097:             * @return ObjectName the JMX object name of the DeploymentMBean or null
098:             * if there is no DeploymentMBean.
099:             */
100:            public ObjectName getDeploymentMBeanName() {
101:                return null;
102:            }
103:
104:            /**
105:             * Get the JMX ObjectName for any additional MBean for this BPE. If there
106:             * is none, return null.
107:             * @return ObjectName the JMX object name of the additional MBean or null
108:             * if there is no additional MBean.
109:             */
110:            public ObjectName getExtensionMBeanName() {
111:                return null;
112:            }
113:
114:            /**
115:             * Start the Business Process Engine.
116:             * @throws JBIException if an error occurs
117:             */
118:            public void start() throws javax.jbi.JBIException {
119:                mLog.info("Engine " + mComponentName + " started");
120:                try {
121:                    mLog.info("SUN'S STOCK VALUE = "
122:                            + QuoteEngine.getQuote("SUNW"));
123:                } catch (Exception cnfe) {
124:                    mLog.info("Unable to find QuoteEngine reference :"
125:                            + cnfe.toString());
126:                    throw new JBIException("could not load QuoteEngine:", cnfe);
127:                }
128:            }
129:
130:            /**
131:             * Stop the Business Process Engine.
132:             * @throws JBIException if an error occurs
133:             */
134:            public void stop() throws javax.jbi.JBIException {
135:                mLog.info("Engine " + mComponentName + " stopped");
136:            }
137:
138:            /**
139:             * Shut down the Business Process Engine.
140:             * @throws JBIException if an error occurs
141:             */
142:            public void shutDown() throws javax.jbi.JBIException {
143:                mLog.info("Engine " + mComponentName + " shut down");
144:            }
145:
146:            private String getLogFileName() {
147:                return Utils.getLogLocation(logStr);
148:            }
149:
150:            // javax.jbi.component.Component interface
151:
152:            /**
153:             * Get the ComponentLifeCycle implementation instance for this Binding
154:             * Component
155:             * @return the lifecycle impl instance
156:             */
157:            public ComponentLifeCycle getLifeCycle() {
158:                return this ;
159:            }
160:
161:            /**
162:             * Get the ServiceUnitManager implementation instance for this Binding
163:             * Component.
164:             * @return the Service Unit manager implementation instance.
165:             */
166:            public ServiceUnitManager getServiceUnitManager() {
167:                mLog.info("Engine " + mComponentName
168:                        + " getServiceUnitManager called");
169:                return null;
170:            }
171:
172:            /**
173:             * Resolve descriptor details for the specified reference, which is for a
174:             * service provided by this component.
175:             * @param ref the endpoint reference to be resolved.
176:             * @return the description for the specified reference.
177:             */
178:            public org.w3c.dom.Document getServiceDescription(
179:                    javax.jbi.servicedesc.ServiceEndpoint ref) {
180:                mLog.info("Engine " + mComponentName
181:                        + " getServiceDescription called");
182:                return null;
183:            }
184:
185:            /** This method is called by JBI to check if this component, in the role of
186:             *  provider of the service indicated by the given exchange, can actually 
187:             *  perform the operation desired. 
188:             */
189:            public boolean isExchangeWithConsumerOkay(
190:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
191:                    javax.jbi.messaging.MessageExchange exchange) {
192:                return true;
193:            }
194:
195:            /** This method is called by JBI to check if this component, in the role of
196:             *  consumer of the service indicated by the given exchange, can actually 
197:             *  interact with the the provider completely. 
198:             */
199:            public boolean isExchangeWithProviderOkay(
200:                    javax.jbi.servicedesc.ServiceEndpoint endpoint,
201:                    javax.jbi.messaging.MessageExchange exchange) {
202:                return true;
203:            }
204:
205:            /**
206:             * Resolve the given endpoint reference, given the capabilities of the
207:             * given consumer. This is called by JBI when it is attempting to resolve
208:             * the given endpoint reference on behalf of a component.
209:             * @param epr the endpoint reference, in some XML dialect understood by the
210:             * appropriate component (usually a Binding Component).
211:             * @return the service endpoint for the endpoint reference;
212:             * <code>null</code> if the endpoint reference cannot be resolved.
213:             */
214:            public javax.jbi.servicedesc.ServiceEndpoint resolveEndpointReference(
215:                    org.w3c.dom.DocumentFragment epr) {
216:                return null;
217:            }
218:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.