Source Code Cross Referenced for TestHandlerBase.java in  » ESB » celtix-1.0 » org » objectweb » celtix » systest » handlers » 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 » celtix 1.0 » org.objectweb.celtix.systest.handlers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.objectweb.celtix.systest.handlers;
002:
003:        import java.util.ArrayList;
004:        import java.util.HashMap;
005:        import java.util.List;
006:        import java.util.Map;
007:        import java.util.logging.Logger;
008:
009:        import javax.xml.ws.handler.MessageContext;
010:
011:        /**
012:         * Describe class TestHandlerBase here.
013:         *
014:         *
015:         * Created: Fri Oct 21 14:02:50 2005
016:         *
017:         * @author <a href="mailto:codea@iona.com">codea</a>
018:         * @version 1.0
019:         */
020:        public abstract class TestHandlerBase {
021:
022:            private static final Logger LOG = Logger
023:                    .getLogger(TestHandlerBase.class.getName());
024:
025:            private static int sid;
026:
027:            protected boolean handleMessageRet = true;
028:            Map<String, Integer> methodCallCount = new HashMap<String, Integer>();
029:            private final int id;
030:            private final boolean isServerSideHandler;
031:
032:            public TestHandlerBase(boolean serverSide) {
033:                id = ++sid;
034:                isServerSideHandler = serverSide;
035:            }
036:
037:            protected void methodCalled(String methodName) {
038:                int val = 0;
039:                if (methodCallCount.keySet().contains(methodName)) {
040:                    val = methodCallCount.get(methodName);
041:                }
042:                val++;
043:                methodCallCount.put(methodName, val);
044:            }
045:
046:            public int getId() {
047:                return id;
048:            }
049:
050:            public abstract String getHandlerId();
051:
052:            public boolean isCloseInvoked() {
053:
054:                return methodCallCount.containsKey("close");
055:            }
056:
057:            public boolean isDestroyInvoked() {
058:                return methodCallCount.containsKey("destroy");
059:            }
060:
061:            public boolean isHandleFaultInvoked() {
062:                return methodCallCount.containsKey("handleFault");
063:            }
064:
065:            public int getHandleFaultInvoked() {
066:                return getMethodCallCount("handleFault");
067:            }
068:
069:            public boolean isHandleMessageInvoked() {
070:                return methodCallCount.containsKey("handleMessage");
071:            }
072:
073:            public int getHandleMessageInvoked() {
074:                return getMethodCallCount("handleMessage");
075:            }
076:
077:            public boolean isInitInvoked() {
078:                return methodCallCount.containsKey("init");
079:            }
080:
081:            public void setHandleMessageRet(boolean ret) {
082:                handleMessageRet = ret;
083:            }
084:
085:            public boolean isServerSideHandler() {
086:                return isServerSideHandler;
087:            }
088:
089:            protected void printHandlerInfo(String methodName, boolean outbound) {
090:                String info = getHandlerId() + " "
091:                        + (outbound ? "outbound" : "inbound") + " "
092:                        + methodName;
093:                LOG.info(info);
094:            }
095:
096:            @SuppressWarnings("unchecked")
097:            protected List<String> getHandlerInfoList(MessageContext ctx) {
098:                List<String> handlerInfoList = null;
099:                if (ctx.containsKey("handler.info")) {
100:                    handlerInfoList = (List<String>) ctx.get("handler.info");
101:                } else {
102:                    handlerInfoList = new ArrayList<String>();
103:                    ctx.put("handler.info", handlerInfoList);
104:                    ctx.setScope("handler.info",
105:                            MessageContext.Scope.APPLICATION);
106:                }
107:                return handlerInfoList;
108:            }
109:
110:            protected boolean isOutbound(MessageContext ctx) {
111:                return (Boolean) ctx
112:                        .get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
113:            }
114:
115:            private int getMethodCallCount(String methodName) {
116:                int ret = 0;
117:                if (methodCallCount.containsKey(methodName)) {
118:                    ret = methodCallCount.get(methodName);
119:                }
120:                return ret;
121:            }
122:
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.