Source Code Cross Referenced for DestinationInfo.java in  » EJB-Server-geronimo » plugins » org » apache » geronimo » console » jmsmanager » 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 » EJB Server geronimo » plugins » org.apache.geronimo.console.jmsmanager 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */package org.apache.geronimo.console.jmsmanager;
017:
018:        import javax.jms.Queue;
019:
020:        public class DestinationInfo implements  Comparable {
021:
022:            private final String name;
023:
024:            private final String physicalName;
025:
026:            private final Class type;
027:
028:            private final String applicationName;
029:
030:            private final String moduleName;
031:
032:            private final String configURI;
033:
034:            public DestinationInfo(String name, String physicalName,
035:                    Class type, String applicationName, String moduleName,
036:                    String configURI) {
037:                this .name = name;
038:                this .physicalName = physicalName;
039:                this .type = type;
040:                this .applicationName = applicationName;
041:                this .moduleName = moduleName;
042:                this .configURI = configURI;
043:            }
044:
045:            public String getName() {
046:                return name;
047:            }
048:
049:            public String getPhysicalName() {
050:                return physicalName;
051:            }
052:
053:            public Class getType() {
054:                return type;
055:            }
056:
057:            public String getApplicationName() {
058:                return applicationName;
059:            }
060:
061:            public String getModuleName() {
062:                return moduleName;
063:            }
064:
065:            public String getConfigURI() {
066:                return configURI;
067:            }
068:
069:            /**
070:             * Determines if the destination that this objects represents is viewable
071:             * from the console this means that either the destination that this object
072:             * represents was added via the Geronimo JMS Console or it is a Queue.
073:             *
074:             * @return true if the console knows how to display this Destination
075:             *         otherwise returns false.
076:             */
077:            public boolean isViewable() {
078:                return Queue.class.isAssignableFrom(type) || isConsoleManaged();
079:            }
080:
081:            /**
082:             * Determines if the destination that this objects represents is removable
083:             * from the console this means that the destination that this object
084:             * represents was added via the Geronimo JMS Console.
085:             *
086:             * @return true if the console knows how to remove this Destination
087:             *         otherwise returns false.
088:             */
089:            public boolean isRemovable() {
090:                return isConsoleManaged();
091:            }
092:
093:            /**
094:             * Determines if the destination that this objects represents was added via
095:             * the console.
096:             *
097:             * @return true if the destination that this objects represents was added
098:             *         via the console otherwise returns false.
099:             */
100:            private boolean isConsoleManaged() {
101:                return configURI.indexOf(AbstractJMSManager.BASE_CONFIG_URI
102:                        + name) > -1;
103:            }
104:
105:            public int compareTo(Object o) {
106:                if (o instanceof  DestinationInfo) {
107:                    DestinationInfo rhs = (DestinationInfo) o;
108:                    // If one of the objects is removable and the other is not, the
109:                    // removable one is less (comes first in a descending sort).
110:                    if (rhs.isRemovable() != this .isRemovable()) {
111:                        if (this .isRemovable()) {
112:                            return -1;
113:                        } else {
114:                            return 1;
115:                        }
116:                        // If one of the objects is viewable and the other is not the
117:                        // viewable one is less (comes first in a descending sort).
118:                    } else if (rhs.isViewable() != this .isViewable()) {
119:                        if (this .isViewable()) {
120:                            return -1;
121:                        } else {
122:                            return 1;
123:                        }
124:                        // Sort by name if all else fails.
125:                    } else {
126:                        return this .name.compareTo(rhs.getName());
127:                    }
128:                }
129:                return 1;
130:            }
131:
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.