Skip to content

Instantly share code, notes, and snippets.

@soapplied
Last active December 19, 2015 01:38
Show Gist options
  • Save soapplied/5877005 to your computer and use it in GitHub Desktop.
Save soapplied/5877005 to your computer and use it in GitHub Desktop.
get SIBQueuePoint attributes
final Iterator it = queueNameSet.iterator();
while (it.hasNext()) {
final ObjectName obj = (ObjectName) it.next();
final String name = obj.getKeyProperty("name");
AttributeList attribList = server.getAttributes(obj,
new String[] { "depth", "state", "id",
"highMessageThreshold", "sendAllowed" });
Long depth = null;
String state = "";
String id = "";
Long highMessageThreshold = null;
Boolean sendAllowed = null;
for (Iterator j = attribList.iterator(); j.hasNext();) {
final Attribute a = (Attribute) j.next();
if (a.getName().equals("depth"))
depth = (Long) a.getValue();
else if (a.getName().equals("state"))
state = (String) a.getValue();
else if (a.getName().equals("id"))
id = (String) a.getValue();
else if (a.getName().equals("highMessageThreshold"))
highMessageThreshold = (Long) a.getValue();
else if (a.getName().equals("sendAllowed"))
sendAllowed = (Boolean) a.getValue();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment