boolean activeMQAdapter = module.getVendorName().equals("activemq.org");
JCAAdminObject[] admins = PortletManager.getAdminObjectsForRA(renderRequest, module, new String[]{"javax.jms.Queue", "javax.jms.Topic"});
for (int j = 0; j < admins.length; j++) {
GeronimoManagedBean bean = (GeronimoManagedBean) admins[j];
ObjectName name = ObjectName.getInstance(bean.getObjectName());
String queueName = name.getKeyProperty(NameFactory.J2EE_NAME);
String physicalName = null;
try {
physicalName = (String) admins[j].getConfigProperty("PhysicalName");
} catch (Exception e) {
logger.warn("PhysicalName undefined, using queueName as PhysicalName");
physicalName = queueName;
}
String destType = admins[j].getAdminObjectInterface().indexOf("Queue") > -1 ? "Queue" : "Topic";
String vendorName = module.getVendorName();
DestinationStatistics destinationStat = null;
if (physicalName != null) {
try {
JMSDestinationInfo jmsDestinationInfo = new JMSDestinationInfo();
jmsDestinationInfo.setPhysicalName(physicalName);
jmsDestinationInfo.setType(destType);
jmsDestinationInfo.setResourceAdapterModuleAbName(PortletManager.getNameFor(renderRequest, module));
destinationStat = JMSMessageHelperFactory.getJMSMessageHelper(vendorName).getDestinationStatistics(renderRequest, jmsDestinationInfo);
} catch (JMSException e) {
destinationStat = new DestinationStatistics();
}
}
AdminObjectSummary adminObjectSummary = new AdminObjectSummary(bean.getObjectName(), queueName, physicalName, destType, bean.getState(), destinationStat);
adminObjectSummary.setQueueBrowserSupported(true);
adminObjectSummary.setTopicHistoryBrowserSupported(false);
if(activeMQAdapter) {
adminObjectSummary.setSendMessageSupported(true);
if(destType.equals("Queue")) {