Source Code Cross Referenced for DestinationEditAction.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » webapp » jonasadmin » jonasmqconnect » 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 » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect;
002:
003:        import java.io.IOException;
004:        import java.util.ArrayList;
005:        import java.util.Collections;
006:        import java.util.ListIterator;
007:
008:        import javax.management.ObjectName;
009:        import javax.servlet.ServletException;
010:        import javax.servlet.http.HttpServletRequest;
011:        import javax.servlet.http.HttpServletResponse;
012:
013:        import org.apache.struts.action.ActionForm;
014:        import org.apache.struts.action.ActionForward;
015:        import org.apache.struts.action.ActionMapping;
016:        import org.objectweb.jonas.jmx.JonasManagementRepr;
017:        import org.objectweb.jonas.webapp.jonasadmin.JonasBaseAction;
018:        import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
019:        import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.ItemDestination;
020:        import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.MqObjectNames;
021:        import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.PropertiesComparator;
022:        import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.PropertiesUtil;
023:        import org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect.util.Property;
024:
025:        public class DestinationEditAction extends JonasBaseAction {
026:
027:            public ActionForward executeAction(ActionMapping mapping,
028:                    ActionForm form, HttpServletRequest request,
029:                    HttpServletResponse response) throws IOException,
030:                    ServletException {
031:
032:                DestinationEditForm fBean = (DestinationEditForm) form;
033:                String jndiName = fBean.getJndiName();
034:                String operation = fBean.getOperation();
035:                ArrayList properties = new ArrayList();
036:                ArrayList statProperties = new ArrayList();
037:                ObjectName mbName;
038:
039:                WhereAreYou oWhere = (WhereAreYou) request.getSession()
040:                        .getAttribute(WhereAreYou.SESSION_NAME);
041:                String serverName = oWhere.getCurrentJonasServerName();
042:                String domainName = oWhere.getCurrentDomainName();
043:
044:                /*
045:                 * Get the connector name
046:                 */
047:                String connector = request.getParameter("connector");
048:                if (connector == null) {
049:                    connector = (String) m_Session.getAttribute("mqconnector");
050:                } else {
051:                    m_Session.setAttribute("mqconnector", connector);
052:                }
053:
054:                try {
055:
056:                    /*
057:                     * FWA BEGIN : get the exact ObjectName of the destination
058:                     */
059:                    /* */
060:                    mbName = MqObjectNames.getDestinationON(domainName,
061:                            jndiName, connector);
062:
063:                    //domain*jmq1*jonasmqconnect*jonasmqconnector*<myconnector>*destination*<mydestination>
064:                    // Force the node selection in tree
065:                    String nodeName = "domain" + WhereAreYou.NODE_SEPARATOR
066:                            + serverName + WhereAreYou.NODE_SEPARATOR
067:                            + "jonasmqconnect" + WhereAreYou.NODE_SEPARATOR
068:                            + "jonasmqconnector" + WhereAreYou.NODE_SEPARATOR
069:                            + connector + WhereAreYou.NODE_SEPARATOR
070:                            + "destination" + WhereAreYou.NODE_SEPARATOR
071:                            + jndiName;
072:                    m_WhereAreYou.selectNameNode(nodeName, true);
073:
074:                    /*
075:                     * FWA END
076:                     */
077:
078:                    boolean isTopic = ((Boolean) JonasManagementRepr
079:                            .getAttribute(mbName, "IsTopic", serverName))
080:                            .booleanValue();
081:                    fBean.setIsTopic(isTopic);
082:                    properties.add(new Property("JndiName", jndiName,
083:                            "JndiName"));
084:                    properties.add(new Property("Type", (isTopic) ? "Topic"
085:                            : "Queue", "Type"));
086:
087:                    /*
088:                     * FWA commented out
089:                     */
090:                    /*
091:                     * TODO : check why are ALL OF THESE properties out.
092:                     * - Class: OK. it's a java class
093:                     * - Refernce: OK. Sums all of the properties
094:                     * - why Version ?
095:                     * - Why Expiry ?
096:                     */
097:                    String[] propertiesToSkip = new String[] { "Class",
098:                            "Expiry", "Reference", "Version" };
099:                    properties = PropertiesUtil.getJMSObjectProperties(mbName,
100:                            ((isTopic) ? "Topic" : "Queue"), "getProperty",
101:                            propertiesToSkip, serverName, domainName);
102:
103:                    /*
104:                     * FWA end
105:                     */
106:                    if (!isTopic) {
107:                        int currentDepth = ((Integer) JonasManagementRepr
108:                                .getAttribute(mbName, "CurrentDepth",
109:                                        serverName)).intValue();
110:                        int maxQueueDepth = ((Integer) JonasManagementRepr
111:                                .getAttribute(mbName, "MaxQueueDepth",
112:                                        serverName)).intValue();
113:                        int inputCount = ((Integer) JonasManagementRepr
114:                                .getAttribute(mbName, "InputCount", serverName))
115:                                .intValue();
116:                        int outputCount = ((Integer) JonasManagementRepr
117:                                .getAttribute(mbName, "OutputCount", serverName))
118:                                .intValue();
119:
120:                        statProperties
121:                                .add(new Property(
122:                                        "CurrentDepth",
123:                                        "" + currentDepth,
124:                                        m_Resources
125:                                                .getMessage("label.joansmqconnect.destination.currentdepth")));
126:                        statProperties
127:                                .add(new Property(
128:                                        "MaxQueueDepth",
129:                                        "" + maxQueueDepth,
130:                                        m_Resources
131:                                                .getMessage("label.joansmqconnect.destination.maxqueuedepth")));
132:                        statProperties
133:                                .add(new Property(
134:                                        "InputCount",
135:                                        "" + inputCount,
136:                                        m_Resources
137:                                                .getMessage("label.joansmqconnect.destination.inputcount")));
138:                        statProperties
139:                                .add(new Property(
140:                                        "OutputCount",
141:                                        "" + outputCount,
142:                                        m_Resources
143:                                                .getMessage("label.joansmqconnect.destination.outputcount")));
144:                    }
145:                    if ("apply".equals(operation)) {
146:                        for (int i = 0; i < properties.size(); i++) {
147:                            Property property = (Property) properties.get(i);
148:                            property.setValue(request.getParameter(property
149:                                    .getName()));
150:                        }
151:
152:                        PropertiesUtil.setClassProperties(mbName, /* FWA - commented out: mqClass, */
153:                        "setProperty", properties, serverName);
154:                        properties = PropertiesUtil.getJMSObjectProperties(
155:                                mbName, ((isTopic) ? "Topic" : "Queue"),
156:                                "getProperty", propertiesToSkip, serverName,
157:                                domainName);
158:                        /* FWA - commented out: properties = PropertiesUtil.getClassProperties(mbName, mqClass,
159:                                "getProperty", new String []{"Version"}, serverName);
160:                         */
161:                    }
162:                    if ("clearQueue".equals(operation)) {
163:                        Object[] params = {};
164:                        String[] signature = {};
165:                        JonasManagementRepr.invoke(mbName, "clearQueue",
166:                                params, signature, serverName);
167:                        fBean.setOperation("view");
168:                    }
169:
170:                    Collections.sort(properties, new PropertiesComparator());
171:                } catch (Throwable t) {
172:                    addGlobalError(t);
173:                    saveErrors(request, m_Errors);
174:                    return (mapping.findForward("Global Error"));
175:                }
176:                fBean.setProperties(properties);
177:                fBean.setStatProperties(statProperties);
178:                return mapping.findForward("JonasMqConnectDestinationEdit");
179:            }
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.