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


001:        package org.objectweb.celtix.bus.wsdl;
002:
003:        import java.util.ArrayList;
004:        import java.util.HashSet;
005:        import java.util.Iterator;
006:        import java.util.List;
007:        import java.util.Set;
008:        import java.util.WeakHashMap;
009:
010:        import javax.wsdl.Binding;
011:        import javax.wsdl.Definition;
012:        import javax.wsdl.Operation;
013:        import javax.wsdl.PortType;
014:        import javax.xml.namespace.QName;
015:
016:        import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedAttribute;
017:        import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedOperation;
018:        import org.objectweb.celtix.bus.management.jmx.export.annotation.ManagedResource;
019:        import org.objectweb.celtix.management.Instrumentation;
020:
021:        @ManagedResource(componentName="WSDLManager",description="The Celtix bus wsdl model component ",currencyTimeLimit=15,persistPolicy="OnUpdate")
022:        public class WSDLManagerInstrumentation implements  Instrumentation {
023:            private static final String INSTRUMENTED_NAME = "Bus.WSDLManager";
024:            private String objectName;
025:            private WSDLManagerImpl wsdlManager;
026:            private WeakHashMap<Object, Definition> definitionsMap;
027:
028:            public WSDLManagerInstrumentation(WSDLManagerImpl wsdl) {
029:                wsdlManager = wsdl;
030:                objectName = ",name=WSDLManager";
031:                definitionsMap = wsdlManager.definitionsMap;
032:            }
033:
034:            // get the wsdl model information 
035:
036:            @ManagedAttribute(description="The celtix bus WSDL provider the Service",persistPolicy="OnUpdate")
037:            public String[] getServices() {
038:                List<String> strList = new ArrayList<String>();
039:                Set<Definition> defSet = new HashSet<Definition>(definitionsMap
040:                        .values());
041:                for (Iterator<Definition> it = defSet.iterator(); it.hasNext();) {
042:                    Definition definition = it.next();
043:                    String defName = "Definition: "
044:                            + definition.getQName().toString();
045:                    for (Iterator jt = definition.getServices().keySet()
046:                            .iterator(); jt.hasNext();) {
047:                        QName serviceQName = (QName) jt.next();
048:                        String name = defName + " Service: "
049:                                + serviceQName.toString();
050:                        strList.add(name);
051:                    }
052:                }
053:                String[] strings = new String[strList.size()];
054:                return strList.toArray(strings);
055:            }
056:
057:            @ManagedAttribute(description="The celtix bus WSDL provider the Bindings",persistPolicy="OnUpdate")
058:            public String[] getBindings() {
059:                List<String> strList = new ArrayList<String>();
060:                Set<Definition> defSet = new HashSet<Definition>(definitionsMap
061:                        .values());
062:                for (Iterator<Definition> it = defSet.iterator(); it.hasNext();) {
063:                    Definition definition = it.next();
064:                    String defName = "Definition: "
065:                            + definition.getQName().toString();
066:                    for (Iterator jt = definition.getBindings().values()
067:                            .iterator(); jt.hasNext();) {
068:                        Binding binding = (Binding) jt.next();
069:                        String name = defName + " Binding: "
070:                                + binding.getQName().toString();
071:                        strList.add(name);
072:                    }
073:                }
074:                String[] strings = new String[strList.size()];
075:                return strList.toArray(strings);
076:            }
077:
078:            @ManagedAttribute(description="The celtix bus WSDL provider the PortTypes",persistPolicy="OnUpdate")
079:            public String[] getPorts() {
080:                List<String> strList = new ArrayList<String>();
081:                Set<Definition> defSet = new HashSet<Definition>(definitionsMap
082:                        .values());
083:                for (Iterator<Definition> it = defSet.iterator(); it.hasNext();) {
084:                    Definition definition = it.next();
085:                    String defName = "Definition: "
086:                            + definition.getQName().toString();
087:                    for (Iterator jt = definition.getPortTypes().values()
088:                            .iterator(); jt.hasNext();) {
089:                        PortType port = (PortType) jt.next();
090:                        String name = defName + " PortType: "
091:                                + port.getQName().toString();
092:                        strList.add(name);
093:                    }
094:                }
095:                String[] strings = new String[strList.size()];
096:                return strList.toArray(strings);
097:            }
098:
099:            // get the address 
100:
101:            @ManagedOperation(currencyTimeLimit=30,description="The celtix bus WSDL defined service and port provider operation")
102:            public String[] getOperation(String def, String pt) {
103:                List<String> strList = new ArrayList<String>();
104:                Definition definition = null;
105:                PortType port = null;
106:                Set<Definition> defSet = new HashSet<Definition>(definitionsMap
107:                        .values());
108:                for (Iterator<Definition> it = defSet.iterator(); it.hasNext();) {
109:                    definition = it.next();
110:                    if (def.compareTo(definition.getQName().getLocalPart()) == 0) {
111:                        for (Iterator jt = definition.getPortTypes().values()
112:                                .iterator(); jt.hasNext();) {
113:                            port = (PortType) jt.next();
114:                            if (pt.compareTo(port.getQName().getLocalPart()) == 0) {
115:                                break;
116:                            }
117:                        }
118:                        break;
119:                    }
120:                }
121:                if (definition != null && port != null) {
122:                    for (Iterator it = port.getOperations().iterator(); it
123:                            .hasNext();) {
124:                        Operation opt = (Operation) it.next();
125:                        String name = "Operation: " + opt.getName();
126:                        strList.add(name);
127:                    }
128:                }
129:                String[] strings = new String[strList.size()];
130:                return strList.toArray(strings);
131:            }
132:
133:            public String getInstrumentationName() {
134:                return INSTRUMENTED_NAME;
135:            }
136:
137:            public Object getComponent() {
138:                return wsdlManager;
139:            }
140:
141:            public String getUniqueInstrumentationName() {
142:                return objectName;
143:            }
144:
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.