Getting Multiple Event Type Definitions
The following example illustrates how you can use the BrokerAdminClient.getEventAdminTypeDefs method to obtain multiple event type definitions in one method invocation.
. . .
int i;
String event_names[];
BrokerAdminTypeDef defs[];
BrokerAdminClient c;
try {
/* Create a Broker admin client */
c = new BrokerAdminClient(broker_host, broker_name, null,
client_group, "My Broker Monitor",null);
/* Get a list of all event types */
event_names = c.getEventTypeNames();
/* Get the event definition for each event type */
defs = c.getEventAdminTypeDefs(event_names);
for(i = 0; i < defs.length; i++) {
/* Print the event def name and time-to-live value. */
System.out.println(“Event “+event_names[i]+” time-to-live=”
defs[i].getTimeToLive()+” seconds”+”\n”);
}
} catch (BrokerException ex) {
System.out.println("Error while getting the event type definitions\n"+ex);
return;
}
. . .