Source Code Cross Referenced for BounceBack.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » custom » 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 » cbesb 1.2 » com.bostechcorp.cbesb.custom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.bostechcorp.cbesb.custom;
002:
003:        import java.util.LinkedList;
004:        import java.util.Map;
005:        import java.util.Set;
006:
007:        import javax.jbi.JBIException;
008:        import javax.jbi.component.ComponentContext;
009:        import javax.jbi.messaging.DeliveryChannel;
010:        import javax.jbi.messaging.MessageExchange;
011:        import javax.jbi.messaging.NormalizedMessage;
012:
013:        import org.apache.commons.logging.Log;
014:
015:        import com.bostechcorp.cbesb.runtime.ccsl.lib.DumpNormalizedMessage;
016:        import com.bostechcorp.cbesb.runtime.ccsl.lib.IScriptObject;
017:        import com.bostechcorp.cbesb.runtime.ccsl.nmhandler.NormalizedMessageHandler;
018:
019:        public class BounceBack implements  IScriptObject {
020:
021:            /**
022:             * The run method is called when an exchange is sent to the endpoint.
023:             *
024:             * @param logger - the loggger object
025:             * @param rootDir - the root direcory of the SU
026:             * @param componentContext - the componentContext object
027:             * @param channel - the delivery channel object
028:             * @param exchange - the MessageExchange object passed in
029:             * @param params - the user paramaters in name/value pair
030:             * @throws Exception
031:             */
032:
033:            public void run(Log logger, String rootDir,
034:                    ComponentContext componentContext, DeliveryChannel channel,
035:                    MessageExchange exchange, Map<String, String> params)
036:                    throws Exception {
037:
038:                NormalizedMessage m;
039:                if ((m = exchange.getMessage("in")) != null) {
040:                    boolean isNewOutMessage = false;
041:                    NormalizedMessage mOut = exchange.getMessage("out");
042:                    if (mOut == null) {
043:                        mOut = exchange.createMessage();
044:                        isNewOutMessage = true;
045:                    }
046:                    NormalizedMessageHandler dest = new NormalizedMessageHandler(
047:                            mOut);
048:                    NormalizedMessageHandler source = new NormalizedMessageHandler(
049:                            m);
050:                    for (int i = 0; i < source.getRecordCount(); i++)
051:                        dest.addRecord(source.getRecordAtIndex(i));
052:                    Set<String> propertyNames = m.getPropertyNames();
053:                    for (String propertyName : propertyNames) {
054:                        mOut.setProperty(propertyName, m
055:                                .getProperty(propertyName));
056:                    }
057:                    dest.generateMessageContent();
058:                    if (isNewOutMessage)
059:                        exchange.setMessage(mOut, "out");
060:                }
061:            }
062:
063:            /**
064:             * Start mode can be used for initialization. Consumer endpoints
065:             * that do not use timed mode should set up a thread to generate
066:             * exchanges in start mode.
067:             *     
068:             * @param logger - the loggger object
069:             * @param rootDir - the root direcory of the SU
070:             * @param componentContext - the componentContext object
071:             * @param channel - the delivery channel object
072:             * @param exchange - the MessageExchange object passed in
073:             * @param params - the user paramaters in name/value pair
074:             * @throws Exception
075:             */
076:
077:            public void start(Log logger, String rootDir,
078:                    ComponentContext componentContext, DeliveryChannel channel,
079:                    Map<String, String> params) throws Exception {
080:
081:                // nothing to do for startup 
082:
083:            }
084:
085:            /**
086:             * The stop method should clean up resources
087:             *
088:             * @param logger - the loggger object
089:             * @param rootDir - the root direcory of the SU
090:             * @param componentContext - the componentContext object
091:             * @param channel - the delivery channel object
092:             * @param params - the user paramaters in name/value pair
093:             * @throws Exception
094:             */
095:            public void stop(Log logger, String rootDir,
096:                    ComponentContext componentContext, DeliveryChannel channel,
097:                    Map<String, String> params) throws Exception {
098:
099:                // nothing to do for stop 
100:            }
101:
102:            /**
103:             * The time method is called for a timed mode consumer endpoint.
104:             * It returns a linked list of exchanges to be sent from the
105:             * endpoint.
106:             *
107:             * @param logger - the loggger object
108:             * @param rootDir - the root direcory of the SU
109:             * @param componentContext - the componentContext object
110:             * @param channel - the delivery channel object
111:             * @param exchange - the MessageExchange object passed in
112:             * @param params - the user paramaters in name/value pair
113:             * @return - the LinkList containning one of many MessageExchange objects
114:             * @throws Exception
115:             */
116:            public LinkedList time(Log logger, String rootDir,
117:                    ComponentContext componentContext, DeliveryChannel channel,
118:                    MessageExchange exchange, Map<String, String> params)
119:                    throws Exception {
120:
121:                // This component cannot run as a consumer so throw an exception
122:                JBIException e = new JBIException(
123:                        "cannot run Echo component in time mode");
124:                throw e;
125:            }
126:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.