[jboss-svn-commits] JBL Code SVN: r35679 - labs/jbossesb/branches/JBESB_4_9_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Oct 22 14:22:08 EDT 2010
Author: kevin.conner at jboss.com
Date: 2010-10-22 14:22:07 -0400 (Fri, 22 Oct 2010)
New Revision: 35679
Modified:
labs/jbossesb/branches/JBESB_4_9_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java
Log:
Fix description for deployments: JBESB-3520
Modified: labs/jbossesb/branches/JBESB_4_9_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_9_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java 2010-10-22 18:14:59 UTC (rev 35678)
+++ labs/jbossesb/branches/JBESB_4_9_CP/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ESBDiscoveryComponent.java 2010-10-22 18:22:07 UTC (rev 35679)
@@ -16,7 +16,6 @@
* @author Tom Cunningham
*/
public class ESBDiscoveryComponent extends MBeanResourceDiscoveryComponent<JMXComponent> {
- private static final String NAME = "name";
private static final String RESOURCE_KEY = "key";
private static final String SERVICE_DESCRIPTION = "service description";
@@ -25,15 +24,9 @@
Set<DiscoveredResourceDetails> jmxResources = super.discoverResources(context);
String versionNumber;
- String description = null;
EmsBean bean = context.getParentResourceComponent().getEmsConnection().getBean(SOADiscoveryComponent.SYSTEM_BEAN);
String resourceKey = null;
-
- for (Iterator i = jmxResources.iterator(); i.hasNext();) {
- DiscoveredResourceDetails drd = (DiscoveredResourceDetails) i.next();
- resourceKey = drd.getResourceKey();
- }
-
+
try {
EmsAttribute versionAttribute = bean.getAttribute(SOADiscoveryComponent.VERSION_NUMBER);
versionNumber = (String) versionAttribute.refresh();
@@ -41,32 +34,33 @@
versionNumber = "";
}
- try {
- EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
- String name = discoverBean.getBeanName().getKeyProperty(NAME);
- Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
- for (Iterator i = attributeSet.iterator(); i.hasNext();) {
- EmsAttribute attr = (EmsAttribute) i.next();
+ for (Iterator i = jmxResources.iterator(); i.hasNext();) {
+ String description = null;
+ DiscoveredResourceDetails drd = (DiscoveredResourceDetails) i.next();
+ resourceKey = drd.getResourceKey();
+ try {
+ EmsBean discoverBean = context.getParentResourceComponent().getEmsConnection().getBean(resourceKey);
+ Set<EmsAttribute> attributeSet = discoverBean.getAttributes();
+ for (Iterator ai = attributeSet.iterator(); ai.hasNext();) {
+ EmsAttribute attr = (EmsAttribute) ai.next();
- if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
- description = (String) attr.getValue();
- if (description != null)
- {
- description = description.trim();
- }
- }
- }
- } catch (Exception e) {
+ if (attr.getName().endsWith(SERVICE_DESCRIPTION)) {
+ description = (String) attr.getValue();
+ if (description != null)
+ {
+ description = description.trim();
+ }
+ }
+ }
+ } catch (Exception e) {
+ }
+ if ((description == null) || (description.length() == 0)) {
+ description = "Service Entity";
+ }
+ drd.setResourceVersion(versionNumber);
+ drd.setResourceDescription(description);
}
- if ((description == null) || (description.length() == 0)) {
- description = "Service Entity";
- }
-
- for (DiscoveredResourceDetails jmxResource : jmxResources) {
- jmxResource.setResourceVersion(versionNumber);
- jmxResource.setResourceDescription(description);
- }
return jmxResources;
}
-}
\ No newline at end of file
+}
More information about the jboss-svn-commits
mailing list