Source Code Cross Referenced for CreateContainerBean.java in  » Portal » Open-Portal » com » sun » portal » admin » console » desktop » 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 » Portal » Open Portal » com.sun.portal.admin.console.desktop 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: CreateContainerBean.java,v 1.13 2005/10/24 18:52:19 cathywu Exp $
003:         * Copyright 2005 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.admin.console.desktop;
014:
015:        import java.beans.*;
016:
017:        import java.util.Map;
018:        import java.util.Set;
019:        import java.util.Iterator;
020:        import java.util.LinkedList;
021:        import java.util.logging.Level;
022:
023:        //JMX
024:        import javax.management.MBeanServerConnection;
025:        import javax.management.ObjectName;
026:        import javax.management.InstanceNotFoundException;
027:        import javax.management.MBeanException;
028:        import javax.management.ReflectionException;
029:        import javax.management.MalformedObjectNameException;
030:        import javax.management.RuntimeErrorException;
031:
032:        import com.sun.web.ui.model.Option;
033:
034:        import com.sun.portal.admin.common.util.AdminClientUtil;
035:        import com.sun.portal.admin.common.PSMBeanException;
036:
037:        import com.sun.portal.admin.console.fabric.ListPortalsBean;
038:
039:        /**
040:         * @author cathywu
041:         */
042:        public class CreateContainerBean extends ChannelContainerBaseBean {
043:            private String containerName;
044:            private Option[] contProviders;
045:
046:            public CreateContainerBean() {
047:                //setup initial screen
048:                contProviders = setupContProviders();
049:            }
050:
051:            /**
052:             * Container providers methods
053:             */
054:            public Option[] setupContProviders() {
055:                dn = (String) getCurrentDN();
056:                Object[] params = { dn };
057:                String[] signature = { "java.lang.String" };
058:                ObjectName on = null;
059:                Set ps = null;
060:
061:                contProviders = null;
062:                try {
063:                    on = AdminClientUtil.getDisplayProfileMBeanObjectName(
064:                            getDomain(), portalId);
065:                    ps = (Set) mbsc.invoke(on, "getExistingContainerProviders",
066:                            params, signature);
067:                } catch (Exception e) {
068:                    return contProviders;
069:                }
070:
071:                int size = ps.size();
072:                if (size != 0) {
073:                    contProviders = new Option[size];
074:                    int ind = 0;
075:                    for (Iterator i = ps.iterator(); i.hasNext();) {
076:                        String next = (String) i.next();
077:                        contProviders[ind] = new Option(next, next);
078:                        ind++;
079:                    }
080:                }
081:
082:                return contProviders;
083:            }
084:
085:            /**
086:             * createChannel methods
087:             */
088:            public boolean createContainer(CreateChannelBean cb,
089:                    String selectedContainer, String createdContainer,
090:                    String provider) {
091:                try {
092:                    Object[] params = { dn, createdContainer, provider };
093:                    String[] signature = { "java.lang.String",
094:                            "java.lang.String", "java.lang.String" };
095:
096:                    log(Level.INFO,
097:                            "CreateContainerBean.createContainer(),container name: "
098:                                    + createdContainer);
099:                    log(Level.INFO,
100:                            "CreateContainerBean.createContainer(),container provider: "
101:                                    + provider);
102:
103:                    ObjectName on = AdminClientUtil
104:                            .getDisplayProfileMBeanObjectName(getDomain(),
105:                                    portalId);
106:
107:                    mbsc.invoke(on, "createContainer", params, signature);
108:
109:                    //cb.setupAlert(null, "createContainer.summary",
110:                    //              "createContainer.completed","information",
111:                    //              null);
112:                    setCancelText((String) rbMap.get("close.button"));
113:                    setDisableCreate(true);
114:                    setRegenerate(true);
115:                    return true;
116:                } catch (MBeanException me) {
117:                    log(Level.SEVERE,
118:                            "CreateContainerBean.createContainer(): Failed to create container "
119:                                    + createdContainer
120:                                    + " due to MBeanException ", me);
121:                    String alertDetailKey = null;
122:                    Object[] tokens = null;
123:                    String message = null;
124:
125:                    if (me.getCause() != null
126:                            && me.getCause() instanceof  PSMBeanException) {
127:                        alertDetailKey = ((PSMBeanException) me.getCause())
128:                                .getErrorKey();
129:                        tokens = ((PSMBeanException) me.getCause()).getTokens();
130:                        message = composeLogMessage(((PSMBeanException) me
131:                                .getCause()));
132:                    } else {
133:                        message = composeLogMessage(me);
134:                    }
135:
136:                    if (alertDetailKey == null) {
137:                        alertDetailKey = "error.createChannel.failed.checkLogs";
138:                        tokens = new Object[] { createdContainer };
139:                    }
140:
141:                    cb.setupAlert(tokens, "error.createChannel.summary",
142:                            alertDetailKey, "error",
143:                            "error.createChannel.failed.checkLogs", message);
144:                    return false;
145:                } catch (Exception e) {
146:                    cb.setupAlert(new Object[] { createdContainer },
147:                            "error.createContainer.summary",
148:                            "error.createContainer.failed.checkLogs", "error",
149:                            null, composeLogMessage(e));
150:                    log(
151:                            Level.SEVERE,
152:                            "Exception in CreateContainerBean.createContainer()",
153:                            e);
154:                    return false;
155:                }
156:            }
157:
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.