Source Code Cross Referenced for EchoToLog.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 EchoToLog 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:                String myEndpoint = exchange.getEndpoint().toString();
039:                String messageString = "";
040:                NormalizedMessage m;
041:                if ((m = exchange.getMessage("in")) != null) {
042:                    messageString = DumpNormalizedMessage.dump(m) + "\n";
043:                }
044:                logger.info("\n\n\nScript Component EchoToLog\n" + myEndpoint
045:                        + "\n" + messageString + "\n\n");
046:            }
047:
048:            /**
049:             * Start mode can be used for initialization. Consumer endpoints
050:             * that do not use timed mode should set up a thread to generate
051:             * exchanges in start mode.
052:             *     
053:             * @param logger - the loggger object
054:             * @param rootDir - the root direcory of the SU
055:             * @param componentContext - the componentContext object
056:             * @param channel - the delivery channel object
057:             * @param exchange - the MessageExchange object passed in
058:             * @param params - the user paramaters in name/value pair
059:             * @throws Exception
060:             */
061:
062:            public void start(Log logger, String rootDir,
063:                    ComponentContext componentContext, DeliveryChannel channel,
064:                    Map<String, String> params) throws Exception {
065:
066:                // nothing to do for startup 
067:
068:            }
069:
070:            /**
071:             * The stop method should clean up resources
072:             *
073:             * @param logger - the loggger object
074:             * @param rootDir - the root direcory of the SU
075:             * @param componentContext - the componentContext object
076:             * @param channel - the delivery channel object
077:             * @param params - the user paramaters in name/value pair
078:             * @throws Exception
079:             */
080:            public void stop(Log logger, String rootDir,
081:                    ComponentContext componentContext, DeliveryChannel channel,
082:                    Map<String, String> params) throws Exception {
083:
084:                // nothing to do for stop 
085:            }
086:
087:            /**
088:             * The time method is called for a timed mode consumer endpoint.
089:             * It returns a linked list of exchanges to be sent from the
090:             * endpoint.
091:             *
092:             * @param logger - the loggger object
093:             * @param rootDir - the root direcory of the SU
094:             * @param componentContext - the componentContext object
095:             * @param channel - the delivery channel object
096:             * @param exchange - the MessageExchange object passed in
097:             * @param params - the user paramaters in name/value pair
098:             * @return - the LinkList containning one of many MessageExchange objects
099:             * @throws Exception
100:             */
101:            public LinkedList time(Log logger, String rootDir,
102:                    ComponentContext componentContext, DeliveryChannel channel,
103:                    MessageExchange exchange, Map<String, String> params)
104:                    throws Exception {
105:
106:                // This component cannot run as a consumer so throw an exception
107:                JBIException e = new JBIException(
108:                        "cannot run Echo component in time mode");
109:                throw e;
110:            }
111:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.