use of com.sun.messaging.jmq.util.admin.DestinationInfo in project openmq by eclipse-ee4j.
the class JMSAdminImpl method getProviderDestinations.
/**
* Get all provider destinations.
*
* @return A multi dimensional array containing information about the JMS destinations. array[0] is a String[] listing
* the destination names. array[1] is a String[] listing the destination types.
* @exception JMSException thrown if array could not be obtained.
*/
@Override
public String[][] getProviderDestinations() throws JMSException {
ObjectMessage mesg = null;
mesg = session.createObjectMessage();
mesg.setJMSReplyTo(replyQueue);
mesg.setIntProperty(MessageType.JMQ_MESSAGE_TYPE, MessageType.GET_DESTINATIONS);
sender.send(mesg);
mesg = (ObjectMessage) receiver.receive(timeout);
mesg.acknowledge();
checkReplyTypeStatus(mesg, MessageType.GET_DESTINATIONS_REPLY);
Object obj;
if ((obj = mesg.getObject()) != null) {
if (obj instanceof Vector) {
Vector dests = (Vector) obj;
/*
* Remove temporary, internal and admin destinations by creating a new Vector and adding all the valid destinations into
* this new Vector.
*/
Vector validDests = new Vector();
for (int i = 0; i < dests.size(); i++) {
DestinationInfo di = (DestinationInfo) dests.elementAt(i);
if ((!MessageType.JMQ_ADMIN_DEST.equals(di.name)) && (!MessageType.JMQ_BRIDGE_ADMIN_DEST.equals(di.name)) && (!DestType.isInternal(di.fulltype)) && (!DestType.isTemporary(di.type))) {
validDests.add(di);
}
}
int numElements = validDests.size();
String[][] destinations = new String[2][numElements];
for (int i = 0; i < numElements; i++) {
DestinationInfo di = (DestinationInfo) validDests.get(i);
destinations[0][i] = di.name;
destinations[1][i] = this.getDestinationType(di.type);
}
return destinations;
}
}
return null;
}
Aggregations